6 Replies Latest reply on Dec 18, 2006 11:09 PM by gavin.king

    s:link missing conversationId, sometimes

    pdpantages

      Fyi, Using Seam 1.0.1GA, ajax4jsf 1.0.2, Jboss 4.0.4.GA

      Hello Seamers, I have a question about rendering of s:link. I have a simple icon that I use an s:link with;

       <t:div styleClass="icontool">
       <s:link
       title="Create a new scheduled trigger"
       action="#{workFlowAction.newTrigger}" >
       <img src="/client/img/newtrigger32x32.png"
       class="iconButtonOut"
       onMouseOver="this.className='iconButtonUp'"
       onMouseOut="this.className='iconButtonOut'"
       onMouseDown="this.className='iconButtonDown'"
       onMouseUp="this.className='iconButtonUp'" />
       <f:param name="ctx" value="triggertable"/>
       </s:link>
       </t:div>
      


      My problem is, thatt when the page containing the button is first displayed, the link does not include the conversationId. It looks like so:

      http://nebula:8080/client/view/workflow/triggertable.seam?ctx=triggertable&actionMethod=workFlowAction.newTrigger
      


      If I refresh the page with the browser refresh button, it then fixes itself up:

      http://nebula:8080/client/view/workflow/triggertable.seam?ctx=triggertable&actionMethod=workFlowAction.newTrigger&conversationId=16
      


      I have other links on this page do not have this problem:
      I have a t:datatable on this page containng s:links, and a4j:commandLinks. Also some other icons with a4j:CommandLinks . Only the above is missing the conversationId. I tried removing the icon and subsituting a value="string" for the link but the behaviour did not change.

      The a4j:commandLinks precede this one on the page. The dataTable comes after.

      Any clues? I am a bit puzzled by it. I can get my code to work by adding an f:param with the conversationId in it, but I will get duplicate paramters in most cases.

        • 1. Re: s:link missing conversationId, sometimes
          gavin.king

          What starts the conversation? When does that happen?

          • 2. Re: s:link missing conversationId, sometimes
            gavin.king

            And what is the conversation model? Any nested conversations?

            • 3. Re: s:link missing conversationId, sometimes
              pdpantages

              Hello Gavin, thank you for the response.

              When the page is loaded, I am in a LR conversation, created with @Begin(join=true) on the create method of the object that contains the datatable I mentioned. This create method is also annotated with @Create

              The object itself is a SFSB , scope SESSION.

              I can see the conversation on my "workspaces" page.

              I found that if I switch the s:link to a4j:commandLink, my conversationId is rendered properly

              • 4. Re: s:link missing conversationId, sometimes
                gavin.king

                OK, and what exactly causes the instantiation of the object that begins the conversation? Something further down the page from the s:link?

                I don't understand your comment about a4j:commandLink *at all*, aj4:commandLink has no special support for conversation ids.

                Time you posted your JSF code.

                • 5. Re: s:link missing conversationId, sometimes
                  pdpantages

                  Hi Gavin, OK, following is my xhtml. The first reference to the object, "triggertable" is before the s:ilnk, but the reference is on some buttons, so the object may not instantiated until the corresponding action is invoked.?

                  Your comment has got me thinking, though. I didn't think that the order on the page would matter. The dataTable is constructed from an outjected DataModel (from the SFSB) so the component would have been created before the datatable was created; thus the s:links inside the table are OK. I will try to reference some part of the object ahead of the s:link and see if that fixes me up.

                  My firefox location/URL shows the correct conversationId when I load the page

                  Wrt. a4j:commanLink, if I "copy link location" from the link in question I see something like:

                  http://nebula:8080/client/view/workflow/triggertable.seam?conversationId=147#
                  


                  I thought the seam redirect filter was adding it for me? Anway, I did not use f:param or other mechanism to set the conversationId here... I did not add the # character either.

                  Here is my page. The s:link that gives me trouble is in the div_control_buttons, right after the ui:include. If I change this to a4j:commanLink, I get the url as above.

                  <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                  
                   <ui:composition xmlns="http://www.w3.org/1999/xhtml"
                   xmlns:ui="http://java.sun.com/jsf/facelets"
                   xmlns:h="http://java.sun.com/jsf/html"
                   xmlns:f="http://java.sun.com/jsf/core"
                   xmlns:s="http://jboss.com/products/seam/taglib"
                   xmlns:t="http://myfaces.apache.org/tomahawk"
                   xmlns:c="http://java.sun.com/jstl/core"
                   xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
                   xmlns:centina="http://www.centinasystems.com/jsf"
                   template="/view/main.xhtml">
                  
                   <ui:define name="page_title">
                   <h:outputText value="Workflow > Trigger Table"/>
                   </ui:define>
                  
                   <ui:define name="ui_pagelayout">
                   <ui:include src="/view/layout1.xhtml" />
                   </ui:define>
                  
                   <ui:define name="ui_a4j_poll">
                   <a4j:poll
                   id="triggerTablePoller"
                   interval="4000"
                   enabled="true"
                   eventsQueue="triggerTablePollerQueue"
                   reRender="#{mainPanel}">
                   </a4j:poll>
                   </ui:define>
                  
                   <ui:define name="ui_control_panel">
                  
                   <div class="div_control_buttons">
                  
                   <ui:include src="/view/ajaxtablebuttons.xhtml">
                   <ui:param name="object" value="trigger"/>
                   <ui:param name="reRender" value="mainPanel"/>
                   <ui:param name="entity" value="#{triggerTable}"/>
                   </ui:include>
                  
                   <t:div styleClass="icontool">
                   <s:link
                   title="Create a new scheduled trigger"
                   action="#{workFlowAction.newTrigger}" >
                   <img src="/client/img/newtrigger32x32.png"
                   class="iconButtonOut"
                   onMouseOver="this.className='iconButtonUp'"
                   onMouseOut="this.className='iconButtonOut'"
                   onMouseDown="this.className='iconButtonDown'"
                   onMouseUp="this.className='iconButtonUp'" />
                   <f:param name="ctx" value="triggertable"/>
                   </s:link>
                   </t:div>
                  
                   </div>
                  
                   </ui:define>
                  
                   <ui:define name="ui_content">
                  
                   <div class="unbounded_container">
                  
                   <a4j:outputPanel id="mainPanel">
                  
                   <t:dataTable value="#{triggerList}" var="trigger"
                   rendered="true">
                  
                   <t:column>
                   <a4j:commandLink
                   title="select"
                   value="M"
                   reRender="mainPanel"
                   styleClass="#{(triggerTable.selections[trigger.id]) ? 'selectedbutton' : 'selectbutton' }"
                   action="#{triggerTable.select}" >
                   </a4j:commandLink>
                   </t:column>
                  
                   <t:column>
                   <f:facet name="header">
                   <h:outputText
                   title="Description"
                   value="Description"/>
                   </f:facet>
                  
                   <s:link value="#{trigger.name}"
                   action="#{workFlowScheduledTrigger.editWfc}" >
                   <f:param name="wfid" value="#{trigger.id}"/>
                   <f:param name="wftype" value="#{trigger.type}"/>
                   <f:param name="ctx" value="triggertable"/>
                   </s:link>
                   </t:column>
                  
                   <t:column>
                   <f:facet name="header">
                   <h:outputText
                   title="Start Date"
                   value="Start Date"/>
                   </f:facet>
                   <h:outputText value="#{trigger.startDate}"/>
                   </t:column>
                  
                   <t:column>
                   <f:facet name="header">
                   <h:outputText
                   title="Repetitions"
                   value="Repetitions"/>
                   </f:facet>
                   <h:outputText value="#{trigger.repetitions}"/>
                   </t:column>
                  
                   <t:column>
                   <f:facet name="header">
                   <h:outputText
                   title="Period"
                   value="Period"/>
                   </f:facet>
                   <h:outputText value="#{trigger.period}"/>
                   </t:column>
                  
                   </t:dataTable>
                  
                   </a4j:outputPanel>
                  
                   </div>
                  
                   </ui:define>
                  
                   </ui:composition>
                  
                  


                  The included ajaxtablebuttons:
                  
                   <ui:composition xmlns="http://www.w3.org/1999/xhtml"
                   xmlns:ui="http://java.sun.com/jsf/facelets"
                   xmlns:h="http://java.sun.com/jsf/html"
                   xmlns:f="http://java.sun.com/jsf/core"
                   xmlns:s="http://jboss.com/products/seam/taglib"
                   xmlns:t="http://myfaces.apache.org/tomahawk"
                   xmlns:c="http://java.sun.com/jstl/core"
                   xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
                   xmlns:centina="http://www.centinasystems.com/jsf">
                  
                   <t:div styleClass="icontool">
                   <a4j:commandLink
                   title="Select all #{object}s"
                   reRender="#{reRender}"
                   limitToList="true"
                   ajaxSingle="true"
                   action="#{entity.selectAll}" >
                   <img src="/client/img/selectall32framed.png"
                   class="iconButtonOut"
                   onMouseOver="this.className='iconButtonUp'"
                   onMouseOut="this.className='iconButtonOut'"
                   onMouseDown="this.className='iconButtonDown'"
                   onMouseUp="this.className='iconButtonUp'" />
                   </a4j:commandLink>
                   </t:div>
                  
                   <t:div styleClass="icontool">
                   <a4j:commandLink
                   title="Unselect all #{object}s"
                   reRender="#{reRender}"
                   limitToList="true"
                   ajaxSingle="true"
                   action="#{entity.unselectAll}" >
                   <img src="/client/img/unselectAll32.png"
                   class="iconButtonOut"
                   onMouseOver="this.className='iconButtonUp'"
                   onMouseOut="this.className='iconButtonOut'"
                   onMouseDown="this.className='iconButtonDown'"
                   onMouseUp="this.className='iconButtonUp'" />
                   </a4j:commandLink>
                   </t:div>
                  
                   <t:div styleClass="icontool">
                   <a4j:commandLink
                   title="Delete Selected #{object}s"
                   onclick="if (!window.confirm('Confirm delete of selected #{object}s')) return false;"
                   reRender="#{reRender}"
                   limitToList="true"
                   ajaxSingle="true"
                   action="#{entity.deleteSelections}" >
                   <img src="/client/img/deleteall32framed.png"
                   class="iconButtonOut"
                   onMouseOver="this.className='iconButtonUp'"
                   onMouseOut="this.className='iconButtonOut'"
                   onMouseDown="this.className='iconButtonDown'"
                   onMouseUp="this.className='iconButtonUp'" />
                   </a4j:commandLink>
                   </t:div>
                  
                   </ui:composition>
                  


                  • 6. Re: s:link missing conversationId, sometimes
                    gavin.king

                    Yes, I checked the code and this looks to be a bug. Certainly behaviors shouldn't depend upon the order of things in the view.

                    [ulr]http://jira.jboss.com/jira/browse/JBSEAM-612[url]

                    Its a very easy fix, I think.

                    Perhaps a4j *does* know about seam conversations, thats the only way that could work, afaict.