2 Replies Latest reply on Jun 17, 2009 9:10 AM by allforjava

    How To: InplaceSelect within dataTable?

    allforjava

      Hi,

      I need to perform these tasks towards a inplaceSelect for each row of the dataTable:
      1. Fetch current rowdata [into issuesHome.instance]
      2. Modify the 'status' [within selected issuesHome.instance]
      3. Persists [issuesHome.instance] towards selection of a value, from inplaceSelect's items.

      Code:

      <rich:column id="statusDecoration" valign="top">
       <f:facet name="header">
       </f:facet>
       <a:outputPanel ajaxRendered="true">
       <rich:inplaceSelect id="inplaceSelect"
       value="#{issuesHome.instance.issueStatus}"
       defaultLabel="#{issues.issueStatus.status}" showControls="false"
       controlsHorizontalPosition="left" controlsVerticalPosition="bottom">
       <a:support event="onviewactivated">
       <f:setPropertyActionListener value="#{issues}" target="#{issuesHome.instance}"/>
       </a:support>
       <a:support event="onchange" reRender="issuesListTable" action="#{issuesHome.update}"/>
       <f:selectItems value="#{issueStatusList.issueStatusList}"/>
       <s:convertEntity/>
       </rich:inplaceSelect>
       </a:outputPanel>
      </rich:column>


      However, the results are not as expected. What m I, missing? Please assist with.

      Thank you in advance!

        • 1. Re: How To: InplaceSelect within dataTable?
          ilya_shaikovsky

          From the beggining it\s not a good idea to use both supports to onchange and onviewactivated. you'll get two concurrent requests in the result. So remove the support on onchange because it fired before the new value stored in input,

          and please specify "However, the results are not as expected." more clearly.

          • 2. Re: How To: InplaceSelect within dataTable?
            allforjava

            Thank you Ilya, for speedy reply!

            I need the three event for:

            1. Selection/fetching the current row data/object
            2. Modify the fetched content with InplaceSelect's selection AND
            3. Update the records in database.

            As suggested seperated a:support, one for inplaceSelect with event=onchange and another on dataTable with event=onrowclick/onRowMouseDown.

            However towards inplaceSelect I'm not getting 'onRowClick' to capture current row data over dataTable. I guess even using valueChangeListener over inplaceSelect, cannot get the current row contents/id.

            I there any way to delay the event or put them in sequence to process after prior event is processed?


            Please suggest a way to do this.