Note that there are some explanatory texts on larger screens.

plurals
  1. POPartial refresh on dynamic field binding removes values
    text
    copied!<p>Really looking for an idea why my XPage is doing this.</p> <p>I have field with a dynamic databinding:</p> <pre><code>&lt;xp:inputText id="CORE_Input" value="#{Document[compositeData.PARA_DataBinding]}"&lt;/xp:inputText&gt; </code></pre> <p>That works quit well until I start to hide it based on a notes formula.</p> <p>Let me tell what it does: I click a checkbox in my XPage. That checkbox is running SSJS which is calling: <code>Document.getDocument(true)</code> to push the data from my XPage back into the notesdocument without saving it. Once that is done I can use <code>session.evaluate("checkbox!="something"")</code> to hide the inputText field. </p> <p>It works quit well but the problem is that once I untick the checkbox the value is gone from the inputfield.</p> <p>If you know a better way to use notes formulas for hiding or the reason why the inputfield is empty once it comes back would be highly appreciated. Here is an example:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xe="http://www.ibm.com/xsp/coreex"&gt; &lt;xp:checkBox id="checkBox1" value="#{Document.Check}" text="hide" checkedValue="hide"&gt; &lt;xp:eventHandler event="onchange" submit="false"&gt; &lt;xp:this.script&gt;&lt;![CDATA[document.getElementById("#{id:hide}").click()]]&gt;&lt;/xp:this.script&gt; &lt;/xp:eventHandler&gt; &lt;/xp:checkBox&gt; &lt;xp:panel id="test"&gt; &lt;xp:inputText id="CORE_Input" type="#{compositeData.NODE}" value="#{Document[compositeData.PARA_DataBinding]}" defaultValue="#{javascript:compositeData.PARA_DefaultValue}" style="margin-left:24px"&gt; &lt;xp:this.styleClass&gt;&lt;![CDATA[#{javascript:DOMElement.getAttribute("stylesize");}]]&gt;&lt;/xp:this.styleClass&gt; &lt;xp:this.rendered&gt;&lt;![CDATA[#{javascript:var doc:NotesXspDocument=Document; var erg=session.evaluate('Check="hide"',doc.getDocument()); if(@Text(erg)=="1") {return false} else {return true}}]]&gt;&lt;/xp:this.rendered&gt; &lt;/xp:inputText&gt; &lt;xp:button value="hide" id="hide"&gt; &lt;xp:eventHandler event="onclick" submit="true" refreshMode="partial" refreshId="test"&gt; &lt;xp:this.action&gt; &lt;![CDATA[#{javascript:var doc:NotesXspDocument=Document;doc.getDocument(true)}]]&gt;&lt;/xp:this.action&gt; &lt;/xp:eventHandler&gt;&lt;/xp:button&gt; &lt;xp:button value="unhide" id="unhide"&gt; &lt;xp:eventHandler event="onclick" submit="true" refreshMode="partial" refreshId="test"&gt; &lt;xp:this.action&gt;&lt;![CDATA[#{javascript:sessionScope.hide=""}]]&gt;&lt;/xp:this.action&gt; &lt;/xp:eventHandler&gt;&lt;/xp:button&gt; &lt;/xp:panel&gt;&lt;/xp:view&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload