Manage value from one web block with multiple instance

Hi All,


So I have a web block that accept a boolean parameter in which if the user click the container, it will toggle the value of that boolean parameter. 


It has a event that passes the new value of the boolean parameter.


In the Parent screen, I drag multiple instance of that web block and assign a single event handler to all of them . I assign each and every web block with a variable of type Boolean (Think like a checkbox) . Now, what I want is that the variable that I passed to the web block should get the new value depending if that web block was clicked or not.

See below for more details:


Sample screen shot of multiple instance of the web block


If the user click the first instance of the web block, I want the variable of it to be updated and get the value from the web block but how can I identify it since there is only one event handler for all of those instance of web block


Any help will be much appreciated.



Regards.  

Hi Jay,

I would be hard for you because you are using the single handler for all the instance of your web block.

If you want to capture it separately or you want to achieve different result in that case, i think you need to create the separate handler for each instance.

Regards,

Manish Jawla

Hi Jay,

when there's not much booleans involved, you might as well use a different handler for each, but when many booleans need a very similar handling, I can see the appeal in having a single handler for all of them.


See attached oml for 2 options, the left option i.m.o. should be avoided, having switches in code to know what situation you are in is hardly better than having separate handlers.

But the right option, where you put your booleans in a list might be appealing...


Dorine

Hi,


Use additional input parameters like type of webblock selected as text and pass value accordingly.


like first web block val='first' etc.


thanks

Hi All,


Yeah I was just thinking if I need additional parameter like index to map it to the correct variable.