rich:suggestionbox being destroyed after a4j:support action
james_hays Mar 7, 2007 7:05 PMIn the following code, I have three input fields of interest. The first dropdown implements a4j:support and rerenders a second dropdrown in order to populate it with current values.
<label>SBU: <h:selectOneMenu value="#{strategicUnit}"> <s:selectItems value="#{strategicUnits}" var="strategicUnit" label="#{strategicUnit.title}" noSelectionLabel="-- None --"/> <ec:convertEntity /> <a4j:support onsubmit="toggleStatusBar('Processing Strategic Unit Number')" oncomplete="toggleStatusBar('Task Complete', 2000)" event="onchange" ajaxSingle="true" reRender="idNumber"/> </h:selectOneMenu> </label>
<label>Identification No.: <h:selectOneMenu id="idNumber" value="#{profileRecord.workAuthorization}" style="width:200px;"> <s:selectItems value="#{newProfileRecord.workAuthorizations}" disabled="#{workAuthorization.activeFlag eq 'F'}" var="workAuthorization" label="#{workAuthorization.projId} - #{workAuthorization.projectName}" noSelectionLabel="-- None --"/> <ec:convertEntity/> <a4j:support onsubmit="toggleStatusBar('Processing WA Number')" oncomplete="toggleStatusBar('Task Complete', 2000)" event="onchange" ajaxSingle="true" limitToList="true" reRender="programName,projectManager,programManager" action="#{newProfileRecord.setProfileRecordManagers}"/> </h:selectOneMenu> </label>
This second dropdown will then call an action on my listener and update a few fields. It then rerenders three items on my web form, an output text and two textInputs, which also utilize the rich:suggestionbox
<label>Program Manager: </label> <h:inputText id="programManager" value="#{profileRecord.programManager.fullName}"/> <rich:suggestionbox for="programManager" suggestionAction="#{newProfileRecord.autoCompleteUsers}" var="user" width="200" height="200"> <h:column> <h:outputText value="#{user.fullName}"/> </h:column> </rich:suggestionbox>
What I'm running into is that the suggestBox no longer works after the input has been updated by the second dropdown box. If I use the suggestbox before I make any value changes to the dropdown, it works fine. It only stops working after I first use the dropdowns and the input value has been recreated.
Am I missing something in terms of using a4j or richfaces?
Any help would be appreciated.
Thanks,
James