1

rich:panelのヘッダーにテキストとX(閉じる)ラベルを設定しようとしていますが、一度に1つしか設定できません。

例:

http://docs.jboss.org/richfaces/latest_4_0_X/Component_Reference/en-US/html/images/figu-Component_Reference-richpopupPanel-Header_and_controls.png

しかし、この例はrich:popupPanelで実行されており、rich:panelコンポーネントに実装する必要があります。

私は試しました:

<rich:panel>
      <f:facet name="header">
          <h:outputText value="Text Header here" />
      </f:facet>
   <f:facet name="controls">
       <h:outputLink value="#" onclick="#{rich:component('component')}.hide()return false;">
          <h:outputText value="X" />
       </h:outputLink>
   </f:facet> 
</rich:panel>

と:

<rich:panel>
   <f:facet name="header">
           <h:outputText value="Text Header here" />
   </f:facet>
       <f:facet name="controls">
           <h:outputLink value="#" onclick="#{rich:component('component')}.hide(); return false;">
               X
           </h:outputLink>
       </f:facet>
</rich:panel>

その他、すべてが機能しなかった

ありがとう。

4

1 に答える 1

1

次のようなことを行うことで、同じ動作をシミュレートすることができます

<h:form id="frmTest">
    <rich:panel id="panelTest" style="width: 200px">
        <f:facet name="header">
            <h:outputText value="Text Header here" />
            <div style="position: relative; float: right;">
                <a4j:commandLink
                    onclick="document.getElementById('frmTest:panelTest').style.display='none'; return false;">
                    <h:outputText value="X" />
                </a4j:commandLink>
            </div>
        </f:facet> 
        <p>
            Some text here!
        </p>
    </rich:panel>
    <br />
    <a4j:commandLink onclick="document.getElementById('frmTest:panelTest').style.display='block'; return false;">
        <h:outputText value="Show panel" />
    </a4j:commandLink>
</h:form>
于 2012-05-04T20:19:44.310 に答える