Why are my hidden controls visible in view mode?


Badge +10

Hi all,

I have a form with several containers in it. Some of these containers should be hidden as soon as a specific hook ("Print view") is set (like in this case the "Customer Data" container is hidden in print view):

213069_pastedImage_1.png

213070_pastedImage_2.png

Unfortunately this is only working in edit mode. As soon as I switch to view mode, all containers are visible. But I am pretty sure that this has already been working in the past... I checked all , if there is something like "inViewMode", overruling my hide controle rule, but there isn't.

Does anyone else has this problem? Is it maybe a NINTEX ‌?

Cheers

mai-kel


13 replies

Userlevel 5
Badge +14

can you maybe provide the actual code you are using in a rule to hide these so that we could replicate the conditions? 

Userlevel 5
Badge +14

can you post how does your rule looks like?

what type of control is that 'Print view' checkbox? can you post its configuration?

do you have any javascript or CSS in place that might overrule form's rule(s)?

Badge +10

Sure:

213118_pastedImage_1.png

213125_pastedImage_2.png

So the control which needs to be checked (in order to hide sections) has the name "Druckansicht"

If the hook is set, the complete container "Project Data" should be hidden.

This is the rule I used:

Druckansicht==1               Druckansicht is type Yes/No

then

Ausblenden (Hide)

As I said, as long as I am in edit mode this is working, but as soon as I switch to view mode it is not working any more?!?

EDIT, I just saw the following

 

Might it has something to do with this configuration:

213129_pastedImage_1.png

 

The print view checkbox is only visible in edit mode (sichtbar = visible | Bearbeitungsmodus = edit mode) - does that mean that also all rules bound to that control are valid in edit mode?

 

Seems so....

Badge +10

Sure:

213127_pastedImage_1.png

213128_pastedImage_2.png

So the control which needs to be checked (in order to hide sections) has the name "Druckansicht"

If the hook is set, the complete container "Project Data" should be hidden.

This is the rule I used:

Druckansicht==1               Druckansicht is type Yes/No

then

Ausblenden (Hide)

As I said, as long as I am in edit mode this is working, but as soon as I switch to view mode it is not working any more?!?

EDIT, I just saw the following

Might it has something to do with this configuration:

213126_pastedImage_1.png

The print view checkbox is only visible in edit mode (sichtbar = visible | Bearbeitungsmodus = edit mode) - does that mean that also all rules bound to that control are valid in edit mode?

Seems so....

Userlevel 5
Badge +14

so your appearance setting says the control is only visible in EDIT mode.

so in VIEW mode the control is not even created in page DOM model, hence in panel's rule you likely compare undefined==1, if it doesn't errors out at all.

remove appearance setting from yes/no control, place it into separate panel and apply show/hide rule on the panel if you want to have yes/no control available in VIEW mode.

Badge +10

I did exactly as suggested. Same result. sad.png

Unfortunately hidding a control is not only hidding a control but more a deactivation of that control ...

Userlevel 5
Badge +14

The way that you have this setup seems strange. 

You are indicating that you'd like the Yes/No Control to not be visible in a mode that isn't Edit Mode. This would mean that it would not be created in the DOM tree in any mode other than Edit Mode, which would mean that rules that depended on it wouldn't work. 

But that's not all. 

Because ALL controls are disabled in View / Display Mode It would also mean that you would need a user to first Check that box, Submit the Form, and then open it back up in View Mode for any of your panels to be hidden, which seems like a strange way to approach this... 

Why not just automatically hide the Secret Panel in View Mode instead??? 

Then you wouldn't need the Yes / No control in the first place.

Using a Rule, this is a simple task. Select the Panel you want to hide: 
213140_pastedImage_4.png


And then create a Rule for it with the following code: 

213141_pastedImage_5.png

In Edit Mode: 
213115_pastedImage_3.png


In Display Mode: 

213142_pastedImage_6.png




If you really must have it to be a toggled option in the View Mode, then the only thing I could think of to do would be to make a Rich Text / HTML control that had some html inside of it for a checkbox control that you could manipulate in all view modes, and subsequently base a rule off of, but that seems like a lot to do for something that could probably just be hidden all of the time in View Mode. 

I hope that this helps. 

Userlevel 5
Badge +14

I can't believe that, you must have likely missed some settings.

I've just tested it - I placed a Yes/No control on a (blue) panel which is shown in edit mode and hidden in view mode by a formatting rule.

it works as suggested, Yes/No control is 'available' in view mode and can be used in calculations/rules

213161_pastedImage_3.png

213162_pastedImage_4.png

213163_pastedImage_5.png

213164_pastedImage_6.png

Badge +10

Believe me. grin.png I just did an additional test:

Small list with a title field and a yes/no field. If YesNo field is set to yes, title is hidden. This works easily:

My list:

213167_pastedImage_2.png

First item (view mode):

213168_pastedImage_3.png

First item (edit mode):

213170_pastedImage_5.png

Second item (view mode):

213169_pastedImage_4.png

Second item (edit mode):

213171_pastedImage_6.png

All good.

Now I am adding this display setting (visible only in edit mode) to my Yes/no control:

213172_pastedImage_7.png

Looking into my list shows me the following:

First item (view mode):

213173_pastedImage_8.png

First item (edit mode):

213174_pastedImage_9.png

Second item (view mode):

213175_pastedImage_10.png

Second item (edit mode):

213176_pastedImage_11.png

So I guess nmarples‌ is right, when he is saying:

"You are indicating that you'd like the Yes/No Control to not be visible in a mode that isn't Edit Mode. This would mean that it would not be created in the DOM tree in any mode other than Edit Mode, which would mean that rules that depended on it wouldn't work."

Cheers

mai-kel

Userlevel 5
Badge +14

Now I am adding this display setting (visible only in edit mode) to my Yes/no control:

you are still playing around with control's appearance settings!

that's the reason respective control's DOM node is not created once hidden.

I've suggested:

(with the rule meaning formatting rule)

remove appearance setting from yes/no control, place it into separate panel and apply show/hide rule on the panel if you want to have yes/no control available in VIEW mode.

Userlevel 5
Badge +14

how did things turn out? did it work?

was I right or you still don't believe me? laugh.png

Badge +10

Yeah, it worked - for that reason I marked your answer as correct.

I am a believer now. wink.png

Badge +1

I think this is a bug as well. The same thing happened to me. I created a control and applied a hide rule--hide when Name is not blank: [named control]!='' 

It works fine in New mode (doesn't show) but the hidden control displays in View mode--but then not in Edit mode. I did not use any Common modes (e.g., 'Is Display Mode') in my rule.

Reply