Home › Forums › Presentation › Controls › Which event is fired when I uncheck a checkbox in the grid?
- This topic has 7 replies, 3 voices, and was last updated 8 years, 10 months ago by
Rafael Reis.
-
AuthorPosts
-
-
April 26, 2016 at 9:27 am #6475
Rafael Reis
ParticipantI have a check box in a grid that is generate by the framework when I set the “format” to “shortBoolean” but I don’t know which event is fired when I uncheck the combo box.
0 -
April 26, 2016 at 6:48 pm #6484
Ed Shaw
KeymasterI see no responses yet from UI experts so here is a quick guess on my part that will be followed up with a better answer by someone else I’m sure.
I believe when you click on the column you will get a sysSelect event raised from, for instance, the source (EntityList grdEntity) and you can inspect the parameter argument for perhaps more info.
In addition, you should be able to create a custom UIEvent (e.g. myGridColEvent) and then set the event property of your column to myGridColEvent. Then create a UIAction that responds to your event.
I hope this helps a bit. I’m not near a working dev environment to exactly confirm.
1-
This reply was modified 8 years, 10 months ago by
Ed Shaw.
-
April 27, 2016 at 12:52 pm #6492
Owen Pond
ParticipantThe simplest approach is the one suggested by Ed above.
“…you should be able to create a custom UIEvent (e.g. myGridColEvent) and then set the event property of your column to myGridColEvent. Then create a UIAction that responds to your event.”
There is perhaps a more “correct” approach but it requires more work. It involves the following.
1. Set the grid column to “refreshAlways”.
You’ll need to modify the form’s script with a line similar to the following.
((this’findView ‘(columnName))’refreshAlways #t)
2. Create a data action to listen for a change in the boolean value that you are concerned with.
<DataAction association=”Your Attribute Name” condition=”(= locator ‘attribute)” constant=”false”>
<Script><![CDATA[ your logic ]]></Script>
</DataAction>
The reason that we set the grid column to refresh always is to force the data action to fire on the server in real time. Otherwise the data action will fire, assuming that you are working in a popup, when the popup closes.
0-
April 28, 2016 at 9:49 am #6504
Rafael Reis
ParticipantI am sorry, but I meant check box, not combo box.
0-
April 28, 2016 at 10:31 am #6512
Ed Shaw
KeymasterGot that – no confusion. The answers are geared towards the checkbox.
0 -
April 28, 2016 at 11:05 am #6519
Rafael Reis
ParticipantI tried your solution, but it didn’t work. I need to know when the user actually unselected the check box than will display a dialog to confirm his action, if the user choose YES it would actually uncheck the box, otherwise it would just stay as checked.
0 -
April 28, 2016 at 1:50 pm #6529
Owen Pond
ParticipantAttached is an example which does what i think that you want to do. You will need to create a popup based on the provided screen in order to test the example. This example does the following:
- Displays a list of instances in a grid.
- If you un-select a check box in the grid, you are presented with a yes/no message box to confirm your action.
- If you select no, the check box remains selected.
2-
This reply was modified 8 years, 10 months ago by
Owen Pond.
Attachments:
You must be logged in to view attached files. -
April 29, 2016 at 3:52 pm #6539
Rafael Reis
Participantthank you, that works! đŸ™‚
0
-
-
-
This reply was modified 8 years, 10 months ago by
-
-
AuthorPosts
- You must be logged in to reply to this topic.