how to 'stay in conversation' with rich suggestionbox?
bsmithjj Nov 12, 2007 3:09 PMI am having trouble 'staying in conversation' using a SFSB that backs a parent form and a child form.
From the parent form, I have the following navigation rule:
<page view-id="/MMktIssuer.xhtml" login-required="true"> ... <navigation from-action="#{moneyMarketIssuerEditor.insertGuarantor}"> <begin-conversation join="true"/> <render view-id="/EditGuarantorObligor.xhtml"/> </navigation> ... </page>
In the child form, I have a (rich) suggestion box. When I select a value from the suggestions, I have a4j:support tag call a method on my SFSB to update state. I also have a navigation rule:
<page view-id="/EditGuarantorObligor.xhtml" login-required="true" conversation-required="true"> <navigation from-action="#{moneyMarketIssuerEditor.selectThirdPartyByCode}"> <begin-conversation join="true"/> <render view-id="/EditGuarantorObligor.xhtml"/> </navigation> .... </page>
Here is the suggestion box JSF markup that triggers the 'selection'
<a4j:form id="editGuarantorForm"> <input type="hidden" name="cid" value="#{conversation.id}"/> <h:inputHidden id="code" value="#{editGuarantor.thirdParty.code}"/> <h:panelGrid columns="2"> <h:outputText value="3rd Party Code"/> <h:panelGroup> <h:inputText id="thirdPartyCode" value="#{editGuarantor.thirdParty.thirdPartySelectionDisplay}" size="60" style="height:20px;background:url('img/magnifying-glass.png') no-repeat center right;vertical-align:middle;" maxlength="255"/> <h:graphicImage value="img/check2-16x16.png" alt="Ultimate Parent" rendered="#{thirdParty.udThirdParty.ultimateParent == 1}"/> <h:graphicImage value="img/spacer.png" alt="" width="16" height="16" rendered="#{thirdParty.udThirdParty.ultimateParent != 1}"/> <rich:suggestionbox for="thirdPartyCode" minChars="1" requestDelay="750" suggestionAction="#{thirdPartyHelper.getThirdPartiesByName}" var="thirdParty" fetchValue="#{thirdParty.code}" height="270" width="285"> <a4j:support event="onselect" action="#{moneyMarketIssuerEditor.selectThirdPartyByCode}" onsubmit="$('editGuarantorForm:code').value=$('editGuarantorForm:thirdPartyCode').value;" reRender="editGuarantorForm"/> <facet name="nothingLabel"> (case sensitive) <h:outputText value="No matches found..."/> </facet> <h:column> #{thirdParty.code} #{thirdParty.name} <h:graphicImage value="img/check2-16x16.png" rendered="#{thirdParty.udThirdParty.ultimateParent == 1}"/> </h:column> </rich:suggestionbox> </h:panelGroup> ... </a4j:form>
When the a4j:support fires (due to event 'onselect'), the selection should be added to an object that is part of the conversation (parent-child type of relationship). What's happening is that the parent object is now 'reset' as if I started a new conversation.... help?
Thanks,
Brad Smith