Toggling Show/Hide for Hundreds of Elements

My app will have hundreds of fields that the user can edit, and I want a user interface where they can selectively decide to show the help text for each field by clicking on a help icon next to the field input.

To do this with the conventional method of show/hide an element in Wappler requires me to define hundreds of variables, which will (a) be tedious and (b) clog up my data bindings window.

Hence I’m looking for a better way.

Now each field will have a number associated with it which relates to an array containing all the app’s text field’s based on the selected language.

So I am thinking to create a parallel array containing the binary values which manage the display of the help text. The index for the values I need will be non-continous and when the page loads the values should all be 0, so something like this:

show_help[1000] = 0
show_help[1010] = 0
show_help[1020] = 0
show_help[1130] = 0

Then when the user clicks on the show help text icon for field with index 1020 then it will set:

show_help[1020] = 1

and the appropriate help text will be displayed.

So my questions are:

  1. Does this seem the best way to achieve my objective.
  2. How do I best create and manage this array within Wappler?

Best wishes,
Antony.

Community Page
Last updated: