Note that there are some explanatory texts on larger screens.

plurals
  1. POXPages xe:listView won't hide the columns
    text
    copied!<p>I created a sample to demonstrate. I have a view called "testView" with three columns referencing "field1", "field2", "field3". </p> <p>When I run this XPage all three columns in the display when it should not show the third column. Clicking the button does not hide the second column either. </p> <p>Can anyone tell me what I have wrong? </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" xmlns:xc="http://www.ibm.com/xsp/custom"&gt; &lt;xp:this.beforePageLoad&gt;&lt;![CDATA[#{javascript:if ( sessionScope.showCol2 == null ) sessionScope.showCol2 = true;}]]&gt;&lt;/xp:this.beforePageLoad&gt; &lt;xe:restService id="restService1"&gt; &lt;xe:this.service&gt; &lt;xe:viewJsonService viewName="testView" defaultColumns="true"&gt; &lt;/xe:viewJsonService&gt; &lt;/xe:this.service&gt; &lt;/xe:restService&gt; &lt;xp:panel style="margin-left:20.0px;margin-top:20.0px"&gt; &lt;xe:listView id="listView1" storeComponentId="restService1"&gt; &lt;xe:listViewColumn id="listViewColumn1" columnName="field1" columnTitle="Field1"&gt; &lt;/xe:listViewColumn&gt; &lt;xe:listViewColumn id="listViewColumn2" columnName="field2" columnTitle="Field2"&gt; &lt;xe:this.rendered&gt;&lt;![CDATA[#{javascript:return sessionScope.showCol2; }]]&gt;&lt;/xe:this.rendered&gt;&lt;/xe:listViewColumn&gt; &lt;xe:listViewColumn id="listViewColumn3" columnName="field3" columnTitle="Field3" rendered="false"&gt; &lt;/xe:listViewColumn&gt; &lt;/xe:listView&gt;&lt;/xp:panel&gt; &lt;xp:panel style="margin-top:20.0px;margin-left:20.0px"&gt; &lt;xp:button id="button1" value="Toggle Column 2"&gt; &lt;xp:eventHandler event="onclick" submit="true" refreshMode="partial" refreshId="listView1"&gt; &lt;xp:this.action&gt;&lt;![CDATA[#{javascript:if ( sessionScope.showCol2 == false ) { sessionScope.showCol2 = true; } else { sessionScope.showCol2 = false; }}]]&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