Question
Capgemini
IT
Last activity: 22 Aug 2022 6:32 EDT
One field in a row of a table editable when the row is selected
Hi everyone,
I have to make one column in a table editable when the entire row is selected via radio button.
Only one row at time of the table can be selected (hence the radiobutton), so when the radio button is selected one field in the row become editable, when the user select the radiobutton of another row the field must return not editable
Any solutions?
Kind Regards,
Giulia
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 22 Aug 2022 6:32 EDT
Capgemini
GB
I have got this working on my test system in the following way:
1. Create table with a data source that is editable (if you're using a data page make sure it is editable and not refreshing on interaction, also if using pagelist property make sure it is not set to "refer to data page" otherwise the editing may not work properly)
2. Add the first column as .pySelected (or use any other boolean property), control as pxRadioButton, styling as Horizontal to make sure it doesn't take up too much vertical space.
3. .pySelected on change event should be configured to trigger the Refresh List action. Refreshing the whole list instead of just row is necessary because if you only refresh the row, on the clipboard it will only set pySelected to true for the current row, and not allow you to update other rows to false on selection of a new row.
4. Your editable column should be set to Read Only when expression .pySelected = false.
Eclat Prime
AU
If you are using a Table Layout, keep the editing option as Inline.
Define a flag , say "IsEnabled" which would be initialized to false. When the radio button is selected, set "IsEnabled" to true and refresh current row.
For the particular column you want to enable, use a when rule based on the flag "IsEnabled"
The other fields/columns in the table(except radio button), can always be ReadOnly.
Capgemini
IT
Hi @JayaL722,
Thanks for your reply.
This is exactly what I have done. Unfortunately the refresh row triggers some fail on the case (which I cannot trace because the whole thread becomes compromised) and completely blocks the form.
Giulia
Eclat Prime
AU
Did you try any other Refresh actions?
Capgemini
IT
Yes, also tried Refresh This Section.
I also tried to run data transform to set another property on which I put the logic for enabling the field to be editable.
This approach works, however if I move to another row the field remains editable.
Accepted Solution
Updated: 22 Aug 2022 6:32 EDT
Capgemini
GB
I have got this working on my test system in the following way:
1. Create table with a data source that is editable (if you're using a data page make sure it is editable and not refreshing on interaction, also if using pagelist property make sure it is not set to "refer to data page" otherwise the editing may not work properly)
2. Add the first column as .pySelected (or use any other boolean property), control as pxRadioButton, styling as Horizontal to make sure it doesn't take up too much vertical space.
3. .pySelected on change event should be configured to trigger the Refresh List action. Refreshing the whole list instead of just row is necessary because if you only refresh the row, on the clipboard it will only set pySelected to true for the current row, and not allow you to update other rows to false on selection of a new row.
4. Your editable column should be set to Read Only when expression .pySelected = false.