有时,使用时<h:commandLink>,<h:commandButton>或者<f:ajax>,在action,actionListener或listener与标签相关的方法根本不被调用.或者,bean属性不会使用提交的UIInput值进行更新.
有什么可能的原因和解决方案?
我们有一个更新动态包含的ajax导航菜单.包含文件各有各自的表单.
<h:form>
<h:commandButton value="Add" action="#{navigator.setUrl('AddUser')}">
<f:ajax render=":propertiesArea" />
</h:commandButton>
</h:form>
<h:panelGroup id="propertiesArea" layout="block">
<ui:include src="#{navigator.selectedLevel.url}" />
</h:panelGroup>
Run Code Online (Sandbox Code Playgroud)
它工作正常,但包含文件中的任何命令按钮在第一次单击时都不起作用.它仅适用于第二次点击.
我发现这个问题commandButton/commandLink/ajax动作/监听器方法没有被调用或输入值没有更新,我的问题在第9点描述.我明白我需要明确地包含在解决它的包<h:form>中的ID <f:ajax render>.
<f:ajax render=":propertiesArea :propertiesArea:someFormId" />
Run Code Online (Sandbox Code Playgroud)
但是,在我的情况下,表单ID事先是未知的.此表格最初也不会在上下文中提供.
上述方案有什么解决方案吗?
嗨我是jsf环境中的新手,我试图更新一个primefaces咆哮,然后从commandButton动作重定向到一个页面.
<p:commandButton value="Guardar" action="#{AgendamientoMBean.procesaAgendamientoJ()}"
update="growlDetalle" />
Run Code Online (Sandbox Code Playgroud)
托管bean代码
FacesContext context = FacesContext.getCurrentInstance();
context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, descripcion, detalle));
....
....
return "agp_bandeja_citas_llamadas?faces-redirect=true";
Run Code Online (Sandbox Code Playgroud)
这只是重定向到页面,但没有显示我的咆哮消息,我测试了如果更改我的方法不返回页面消息确实显示..
我试图更新我重定向的页面的咆哮,但我猜这是不可能的.
我认为当重定向时我失去了更新功能,因为我现在正在新页面中.
有没有办法告诉jsf先做更新,然后重定向?
希望你能提前帮助我