I’m wanting to populate some editable fields from a Response doc listed in a View Panel when the user clicks on a column. Setting a Computed field’s value is easy but I’m missing something when it comes to Editable fields.
Data Binding to the field, having set the Data Source using a sessionScope variable fails. getComponent().setValue fails. What other ways are there please?
Have you tried setting the value to the editable field under:On Editable field - ‘all propeties>data>value’?
That’s what I use to populate my editable fields and I too am using some sessionscopes. Something to mention is that you will also most likely need to run a partial refresh AFTER setting the scoped variable (as it’s an editable field. You may or may not need to do this). So if you set the column on your view panel to refresh your editable field id under onclick or onchange that may do the trick.
Sorry made a mistake there, I meant ‘defaultvalue’ as opposed to ‘value’.
‘Value’ like you said should bind it to your datasource, ‘defaultvalue’ should allow you to set the sessionscope variable to the field, providing it gets refreshed in some way in the front end.
In my database, I’m navigating away from the xpage that sets the variable, to another page. Once the user has completed that page, they’re sent back again to the original page(which then refreshes the field for me with a default value from the sessionscope), so this works fine for me in my particular case. In your case as you’re not navigating away, so a partial refresh by id may be a nicer way of doing it for you and with any luck will bring the same results.
DefaultValue only seems to get set when you first open a page.
Partial Refresh is ideally what I want, but I’ve tried with Partial and Full refresh with no joy. Also I’ve switched on “No Validation” in the View Panel Column in order that the Validation on the mandatory fields is not triggered.