concept Seam command component in category seam

appears as: Seam commd components, Seam commd components
Seam in Action

This is an excerpt from Manning's book Seam in Action.

  • The URL generated by Seam command components (<s:link> and <s:button>)
  • Data model selection with Seam command components

    The command components in the Seam UI component library, <s:link> and <s:button>, support data model selections, despite the fact that they don’t submit a form or restore the JSF UI component tree like the JSF command components. In previous chapters, you learned that it’s possible to use the Seam command components to execute actions and perform navigation, so you know they are already quite capable. They can also emulate the data model selection feature of JSF through the use of two URL parameters, dataModelSelection and actionMethod, which are processed by the Seam phase listener and used to inject the data from the selected row into a @DataModelSelection or @DataModelSelectionIndex property. An example is provided in a moment.

    The Seam command component tags aren’t quite a drop-in replacement for the JSF command components. They don’t restore the JSF UI component tree, which means that the page-scoped data isn’t propagated. For our example, this means that the page-scoped newGolfers data model is left behind. Thus, to allow formless data model selection using the Seam command components, the data model must be stored in a longer-lived scope.