Tag: commandbutton

试图了解immediate =“true”时跳过的input

就在我以为我已经理解了立即… *叹* 考虑下面的JSF页面: <h:inputText value="#{testBean.text}" required="true" /> <h:commandButton actionListener="#{testBean.doFoo}" value="Do Foo" /> <h:commandButton immediate="true" actionListener="#{testBean.doBar}" value="Do Bar" /><br /> <h:outputText value="#{testBean.didSomething}" /> 而这个支持豆: public class TestBean { private String didSomething = "Nothing done yet"; // + getter public void doFoo() { didSomething = "Did foo!"; } public void doBar() { didSomething = "Did bar!"; } […]

h:commandButton / h:commandLink不能在第一次点击时使用,只能在第二次点击时使用

我们有一个ajax导航菜单,更新一个dynamic的包括。 包含文件有各自的forms。 <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> 它工作正常,但包含文件中的任何命令button不起作用的第一次点击。 它只能第二次来回运行。 我发现这个问题commandButton / commandLink / ajax动作/侦听器方法没有被调用或input值没有更新 ,我的问题是在第9点描述。我明白,我需要明确包括<h:form>的ID在include <f:ajax render>来解决它。 <f:ajax render=":propertiesArea :propertiesArea:someFormId" /> 然而在我的情况下,表单ID是事先不知道的。 此外,这种forms将不会在最初的情况下可用。 有没有解决上述情况?

未调用commandButton / commandLink / ajax动作/侦听器方法或未设置/更新input值

有时,在使用<h:commandLink> , <h:commandButton>或<f:ajax> ,与标签关联的action , actionListener或listener方法不会被调用。 或者,bean属性不会使用提交的UIInput值进行更新。 这有什么可能的原因和解决办法?