I am having two web blocks in one screen. Both of them contain lists. Using a save button in the screen, I want to save both lists.
I created two hidden buttons in both web blocks and used 'RunJavaScript' to click on the buttons using the "$.Class.click()" function. But only one of the flow is getting executed.
I tried using two separate classes and two javascripts in the save action, but then only first one gets executed.
Please help on how do I solve this?
Please check oml.
Hi Aastha,
Try setting class "hidden" instead of setting visible property as "False" on buttons in both web blocks and then call both buttons click event using common/dummy class name assigned to them as below from Outer Button Click handler.
document.getElementsByClassName($parameters.btncss)[0].click();
document.getElementsByClassName($parameters.btncss)[1].click();
Also set "Is Form Default" to "No" for both the buttons if they are inside form.
Hope this would help.
Demo link : MultipleButtonClick
Hi Bhupendra, can you please share the oml for this? demo link is only the web link, i can't see the code without oml
it is working now. Thanks a lot!
Hi Aastha Luthra,
Instead of calling Js, you can simply pass the list values via Events of the each blocks,
Then you can handle it in the screen and you can pass the value into the save action with the help of assigned local list.
For more details, look into the attached oml file FYR ( I did this in Reactive, you can follow the same to implement in Traditional)
Hi Deepak, thanks for the advice, but I have multiple validations before saving the list so would it not get complicated?
No, it won't be complicated you can handle with two different handlers to avoid confusions and hidden issues
thanks for the method
Your welcome, If the issue is fixed, please hit the mark as solution.
actually i did not need to try this one, the first solution worked so i marked it as solution