Hi,
Any suggestions for the following?:
I have a paging table that is perfect for indentfying a row to update. After clicking on a field in a row, I need (or would prefer) to use a (normally hidden) single row editable table in a popup window to udate that same data. Using this single row editable table in the popup would have the benefit of also allowing insert and delete functions in cases where the user wants to do that as well. I would also think that I could avoid a server round trip to populate the editable table if I can push the selected row into the editable table on the client.
I can use an onclick event on the paging table at the group level to select fields from the paging table and place them almost wherever I want using 'set value from field', and that works fine, except if I specify an editable table element (remains empty).
Is it possible to do this somehow?
Thanks
Bob
Any suggestions for the following?:
I have a paging table that is perfect for indentfying a row to update. After clicking on a field in a row, I need (or would prefer) to use a (normally hidden) single row editable table in a popup window to udate that same data. Using this single row editable table in the popup would have the benefit of also allowing insert and delete functions in cases where the user wants to do that as well. I would also think that I could avoid a server round trip to populate the editable table if I can push the selected row into the editable table on the client.
I can use an onclick event on the paging table at the group level to select fields from the paging table and place them almost wherever I want using 'set value from field', and that works fine, except if I specify an editable table element (remains empty).
Is it possible to do this somehow?
Thanks
Bob
RE: Passing data into an Editable Table on client
I think there are a couple of options to do this.
The first would be to use a Partial Page which contains the editable table. This would still mean a call to the server, but it would not be a full page refresh and so the user experience would be better. You would need to send the details retrieved from the paging table in the partial page request, and then render the editable table as needed.
Alternatively, if you want to do this totally client side, you would first need to make sure that your (initially hidden) editable table always renders with only 1 row.
You can do this by changing the Repeating Data Location binding for the EditableTable repeat to something like '/*[1]'.
Next you will need to adjust the onclick events for your paging table group.
As your paging table is outside of the repeat that represents the editable table, any set value events you use will always update the first row in the editable table. This is what we want in this case, so the set value events can be used to update the values in the editable table fields.
The editable table adds an additional complication however as it is normally shown in 'display only' mode. The set value event will update the value in the editable controls, but as the display only view is normally visible, this will not be obvious to the user.
Therefore you need to add an additional step to update the display value for each field that has been changed. To do this, add a Custom Script onclick action to your group (after the set value ones) and insert a line like the following for each value that has been set.
hyf.editabletable.updateDisplayOnlyValue(document.getElementById('<editable table repeat name>1<target field name>_container'));
Where <editable table repeat name> is the name of the repeat on your page for the editable table being updated (defaults to 'EditableTable') and <target field name> is the name of the field within the editable table that has been updated (eg 'table_field1').
This should ensure that the editable table display values get updated straight away as well as the hidden editable fields.
You should then be able to process the data from the editable table in the usual way.
I hope this helps.
Regards,
Gerard
RE: Passing data into an Editable Table on client
Thanks Gerard