0
votes

I would like to update an underlying xp:inputTextarea from a xe:dialog control.

Here is sample code from a button available in my dialog:

<xp:button value="OK">
<xp:eventHandler event="onclick" submit="true" refreshMode="partial" refreshId="txtComment" disableValidators="true">
<xp:this.action><![CDATA[#{javascript:var dialog = getComponent("dlgCommentNPAC");
dialog.hide();
getComponent("txtComment").setValue("some dummy text")}]]></xp:this.action>
</xp:eventHandler>
</xp:button>

Here is the underlying textarea input control:

<xp:inputTextarea id="txtComment"
value="#{appBean.order.comment}"/>
</div>

The function to close the dialog and update the textarea breaks at

getComponent("txtComment").setValue("some dummy text")

I am not sure what I am doing wrong here?

2

2 Answers

1
votes

The hide() method can take a parameter that is the ID of the area to refresh after the dialog has been closed. Further details of what actually occurs when SSJS runs to hide a dialog can be found on a blog post I did http://www.intec.co.uk/xpages-dialog-control-and-partial-refreshes/

0
votes

Please update the value in the bean (appBean.order.comment) and partial refresh a panel, which is surrounded by the textarea when closing the dialog