2010-11-19 19 views
1

<rich:modalPanel>を複数回表示する際に問題があります。 私は<a4j:commandlink onclick="#{rich:component('mp')}.show()" (​​も試してみました)という書式を持っています。rich:modalpanelはフォームから呼び出されたときよりも多く表示されません

このアプローチは、一度正しく動作します。モーダルパネルの中には、送信ボタン(a4j:commandButton)にいくつかのアクションが追加された新しいフォームがあります。このアクションが完了すると、modalpanelは上記と同じ方法でoncomplete="#{rich:component('mp')}.hide()"で隠され、コマンドリンクを含むフォームはreRenderedになります。

ここで問題は、modalpanelを表示するコマンドリンクが機能しなくなることです。 onclickイベントでalert('something') jsを入れた場合、onclickイベントが発生するが、モダルパネルはレンダリングされないことがあります。

おかげ

を必要に応じて

希望、これは十分な情報がある...私は後でいくつかのソースコードを追加することができます

編集:私はしました

<a4j:form prependId="false" ajaxSubmit="true"> 
    <a4j:outputPanel id="createActivityPanel"> 
     <h:panelGrid columns ="2"> 
      <h:outputLabel value="#{msg.createActivityExpectedParticipantsLabel}" /> 
      <h:panelGrid columns ="2"> 
       <h:outputLabel value="#{msg.createActivityAvailablePointsLabel}: #{sessionBean.loggedInUser.letspoints}" /> 
       <a4j:commandLink value="#{msg.createActivityGetMorePointsLinkLabel}" onclick="#{rich:component('convertPointsPanel')}.show()" /> 
       <rich:inputNumberSlider id="participantsSlider" value="#{activityRequestBean.newActivityExpectedNoParticipants}" maxValue="#{activityRequestBean.maxNoParticipants}" /> 
      </h:panelGrid> 
     </h:panelGrid> 
    </a4j:outputPanel> 
</a4j:form> 
<rich:modalPanel rendered="#{sessionBean.loggedIn}" id="convertPointsPanel" width="700" height="400"> 
    <a4j:support event="onhide" reRender="createActivityPanel"></a4j:support> 
    <f:facet name="header"> 
     <h:outputText value="Velg poeng fra kategorier for å konvertere" /> 
    </f:facet> 
    <f:facet name="controls"> 
     <a4j:form><a4j:commandButton id="closeButton" onclick="#{rich:component('convertPointsPanel')}.hide()" type="image" image="/img/close.gif"/></a4j:form> 
    </f:facet> 
    <a4j:form prependId="false" ajaxSubmit="true" id="convertPointsForm"> 
     <h:panelGrid columns ="2"> 
      <h:panelGroup layout="block" style="width:350px; float:left;"> 
       <rich:dataList var="catscore" value="#{pointsRequestBean.scores}" id="activityPointSliderList"> 
        <h:graphicImage height="30" width="30" value="#{catscore.usercategoryscore.category.imagepath}" /> 
        <h:outputText value="#{catscore.usercategoryscore.category.name}" /> 
        <rich:inputNumberSlider maxValue="#{catscore.usercategoryscore.score}" value="#{catscore.transferredScore}" step="2" /> 
       </rich:dataList> 
       <a4j:commandButton value="Konverter" id="convertButton" action="#{pointsRequestBean.convertPoints}" oncomplete="#{rich:component('convertPointsPanel')}.hide()" reRender="createActivityPanel"/> 
      </h:panelGroup> 
      <h:panelGroup layout="block" style="width:350px; float:right; border-left: 1px solid #ACBECE; padding: 10px;"> 
       <h:outputText value="kjøp poeng fra paypal?" /> 
      </h:panelGroup> 
     </h:panelGrid> 
    </a4j:form> 
</rich:modalPanel> 

お知らせ: は、ここでいくつかのより多くのコードですフォームの代わりにパネルを再レンダリングする際の助言に従った。

答えて

2

XHTMLコードを投稿できますか?

基本的に、問題の1つは、フォームを再レンダリングすることが原因である可能性があります。一般的に、それは良い考えではありません。 1つの解決策は、<a4j:outputPanel>を含めて、フォーム自体の代わりにこのパネルを再描画することです。

あなたが行うことができます
<a4j:commandButton ... reRender="myForm"/> 
<h:form id="myForm"> 
    ... 
</h:form> 

を:だからではなく、持っていることの

これが機能しない場合

<a4j:commandButton ... reRender="myFormContent"/> 
<h:form id="myForm"> 
    <a4j:outputPanel id="myFormContent"> 
     ... 
    </a4j:outputPanel> 
</h:form> 

、あなたの質問に多くのコードを追加してください。

+0

あなたも私の問題を解決しました! Tkz !! – velteyn

関連する問題