Solved

action checkbox

Posted on 2003-12-08
18
842 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 7
  • 3
18 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9896652
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
ID: 9896822
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
ID: 9896851
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:WhiteLotus
ID: 9910340
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
ID: 9911238
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
ID: 9917014
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
ID: 9917017
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
ID: 9921040
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
ID: 9921351
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
 

Author Comment

by:WhiteLotus
ID: 9921591
and what is DO_NOTHING_ON_REPEAT ?
0
 
LVL 24

Expert Comment

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

Accepted Solution

by:
qwaletee earned 250 total points
ID: 9921854
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
ID: 9921938
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
ID: 9922650
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
ID: 9926488
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
ID: 9926606
Fred,

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

Author Comment

by:WhiteLotus
ID: 9927167
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
ID: 9931056
A little far from New York, but...
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

688 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