0

このような条件に基づいてパネルを非表示/表示しようとしています

<xp:panel id="panelUsersInput">
 <!--<xp:this.rendered><![CDATA[#{javascript:return ((getComponent("optAttendees").getAttributes().get("value")=="defined"));}]]></xp:this.rendered>-->
 <xp:inputText id="namUsersInput">
  <xp:typeAhead mode="partial" minChars="3" ignoreCase="true" var="lupUsersInput">
   <xp:this.valueList><![CDATA[#{javascript:@DbLookup( [ database.getServer(), 'names.nsf' ], '($VIMPeople)', lupUsersInput, 1, '[PARTIALMATCH]' );}]]></xp:this.valueList>
  </xp:typeAhead>
 </xp:inputText>
 <xp:button value="" id="btnAddUser" styleClass="button add clear" title="add attendant">
  <xp:span/>
  <xp:eventHandler event="onclick" submit="true" refreshMode="partial" refreshId="panelUsersList" execMode="partial" execId="panelSelectionAttendees">
   <xp:this.onStart><![CDATA[(dojo.byId("#{id:namUsersInput}").value!="");]]></xp:this.onStart>
   <xp:this.action>
    <![CDATA[#{javascript:
     var lstUsers = getComponent("namUsers").getAttributes().get("value");
     if(typeof(lstUsers)==typeof(java.util.Vector)) {
      lstUsers.push(getComponent("namUsersInput").getAttributes().get("value"));
      lstUsers.sort();
     } else {
      lstUsers = @Trim(@List(lstUsers, getComponent("namUsersInput").getAttributes().get("value")));
     }

     getComponent("namUsersInput").getAttributes().put("value", "");
     getComponent("namUsers").getAttributes().put("value", lstUsers);
    }]]>
   </xp:this.action>
   <xp:this.onComplete><![CDATA[if(dojo.byId("#{id:rpUsersSelection}")) { highlightSection("#{id:rpUsersSelection}"); }]]></xp:this.onComplete>
  </xp:eventHandler>
 </xp:button>
 <div class="clearAll"/>
</xp:panel>

ご覧のとおり、パネルのレンダリング オプションを無効にしました。この設定により、このパネル内のボタンは指示どおりに機能します。

パネルのレンダリング オプションを有効にすると、このパネル内のボタンは何かを実行しますが、部分的な更新によって返される結果は、指定されたセクションを (部分的な ID で) リロードするようなものです。

さらに興味深いのは、パネルのレンダリング条件が false の場合でも、ボタンによってトリガーされたイベントは引き続きレンダリングされるという事実です。しかし、イベントハンドラはバインド先の親要素を見つけることができません。結果は、このイベントのページ全体 (body-element) へのグローバルバインディングです。

XSP.addOnLoad(function() {
...
XSP.attachPartial("view:_id1:_id11:_id47", "view:_id1:_id11:btnAddUser", "view:_id1:_id11:panelSelectionAttendees", "onclick", view__id1__id11__id47_clientSide_onclick, 2, "view:_id1:_id11:panelUsersList", null, "if(dojo.byId(\"view:_id1:_id11:namUsers\").value!=\"\") { dojo.byId(\"view:_id1:_id11:namUsersInput\").value=\"\"; highlightSection(\"view:_id1:_id11:panelUsersList\"); }", null);
...
});

他の誰かがそのような行動に気づいたことがありますか? パネルを非表示にすると、このパネル内のすべての基本要素も非表示になると思いました。

4

1 に答える 1

0

既知のバグのようです

LO73179: XPAGES イベント ハンドラのレンダリングが親コンポーネントのレンダリングと一致しない

http://www-01.ibm.com/support/docview.wss?uid=swg1LO73179 .

于 2013-02-19T10:42:22.917 に答える