未调用操作方法

发布于 2025-01-04 21:05:47 字数 1958 浏览 3 评论 0原文

我在使用 的表单中遇到 问题> 如果我删除 ,该操作会正常触发,但 pickList 需要在那里。

这是一个已知问题吗?如果是,是否有解决方法?

这就是代码的样子

    <rich:modalPanel id="editAlbumPanel" width="580" height="255">
    <f:facet name="header">
        <h:panelGroup>
            <h:outputText value="Edit Album #{mainBean.album.title}" styleClass="modal_header_txt" />
        </h:panelGroup>
    </f:facet>
    <f:facet name="controls">
        <h:panelGroup>
            <a4j:commandButton id="closeEditAlbum" image="images/close.png"
                onclick="Richfaces.hideModalPanel('editAlbumPanel');" />
        </h:panelGroup>
    </f:facet>
    <h:form id="editAlbumForm">
        <h:panelGrid columns="2">
            <h:outputText value="Genres" styleClass="descript"/>
            <rich:pickList value="#{mainBean.selectedGenres}" copyControlLabel="Add"
                fastMoveControlsVisible="false">
                <f:selectItems value="#{mainBean.genreSelect}"/>
            </rich:pickList>
            <h:outputText value="Explicit Lyrics: " styleClass="descript"/>
            <h:selectBooleanCheckbox styleClass="spacer" value="#{mainBean.album.explicitLyrics}"/>
        </h:panelGrid>
        <div align="right">
            <a4j:commandButton value="Apply Changes" action="#{mainBean.editAlbumA}"
                oncomplete="Richfaces.hideModalPanel('editAlbumPanel');"/>
            <h:commandButton value="Cancel" styleClass="spacer" onclick="Richfaces.hideModalPanel('editAlbumPanel');"/>
        </div>
    </h:form>
</rich:modalPanel>

编辑额外信息

当且仅当选择列表的右侧为空(即用户不选择任何选项)时,才会调用操作方法

I am having an issue with <h:commandButton> and <a4j:commandButton> in a form with a <rich:pickList> the action fires fine if I remove the <rich:pickList> but the pickList needs to be there.

Is this a known issue and if so is there a work around for it?

This is what the code looks like

    <rich:modalPanel id="editAlbumPanel" width="580" height="255">
    <f:facet name="header">
        <h:panelGroup>
            <h:outputText value="Edit Album #{mainBean.album.title}" styleClass="modal_header_txt" />
        </h:panelGroup>
    </f:facet>
    <f:facet name="controls">
        <h:panelGroup>
            <a4j:commandButton id="closeEditAlbum" image="images/close.png"
                onclick="Richfaces.hideModalPanel('editAlbumPanel');" />
        </h:panelGroup>
    </f:facet>
    <h:form id="editAlbumForm">
        <h:panelGrid columns="2">
            <h:outputText value="Genres" styleClass="descript"/>
            <rich:pickList value="#{mainBean.selectedGenres}" copyControlLabel="Add"
                fastMoveControlsVisible="false">
                <f:selectItems value="#{mainBean.genreSelect}"/>
            </rich:pickList>
            <h:outputText value="Explicit Lyrics: " styleClass="descript"/>
            <h:selectBooleanCheckbox styleClass="spacer" value="#{mainBean.album.explicitLyrics}"/>
        </h:panelGrid>
        <div align="right">
            <a4j:commandButton value="Apply Changes" action="#{mainBean.editAlbumA}"
                oncomplete="Richfaces.hideModalPanel('editAlbumPanel');"/>
            <h:commandButton value="Cancel" styleClass="spacer" onclick="Richfaces.hideModalPanel('editAlbumPanel');"/>
        </div>
    </h:form>
</rich:modalPanel>

EDIT Extra Information

The action method is called if and only if the right hand side of the pick list is empty, aka the user selects no options

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

灵芸 2025-01-11 21:05:48

我找到了解决方案,结果发现我在选择项中传递了一个 int 而不是 String

I have found the solution, turns out I was passing in an int instead of a String in the select item

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文