Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I faced a similar issue some time back and I <em>think</em> you are facing the same. Here is what I found out.</p> <p>Let's say in your panel you have combo box and then edit box (the order is important) with visibility of edit box is dependent on value of combo box. When you change the value of combo box the edit box is visible or hidden but its value gets cleared (refer below code snippet).</p> <pre><code>&lt;xp:panel id="panel1"&gt; &lt;xp:comboBox id="comboBox1"&gt; &lt;xp:selectItem itemLabel="No" itemValue="No"&gt;&lt;/xp:selectItem&gt; &lt;xp:selectItem itemLabel="Yes" itemValue="Yes"&gt;&lt;/xp:selectItem&gt; &lt;xp:eventHandler event="onchange" submit="true" refreshMode="partial" refreshId="panel1"&gt; &lt;/xp:eventHandler&gt; &lt;/xp:comboBox&gt; &lt;xp:inputText id="inputText1"&gt; &lt;xp:this.rendered&gt;&lt;![CDATA[#{javascript:getComponent("comboBox1").getValue() == "Yes"}]]&gt;&lt;/xp:this.rendered&gt; &lt;/xp:inputText&gt; &lt;/xp:panel&gt; </code></pre> <p>But if I swap the two components so that we have edit box and then combo box (remember, the order is important) and then change the value of combo box, the value in edit box is restored when edit box is visible again (refer below code snippet).</p> <pre><code>&lt;xp:panel id="panel1"&gt; &lt;xp:inputText id="inputText1"&gt; &lt;xp:this.rendered&gt;&lt;![CDATA[#{javascript:getComponent("comboBox1").getValue() == "Yes"}]]&gt;&lt;/xp:this.rendered&gt; &lt;/xp:inputText&gt; &lt;xp:comboBox id="comboBox1"&gt; &lt;xp:selectItem itemLabel="No" itemValue="No"&gt;&lt;/xp:selectItem&gt; &lt;xp:selectItem itemLabel="Yes" itemValue="Yes"&gt;&lt;/xp:selectItem&gt; &lt;xp:eventHandler event="onchange" submit="true" refreshMode="partial" refreshId="panel1"&gt; &lt;/xp:eventHandler&gt; &lt;/xp:comboBox&gt; &lt;/xp:panel&gt; </code></pre> <p>It seems the value in components before the partial-refresh-triggering-component get submitted while others do not. Regarding the reason for this behavior, I have <em>no</em> idea! I would really like if some one could throw some light on this as this has led me to redesign my XPages quite a few times!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

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