【问题标题】:rich:modalpanel will not show more than when invoked from formrich:modalpanel 不会比从表单调用时显示更多
【发布时间】: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>

请注意,我已按照建议重新呈现面板而不是表单。

【问题讨论】:

    标签: jsf richfaces


    【解决方案1】:

    你能发布 XHTML 代码吗?

    基本上,您的一个问题可能是由于您重新呈现了一个表单。一般来说,这不是一个好主意。一种解决方案是包含&lt;a4j:outputPanel&gt;,然后重新渲染此面板而不是表单本身。

    所以不要有:

    <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>
    

    如果这不起作用,请在您的问题中添加更多代码。

    【讨论】:

      猜你喜欢
      • 2020-07-22
      • 1970-01-01
      • 1970-01-01
      • 2018-01-17
      • 2012-11-28
      • 1970-01-01
      • 2019-07-09
      • 2023-03-09
      • 2021-12-30
      相关资源
      最近更新 更多