【问题标题】:Partial ajax submit with jsf 1.2 with richfaces使用带有richfaces的jsf 1.2提交部分ajax
【发布时间】:2016-05-08 02:34:03
【问题描述】:

我有这个型号

guy
    name
    age
    city
    country
    list<girlfriends>

我有这个 jsf 1.2 + richfaces 3.3.3 形式

form
    panelgroup#first-part
        input#name
        input#age
        input#city
        input#country
    a4j:region
        input#girlfriends
        submit#addgirlfriends
    panelgroup
        datatable#girlfriends
    a4j:commandButton#save

所以,我有这个a4j:commandButton#save 以保存所有内容。 但是当我单击按钮保存时,所有表单都已提交,但我只想提交panelgroup#first-part。我怎样才能做到这一点?

编辑:使用真实场景

Cadastro de Contato

    <rich:messages id="messages" />

    <a4j:region>
        <h:panelGrid columns="2" id="form-contato">
            <label>Nome</label>
            <h:inputText value="#{cadastrocontato.contato.nome}" id="nome" />

            <label>Email</label>
            <h:inputText value="#{cadastrocontato.contato.email}" id="email"
                required="true" requiredMessage="O email deve ser digitado" />

            <label>Número</label>
            <h:inputText value="#{cadastrocontato.contato.numero}" />
        </h:panelGrid>

        <a4j:commandButton value="Cadastrar"
            actionListener="#{cadastrocontato.add}" process="nome"
            reRender="form-contato, datatable-contatos, messages">
        </a4j:commandButton>
    </a4j:region>

当我设置nome 字段时.. 必填字段email 会引发必填消息。但是我只处理了nome 字段,我该怎么做呢?

【问题讨论】:

    标签: jsf richfaces jsf-1.2


    【解决方案1】:

    您使用的是 RF 3.3.3?

    process-属性应该可以解决问题:http://livedemo.exadel.com/richfaces-demo/richfaces/commandButton.jsf?tab=info&cid=321214

    【讨论】:

    • 流程属性不起作用,我将用真实场景更新主要问题
    猜你喜欢
    • 2011-03-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-07
    • 2017-08-01
    相关资源
    最近更新 更多