【发布时间】:2010-11-19 06:44:15
【问题描述】:
我无法多次显示<rich:modalPanel>。
我有一个包含<a4j:commandlink onclick="#{rich:component('mp')}.show()" 的表单
(也试过rich:componentControl)。
这种方法一次就可以正常工作。在模态面板内,我有一个新表单,提交按钮上附加了一些操作(a4j:commandButton)。当此操作完成时,模态面板将使用与上述相同的方法与 oncomplete="#{rich:component('mp')}.hide()" 隐藏,并重新呈现包含命令链接的表单。
现在,问题是用于显示模式面板的 commandLink 不再起作用。如果我在onclick 事件中放入一个js alert('something'),我可以确定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>
请注意,我已按照建议重新呈现面板而不是表单。
【问题讨论】: