Focal Point
[SOLVED] Clear Checkbox Control

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6367017396

June 23, 2020, 07:15 AM
jltz83od
[SOLVED] Clear Checkbox Control
I have an html page, created using HTML canvas, that contains text areas, check boxes, and a submit button. I have one on click task associated with the submit button that runs a fex and refreshes the texts areas and check boxes. I cannot figure out how to get the refresh action to work for the check boxes when they follow a request to run fex file in the action list. The text areas refresh fine, and the check boxes will refresh if I remove the request to run the fex file. Is there anything I can do to make this work?

This message has been edited. Last edited by: jltz83od,


WebFOCUS 8.2.06, Windows
June 23, 2020, 08:18 AM
MartinY
When you say "refresh the check boxes", what action/result do you expect to have ?


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
June 23, 2020, 10:57 AM
jltz83od
Empty check boxes.


WebFOCUS 8.2.06, Windows
June 23, 2020, 01:02 PM
Hallway
In the onclick event add in the following:
  
document.querySelectorAll('input[type="checkbox"]').forEach(el=>el.checked = false)



Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
June 23, 2020, 04:19 PM
jltz83od
The onclick event works to clear the checkboxes; but, it clears them before the parameters are passed to the procedure. I can can make it work with two buttons, but thought for sure there would be a way to order tasks so that the same button could first pass the parameters and run the procedure, and then clear values from the check boxes. Setting the Refresh action on the text area input controls in the Tasks & Animations utility does this. I've explored the Properties for my submit button, but have not yet been able to figure out how to make it work.


WebFOCUS 8.2.06, Windows
June 25, 2020, 03:02 PM
vaayu
quote:
document.querySelectorAll('input[type="checkbox"]').forEach(el=>el.checked = false)

You can create a new function to clearCheckBoxes with this one line and add it to your task as last action. Or you could do it all as one JS function by running the report using IBcomposer_triggerExecute followed by this clearAll jquery script.


-********************
Sandbox: 8206.10
Dev: 8201M
Prod:8009
-********************
June 26, 2020, 06:44 PM
jltz83od
Wow. I really thought that I had tried that. I guess not. Thank you!


WebFOCUS 8.2.06, Windows