ajax-update

Referring composite component ID in f:ajax render

自闭症网瘾萝莉.ら 提交于 2019-11-26 22:25:50
问题 I am writing a composite component that is intended to wrap an input element, and augment it with an 'optional field' designation and h:message element below it. Here is the component (in input.xhtml file): <composite:interface/> <composite:implementation> <div> #{component.children[1].setStyleClass(component.children[1].valid ? '' : 'inputError')} <composite:insertChildren/> </div> <h:panelGroup styleClass="optional" rendered="#{!component.parent.children[1].required}" layout="block" > #

Make multiple dependent / cascading selectOneMenu dropdown lists in JSF

你说的曾经没有我的故事 提交于 2019-11-26 15:27:22
I am trying to make 4 dependent menus. When the user chooses an item from the first menu, the second menu will show dependent data and when the user chooses item from the second one , the third one will show dependent data and so on. The user will see items on the first menu only and the other ones will be blank. If he chooses an item on the first menu the second one will show data but the third and the fourth will remain blank, and so on. The user must eventually choose entries from all the 4 menus. <h:selectOneMenu id="first" value="#{nodes.selectState"}> <f:selectItems value="#{nodes

Make multiple dependent / cascading selectOneMenu dropdown lists in JSF

一世执手 提交于 2019-11-26 04:27:07
问题 I am trying to make 4 dependent menus. When the user chooses an item from the first menu, the second menu will show dependent data and when the user chooses item from the second one , the third one will show dependent data and so on. The user will see items on the first menu only and the other ones will be blank. If he chooses an item on the first menu the second one will show data but the third and the fourth will remain blank, and so on. The user must eventually choose entries from all the

Ajax update/render does not work on a component which has rendered attribute

荒凉一梦 提交于 2019-11-25 21:59:14
问题 I\'m trying to ajax-update a conditionally rendered component. <h:form> ... <h:commandButton value=\"Login\" action=\"#{login.submit}\"> <f:ajax execute=\"@form\" render=\":text\" /> </h:commandButton> </h:form> <h:outputText id=\"text\" value=\"You\'re logged in!\" rendered=\"#{not empty user}\" /> However, that does not work. I can assure that #{user} is actually available. How is this caused and how can I solve it? 回答1: It's not possible to re-render (update) a component by ajax if the

Why do I need to nest a component with rendered=“#{some}” in another component when I want to ajax-update it?

大憨熊 提交于 2019-11-25 21:57:52
问题 So I\'ve found a few answers close to this, and I\'ve found enough to fix the problem I had. But even so, I\'m curious as to understand the workings around this. Let me illustrate with an example : I have a facelet .xhtml page that looks like this (shortned). <h:form id=\"resultForm\"> <h:panelGroup class=\"search_form\" layout=\"block\"> <h:inputText id=\"lastname\" value=\"#{search.lastname}\"/> <h:commandButton action=\"#{search.find}\" value=\"Find\"> <f:ajax execute=\"lastname\" render=\

How to ajax-refresh dynamic include content by navigation menu? (JSF SPA)

≯℡__Kan透↙ 提交于 2019-11-25 21:47:09
问题 I\'m just learning JSF 2 thanks to this site I had learned a lot in such a short time. My question is regarding how to implement a common layout to all my JSF 2 pages and have only the content part of the page refresh not the whole page whenever I click a link/menu from a different panel. I am using the Facelets approach it does what I want except that each time I click a link from a panel (e.g. menu items from left panel) the whole page is refreshed. What I am looking for is a way to refresh