timing problem
enesterov Mar 14, 2008 5:10 PMHi everyone,
I need your help with solving of the following problem.
I have page where I search for users and display results in dataTable. Each user record has commandLink associated with it. This commandLink populates DataModelSelection in subscriberSearch component, starts conversation in reply component and opens modalPanel. modalPanel's subname and phone get their data from Subscriber object, outjected in subscriberSearch component.
Everything works fine except that modalPanel opens before Subscriber is outjected. How do you normally solve this problem?
Thanks, Ed
<rich:modalPanel id="messagesendpanel" width="400" height="280" moveable="false" resizeable="false" left="auto" top="auto"> <f:facet name="header"> <h:outputText value="Initiate Conversation"/> </f:facet> <a:form id="messagesendform"> <h:panelGrid id="sendmessagegrid" columns="2" columnClasses="name1,value1" style="width:100%"> <h:outputLabel for="subname">Name:</h:outputLabel> <h:outputText id="subname" value="#{subscriber.name}"/> <h:outputLabel for="phone">Phone:</h:outputLabel> <h:outputText id="phone" value="#{subscriber.mobile[0].phone}"/> ... <h:outputLabel value="" for="btncell" style="padding-top:5px;padding-bottom:5px;"></h:outputLabel> <h:panelGroup id="btncell" style="padding-top:5px;padding-bottom:5px;"> <a:commandLink oncomplete="Richfaces.hideModalPanel('messagesendpanel')" value="Cancel" styleClass="btn"></a:commandLink> <a:commandLink id="sendmessagelink" actionListener="#{reply.sendMessage}" oncomplete="Richfaces.hideModalPanel('messagesendpanel')" value="Send" styleClass="btn"></a:commandLink> </h:panelGroup> </h:panelGrid> </a:form> </rich:modalPanel> ... <a:form id="subsform"> <h:outputText value="No Subscribers Found" rendered="#{subscribers != null and subscribers.rowCount==0}"/> <h:dataTable class="zebra" value="#{subscribers}" var="s" rendered="#{subscribers.rowCount>0}" rowClasses="odd,even"> <h:column> <f:facet name="header">First Name</f:facet> <a:region id="cmdlink1"> <a:commandLink ajaxSingle="true" actionListener="reply.init" reRender="phone, carrier" value="#{s.firstName}"> </a:commandLink> <a:status for="cmdlink1" id="status123" onstop="Richfaces.showModalPanel('messagesendpanel');"></a:status> </a:region> </h:column> ... </h:dataTable> </a:form> @Stateful @Name("subscriberSearch") @Scope(ScopeType.SESSION) public class SubscriberSearchingAction implements SubscriberSearching { @PersistenceContext private EntityManager em; ... @Out(required=false) @DataModelSelection private Subscriber subscriber; @DataModel private List<Subscriber> subscribers; ... } @Stateful @Name("reply") @Scope(ScopeType.CONVERSATION) public class ReplyBean implements Reply { @In(scope=ScopeType.SESSION, required=false) private Subscriber subscriber; @Begin public void init() { } ... }