Solved

action checkbox

Posted on 2003-12-08
18
817 Views
Last Modified: 2013-12-18
Lotus Notes dev:

hello,

I have a layer whithin a form containing a picture
I would like to set an option to hide/show this layer.

This option shouldn't be set within the form (as a field)  but rater as an temporary variable.
always set off by default when opening documents.


I was thinking of using an action checkbox setting an environment variable.
I'm trying to undertand how to use it but ther is absolutely no help about it.

then my questions are ?

Is it the best way to do it ?
Should I rather use a Profile document ?
Anyone have an example of an action checkbox ?
how to directly show/hide an element (with formula) ?
is @environment fast enougn and dynamic ?

best regards,


frederic Hesse
0
Comment
Question by:WhiteLotus
  • 8
  • 7
  • 3
18 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
Comment Utility
You can use checkbox (say FLD1), In the input translation of the field enter this field

FIELD FLD1 := @DeleteField; ""

In this way it will delete the content of the field and not save..and just display null when opened next time.


~Hemanth
0
 
LVL 31

Expert Comment

by:qwaletee
Comment Utility
I assume you are doing this for a Notes client release 6 or later, and not for a web browser.

You can do it as you described, but I thought you did not want to use a field?  A checkbox is a field!  If you want to use a checkbox, follow Hemantha's directions.  But you would need several more things.

1) On the Checkbox Options tab of the properties box, enable the option, "Refresh fields on keyword change."  Otherwise, checking/unchecking the box will have no immediate effect.

2) Let's say you name the checkbox DisplayLayer.  You need to make your layer sensitive to this field.  Place the cursor next to the layer anchor" (small icon, looks a bit like a DocLink, two white sheets of paper).  Open paragraph properties.  Click on the Hide-When tab.  Enable the option, "Hide paragraph when formula is true."  Add the following formula: DisplayLayer=""

0
 
LVL 31

Expert Comment

by:qwaletee
Comment Utility
Here's how  would do it:

1) Create a hidden field named HideLayer, Number type, computed for display, with the following formula: @If(@IsDocBeingLoaded; @False; DisplayLayer)

2) You need to make your layer sensitive to this field.  Place the cursor next to the "layer anchor" (small icon, looks a bit like a DocLink, two white sheets of paper).  Open paragraph properties.  Click on the Hide-When tab.  Enable the option, "Hide paragraph when formula is true."  Add the following formula: HideLayer

3) Display the action pane (View->Action Pane)

4) Create -> Action

5) Name it DISPLAY LAYER

6) Enable the Hide-When option, "Hide paragraph when formula is true."  Add the following formula: !HideLayer

7) Set the action formula (bottom pane) to: FIELD HideLayer := @False; @Command( [RefreshHideFormulas] )

8) Create a similar action, but the hide-when is (HideLayer) instead of (!HideLayer) and teh action formula sets (:=@True;) instead of (:=@False)
0
 

Author Comment

by:WhiteLotus
Comment Utility
Dear Lotus devs,

I undertand that the easiest way to do it would be to insert a checkbox field. But I believe it is totaly unaceptable to insert a field in every single document in order to manage a general option.
My old c++ master would have killed me if I would have show up with such a solution ;-P.
I simply don't want to have (even one byte) of global variable stored in each document. thanks for helping me doing it.

I really would like to learn how to make a global var in LN or at least an environm. var.

Qualetee:
Yes i'm on N6.0.3 not for web.
I asked for a checkbox action, I'm not quite sure about how actions are stored in lotus notes (is it stored as a field?).

I'll try your solution today. I think it is just what i need.
I'll give you a feed back. Thank you so much.

0
 

Author Comment

by:WhiteLotus
Comment Utility
Another thing who is important:

 to enable/disable this layer , the user may not have the permission to change the document itself (thus no writing access to Hidelayer field)
0
 
LVL 31

Expert Comment

by:qwaletee
Comment Utility
Hmm, if there is no access to fields, then use an environment variable instead...

FIELD HideLayer := @False/@True;
becomes
ENVIRONMENT HideLayer := "0"/"1"

Hide formula (HideLayer) becomes (@Environment("HideLayer")="1"), and (!HideLayer) becomes (@Environment("HideLayer")="0")

And, you need to initialize the environment variable as the form loads.  The EASIEST way to do this is to create a hidden, computed for display field, at the VERY TOP of the formname does not matter.  the formula would be: @If(@IsDocBeingLoaded; @SetEnvironment("HideLayer";"0");DO_NOTHING_ON_REPEAT)
0
 
LVL 31

Expert Comment

by:qwaletee
Comment Utility
Action buttons are stored on the form definition, but are not stored with the document (unless you set forms to get stored in documents, an uncommon setting).
0
 

Author Comment

by:WhiteLotus
Comment Utility
thank you for the great explainations,

It work but under a action button "hide" and another buton "show"

Now, i would like to merge it into an checkbox action.

this still doesn't work. when change the action display type from button to checkbox, a formula value field becomes available.

What is the PURPOSE of this field ?
How am I supposed to use it ?
What kind of formula lotus is expecting there ?

thank you so much .
0
 
LVL 24

Expert Comment

by:HemanthaKumar
Comment Utility
You are confusing...

>the user may not have the permission to change the document itself (thus no writing access to Hidelayer field)

Meaning that some users can never see the document in edit mode..in that case how does checkbox work ? It won't ?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:WhiteLotus
Comment Utility
and what is DO_NOTHING_ON_REPEAT ?
0
 
LVL 24

Expert Comment

by:HemanthaKumar
Comment Utility
Just a dummy variable.. instead you can put "" too
0
 
LVL 31

Accepted Solution

by:
qwaletee earned 250 total points
Comment Utility
You really want to make me work hard, don't you?

I assume by this time you understand how environment variables work, and how @If works.  The new formula field (the tiny "@" button) repesenets a formula that determines whether the action btton checkbox is enabled or disabled.  If the formual evaluates to true, the checkbox goes on.  If it evaluates to flase, the checkbox is cleared.

The other thing you need to do is change the existing action formula from one that ALWAYS tunrs the variable on or always turns it off, to one tat retrieves the current value -- @Environment("HideLayer") -- then changes the  variable - @SetEnvironment("HideLayer"; new value) -- and runs @Command([RefereshHideFormulas]).  The same refreshhide will cause the checkbox formula to reevaluate.
0
 

Author Comment

by:WhiteLotus
Comment Utility
EMANTHAKumur :  I'm aking and using an ACTION checkbox and not a checkbox FIELD.
there may be the confusion.

The way it finaly works (and edors right are not requested):

the checkbox action :
  on click:
    @If(@Environment("HideLayer")="0";
    @Do(@Environment("HideLayer";"1");@Command( [ReloadWindow] ));
    @Do(@Environment("HideLayer"; "0");@Command( [ReloadWindow] )));
    @Command( [RefreshHideFormulas] );
    @Command( [RefreshWindow] )

  the Action checkbox display value :
    @If(@Environment("HideLayer")="0";@True;@False)

the layer's hide when .. formula :
  @Environment("HideLayer")="1"


it is great ! and i have no extra hidden field there ;-)  thanks so much , and please .....
and what is DO_NOTHING_ON_REPEAT ?

Frederic Hesse
0
 
LVL 31

Expert Comment

by:qwaletee
Comment Utility
DO_NOTHING_ON_REPEAT is a variable.  Variables that are not asigned a value have a default value of null string.  So, I could have put in either:

@If(@IsDocBeingLoaded; @SetEnvironment("HideLayer";"0"); "")
@If(@IsDocBeingLoaded; @SetEnvironment("HideLayer";"0"); DO_NOTHING_ON_REPEAT)

Which do you think is more clear? The purpose is to reset the flag as the form loads, but not if the field recalculates any other time.  @If always requires an else clause.  So, for an else clause, you can use a null string if yuo want it to do nothing.  And I use a dummy variable instead of the null string to make it a litle more clear to someone examining the code.
0
 

Author Comment

by:WhiteLotus
Comment Utility
Thanks so much.

It is quite funny to get so much troubble for a so simple thing.

I was just checking if your DO_NOTHING_ON_REPEAT wasn't a RESERVED variable or an hidden ;-P kind of weard parameter telling the compilator not to execute the @if() is included in a N6 formula loop.

Which do you think is more clear?
as i ever used the
@If(@IsDocBeingLoaded; @SetEnvironment("HideLayer";"0"); "")
style I'm just used to it :-)

I really appreciate your help and wonder what is leading you to spend (quite a lot of) time in order to answer people questions ?
Really, I would be interested to know ?

best regards
Fred Hesse
(IBM CAD N6)
0
 
LVL 31

Expert Comment

by:qwaletee
Comment Utility
Fred,

Beats me.  Too much time on my hands.  Need a job.
0
 

Author Comment

by:WhiteLotus
Comment Utility
Should be easy for you to get a job ; if you are not already, got certified IBM ;-)

I'm based in geneva , switzerland , if I hear something I let you know.

0
 
LVL 31

Expert Comment

by:qwaletee
Comment Utility
A little far from New York, but...
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now