XPages – Saving data sources bound to a panel – a lesson learned
Posted by MarkyRoden on October 9, 2013
In this article I will highlight/document an issue which I came across today – using a Save Button and a Document Data source bound to a panel.
so this is what I learned today
When you have an xpages document data source bound to a panel
<xp:panel id="widgetContentsWrapper" styleClass="widgetContentsWrapper"> <xp:this.data> <xp:dominoDocument var="widgetsDoc" formName="Widgets" scope="request"> </xp:dominoDocument> </xp:this.data>
and a save button to “saveDocument”
<xp:button styleClass="btn btn-primary modal-ok" value="Submit Button" id="button1" disableTheme="true" > <xp:eventHandler event="onclick" submit="true" refreshMode="complete"> <xp:this.action> <xp:actionGroup> <xp:saveDocument var="widgetsDoc"></xp:saveDocument> </xp:actionGroup> </xp:this.action> </xp:eventHandler> </xp:button>
The button must be within the panel – otherwise for absolutely no apparent reason it just does not work. I checked the form – yes data was being submitted but apparently not saved.
I have never experienced this before because I have never used a data source bound to a panel before – now I know better!
I hope you do not have to share my pain…