This content has been marked as final.
Show 2 replies
-
1. Re: Problem in AJAX
sean.tozer Jun 30, 2010 10:28 AM (in response to harsh4u89)The RichFaces library, included in Seam, handles a lot of AJAX-y functionality for you.
To make a form like what you're talking about, it's really very simple. Make a checkbox that's bound to a backing beam value, and have that box update the relevant output section.
<h:selectBooleanCheckbox value="#{backingBean.checked}" > <a4j:support event="onchange" reRender="otherPanel" /> </h:selectBooleanCheckbox>
And then have some other panel that contains the corresponding section:
<a4j:outputPanel id="otherPanel" rendered="#{backingBean.checked}"> ... </a4j:outputPanel>
Now the other panel will be built only when the checkbox is checked. No problem.
-
2. Re: Problem in AJAX
harsh4u89 Jul 1, 2010 11:12 PM (in response to harsh4u89)Here is my code snippet.. But its not working properly.
I have used two drop down menus
<h:outputLabel for="branch">Branch </h:outputLabel> <h:selectOneMenu id="branch" value="#{stud.masterBranch}" > <s:selectItems var="branches" value="#{branchList}" noSelectionLabel="[Please Select]" label="#{branches.name}"/> <s:convertEntity /> <a4j:support event="onchange" reRender="section" /> </h:selectOneMenu> <a4j:outputPanel id="section" rendered="#{stud.masterBranch}" > <h:outputLabel for="section">Section</h:outputLabel> <h:selectOneMenu value="#{stud.masterSection}" > <s:selectItems var="sections" value="#{sectionList}" noSelectionLabel="[Please Select]" label="#{sections.section}"/> <s:convertEntity /> </h:selectOneMenu> </a4j:outputPanel>
Is there any problem tn this code?
I know there must be mistakes in it Please suggest the correct codeThanks .
From where should I start reading ajax?