我有这个模特
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
。我怎样才能做到这一点?
编辑:使用真实场景
<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
字段,我该怎么做呢?
答案 0 :(得分:0)
您使用的是RF 3.3.3?
进程 - 属性应该可以解决问题:http://livedemo.exadel.com/richfaces-demo/richfaces/commandButton.jsf?tab=info&cid=321214