【问题标题】:jsf richfaces a4j:region call renderjsf Richfaces a4j:区域调用渲染
【发布时间】:2012-05-01 09:48:00
【问题描述】:

使用 JSF2 和 Richfaces 4。

我的表单中有两个区域,其中包含多个区域。我想为另一个区域调用渲染。我该怎么做?

<h:form>
    <a4j:region id="rg_1">
        <h:inputText id="field1" value="#{bean.field1}"/>   
    </a4j:region>
    <a4j:region id="rg_2">
        <a4j:commandLink action="#{mybean.resetBean} render="region1" />
    </a4j:region>
</h:form>

【问题讨论】:

    标签: jsf richfaces


    【解决方案1】:

    h:commandLink 没有render 属性,f:ajax 有...

    如果您想从 rg_2 中重新渲染 rg_1 而无需刷新页面 (ajax)

    执行以下操作

    <a4j:region id="rg_2">
        <a4j:commandLink action="#{mybean.resetBean}" render="rg_1"/>
    </a4j:region>
    

    还要确保mybean.resetBean 方法是void 方法或返回null

    【讨论】:

    • 我试过了,但 commandlink 绕过了所有验证并开始行动。
    • render 已经被提及,但我遇到的问题是提交 commandLink action="#{myBean.doSomething()}" 绕过所有 jsf 验证并开始执行。
    • 您的原始问题使用了带有渲染属性的 h:comandLink...这与验证问题无关...
    猜你喜欢
    • 1970-01-01
    • 2011-07-12
    • 2023-04-09
    • 1970-01-01
    • 2012-01-03
    • 2011-12-12
    • 1970-01-01
    • 2011-02-11
    • 2016-10-08
    相关资源
    最近更新 更多