2012-12-08 2 views
1

설명 할 샘플을 만들었습니다. "field1", "field2", "field3"을 참조하는 세 개의 열이있는 "testView"라는보기가 있습니다.XPages xe : listView 열을 숨기지 않습니다

세 번째 열이 나타나면 안되면 디스플레이에 세 개의 열 모두를 XPage로 실행할 때. 버튼을 클릭해도 두 번째 열이 숨겨지지 않습니다.

아무도 내가 잘못한 것을 말할 수 있습니까?

<?xml version="1.0" encoding="UTF-8"?> 
<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"> 

    <xp:this.beforePageLoad><![CDATA[#{javascript:if (sessionScope.showCol2 == null) 
    sessionScope.showCol2 = true;}]]></xp:this.beforePageLoad> 
    <xe:restService id="restService1"> 
     <xe:this.service> 
      <xe:viewJsonService viewName="testView" 
       defaultColumns="true"> 
      </xe:viewJsonService> 
     </xe:this.service> 
    </xe:restService> 
    <xp:panel style="margin-left:20.0px;margin-top:20.0px"> 
     <xe:listView id="listView1" storeComponentId="restService1"> 
      <xe:listViewColumn id="listViewColumn1" columnName="field1" 
       columnTitle="Field1"> 
      </xe:listViewColumn> 
      <xe:listViewColumn id="listViewColumn2" columnName="field2" 
       columnTitle="Field2"> 
      <xe:this.rendered><![CDATA[#{javascript:return sessionScope.showCol2; 
}]]></xe:this.rendered></xe:listViewColumn> 
      <xe:listViewColumn id="listViewColumn3" columnName="field3" 
       columnTitle="Field3" rendered="false"> 
      </xe:listViewColumn> 
     </xe:listView></xp:panel> 
    <xp:panel style="margin-top:20.0px;margin-left:20.0px"> 
     <xp:button id="button1" value="Toggle Column 2"> 
      <xp:eventHandler event="onclick" submit="true" 
       refreshMode="partial" refreshId="listView1"> 
       <xp:this.action><![CDATA[#{javascript:if ( sessionScope.showCol2 == false) { 
    sessionScope.showCol2 = true; 
} 
else { 
    sessionScope.showCol2 = false; 
}}]]></xp:this.action> 
      </xp:eventHandler></xp:button> 
    </xp:panel></xp:view> 

답변

2

ExtLib의 버그처럼 보입니다. 하지만 당신은 숨겨진 * 속성을 코드에서 열을 숨길 수 :

<xp:button id="button1" value="Toggle Column 2"> 
    <xp:eventHandler event="onclick" submit="true" 
     refreshMode="partial" refreshId="listView1"> 
     <xp:this.action> 
      <![CDATA[#{javascript: 
       var cmp = getComponent('listViewColumn2'); 
       if(cmp.isHidden()){ 
        cmp.setHidden(false); 
       }else{ 
        cmp.setHidden(true); 
       } 
      }]]> 
     </xp:this.action> 
    </xp:eventHandler> 
</xp:button> 

* : 속성이 너무

+0

감사 숨겨져 있습니다! 그거야. 이것은 지난 며칠 동안 나를 미치게 만들었습니다. :) – Herty

관련 문제