Skip to main content

Is it possible to initialize an item view from scratch after a selection within a control of another view?

 

I have following situation:

 

I have a form which contains 2 views.

The second view is shown depending on the selection within a drop down within the first view.

The second view initially has all controls hidden.

Depending on the selection within the first view, the second view is shown and specific controls are shown.

When chaning the selection within the first view again, the second view is shown and specific controls are shown.

The problem now ist, that the controls which were shown by the first selection are still shown and now too many controls are shown.

I would like to "reinitialize" the second view on selection within the first view from scratch so that the hidden states of the controls are reset. I would like that the second view is always initializing "fresh" with all the initial hidden states.

 

Is that possible?

I do not want to hide every control manually, because there are a lot of controls within that second view and there is no bulk hiding available!

Good day CK_Miba


 


Please see the following.


“How to Hide all other views on the selection on one Checkbox”: https://community.k2.com/t5/K2-Blackpearl-Forum-Posts/How-to-Hide-all-other-views-on-the-selection-on-one-Checkbox/td-p/103893,


“How to show/hide/validate controls based on content of another control”: https://community.k2.com/t5/K2-Appit-Articles/How-to-show-hide-validate-controls-based-on-content-of-another/ta-p/91497.


 


Best,


Sunrise


Unforunately manually hiding the controls will be a lot of work - that's why I tried to find out if there is some other way to do this.

 

I am already using tables.

My View contains 30 hidden Tables with 10 hidden controls each.

To manually hide the controls, this would mean to set the properties of 300 controls - which means to define 300 rules 😞.

 

Sample szenario:

- Selection within another view (drop down control) changes

- Depening on the selection, the second view should show some data within the controls which are part of the 30 tables

- Several controls within Table 1, Table 2 and Table 3 are made visible - nothing else

- Change of the selection within the drop down control again

- Some other controls within Table 1, Table 4 and Table 5 should be shown - nothing else

- When doing this manually, I need to hide all controls within all tables first and then make the right ones visible

 

When I could somehow newly initialize the second view (so that all the hidden states are reset) when the drop down changes, then I would not need to do a manual step here.


Sorry but I don't think there is a built-in way to do it - while tedious, I think the best solution is to make a rule on your view to set the visibility of all controls to hidden (or visible, whatever the default is) and use that to put everything back to a known starting point. That rule could end up being useful for other things, and I usually do make such a rule a standard part of every view. You never know when it may come in handy for future enhancements, so it is worth the time investment.


Reply