Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-1930

Improve documentation for @DataModelSelection and @DataModelSelectionIndex

    Details

    • Type: Task
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 2.0.0.BETA1
    • Fix Version/s: 2.0.0.CR3
    • Component/s: None
    • Labels:
      None

      Description

      The existing documentation for @DataModelSelection and @DataModelSelectionIndex seems to indicate to developers that you are naming the @DataModelSelection or @DataModelSelectionIndex context variable by specifying the value. I have heard this same question from every new member of my team when they try to use 2 DataModels in one component.

      The following patch (or something along these lines) is recommended for both @DataModelSelection and @DataModelSelectionIndex:

      @DataModelSelection

      Injects the selected value from the JSF DataModel (this is the element of the underlying collection, or the map value) that the DataModelSelection is associated with. If only one @DataModel attribute is defined for a component, the selected value from that DataModel will be injected. Otherwise, the component name of each @DataModel must be specified in the value attribute for each @DataModelSelection.

      @DataModel(value="list1")
      private List<String> list1;

      @DataModelSelection(value="list1")
      private String focusList1;

      @DataModel(value="list2")
      private List<String> list2;

      @DataModelSelection(value="list2")
      private String focusList2;

      Specifies that the attribute focusList1 is to be injected with the DataModelSelection for the component list1, and similarly focusList2 is injected with the DataModelSelection for list2. Note: @DataModelSelection is like @In. If you want to outject a DataModelSelection, you will have to do so explicitly through by annotating the attribute with @Out.

      • value - name of the @DataModel conversation context variable this @DataModelSelection is associated with. Not needed if there is exactly one @DataModel in the component.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                pmuir Pete Muir
                Reporter:
                jacob.orshalick Jacob Orshalick
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: