mardi 7 novembre 2017

Uncheck checkbox

I want to uncheck the checkbox depending on some conditions.

Eg., Combo A is set to yes Combo B is set to yes Combo C is set to No Then a table appears with 6 checkbox and the user can select any checkbox depending on usage.

Now, if Combo C is set to yes and the page is saved, then I'm resetting the checkbox by setting them to false (checkbox.setChecked(false)). But once again if user selects combo C as No then the table appears with the previous selected checkboxes which shouldn't happen.

I can't give the code, so I will right a short form of it.

If((combo A is yes) && (combo b is yes) && (combo C is no)) then user selects the checkbox (out of 6 displayed in a table) and the checkbox is set to true as, checkboxOfCount.setCheckBox(true)

Else if ((combo A is yes) && (combo B is yes) && (combo C is yes)) then, I'm setting all the checkboxes in the table to false as, checkboxCount.setCheckBox(false)

Note : checkbox is a boolean type in a VO for the table and the getter and setters are present accordingly.

All code is done in Spring architecture of Java and the above is done at code level, as I can't use the scripts due to some security reasons.




Aucun commentaire:

Enregistrer un commentaire