Announcement Announcement Module
Collapse
No announcement yet.
How to retrieve input value in ManySelectionTrackingListDataModel/h:dataTable Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to retrieve input value in ManySelectionTrackingListDataModel/h:dataTable

    Hi,

    I am new to Spring web flow and I am looking to retrieve values from
    h:inputText from the h:dataTable populated with ManySelectionTrackingListDataModel.

    In my webflow.xml I have,

    <evaluate expression="sampleAction.getInfo(fieldId)" result="flowScope.samples" result-type="org.springframework.faces.model.ManySelectio nTrackingListDataModel"/>

    I display it in my xhtml as follow:
    <h:form id="formName">
    <h:dataTable id="samples" styleClass="summary" value="#{samples}" var="s" rendered="#{samples.rowCount > 0}">
    <h:column><f:facet name="header">Sample Id</f:facet>#{s.sampleId}</h:column>
    <h:column><f:facet name="header">Sample Desc</f:facet><h:inputText id=" sampleDesc " value="#{s.sampleDesc}"/></h:column>
    </h:dataTable>
    <sf:commandLink id="updateAll" value="Update All" action="updateAll"/>
    </h:form>

    I would like to know what the user changed and update the database appropriately.

    In my webflow.xml I the following transition:
    <transition on="updateAll">
    <set name="samples" value="flowScope.samples.selectAll()"
    type="org.springframework.faces.model.ManySelectio nTrackingListDataModel"></set>
    <evaluate expression="sampleAction.printInfo(flowRequestCont ext, samples)"/>
    </transition>

    I can't seem to find the changed input values in when I debug:
    (ManySelectionTrackingListDataModel) context.getFlowScope().get("samples");

    Please point me to the right object to look for the input values.

    Thank you for your help.

  • #2
    Hello,

    You could access is in the following way:

    add the select column in the data table:

    <h:selectBooleanCheckbox title="Select this result" value="#{samples.currentRowSelected}" />

    then in the flow definition:

    <set name="viewScope.samplesSelected" value="samples.selections" />

    Regards,
    Krzysztof

    Comment


    • #3
      Hi Krzysztof,

      Thank you very much for you quick response.

      I tried using samples.selections but the list in my still has the original values and not the new inputText values. I am hoping to write a method and update the entire data grid.

      Thank you very much for you help again.

      Comment


      • #4
        gchan, I think the trouble is in your set action within your "updateAll" transition. You're setting "samples", but you're not specifying the scope where you're trying to set the attribute. Try changing your set action to use "flowScope.samples" for the name instead.

        Comment

        Working...
        X