Jsf 命令按钮问题

Jsf 命令按钮问题,jsf,icefaces,Jsf,Icefaces,我有一个很奇怪的问题。我无法使用第二个按钮中的功能。 步骤: 1.写上名字和名字。 2.单击查找按钮。结果:数据表中的项。 3.单击TEMPPP only刷新页面。 我必须使用sendUserInformation函数 Administrator.xhtml 管理控制员 解决了! f:需要ajax,可能还需要viewscope <h:commandButton action="#{administrationController.sendUserInformation(o.id)}" s

我有一个很奇怪的问题。我无法使用第二个按钮中的功能。 步骤: 1.写上名字和名字。 2.单击查找按钮。结果:数据表中的项。 3.单击TEMPPP only刷新页面。 我必须使用sendUserInformation函数 Administrator.xhtml

管理控制员

解决了! f:需要ajax,可能还需要viewscope

<h:commandButton action="#{administrationController.sendUserInformation(o.id)}" styleClass="buttonGeneral" value="TEMP #{o.id}">
                <f:ajax/>
            </h:commandButton>
假设您的AdministrationController bean是@RequestScope的,因为您没有指定它的作用域,那么在同一视图中,每个请求都会重新加载您的中的数据。这意味着,当您选择

<h:commandButton value="TEMPPP #{o.id}" action="#{administrationController.sendUserInformation(o.id)}"/>

谢谢你的回答!我已经将作用域从请求更改为视图,现在我遇到了问题:我可以单击按钮,但它并没有执行实际的方法。没有错误和其他消息。我能做什么?
<h:commandButton action="#{administrationController.sendUserInformation(o.id)}" styleClass="buttonGeneral" value="TEMP #{o.id}">
                <f:ajax/>
            </h:commandButton>
<h:commandButton value="TEMPPP #{o.id}" action="#{administrationController.sendUserInformation(o.id)}"/>
@ManagedBean
@ViewScoped
public class AdministrationController implements Serializable {
    //rest of your code
}