Announcement Announcement Module
No announcement yet.
<h:outputText> in end-state view Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • <h:outputText> in end-state view

    I'm just playing around with SWF and JSF using the sellitem example for JSF. The last view, "costOverview", which is an end-state accesses data which was provided by the user in the previous steps with ${sale.price}. If I try to render the value with the JSF <h:outputText> tag this does not not work. Is this because the view belongs to an end-state and the coupling between SWF and JSF is gone? Is this a bug? It would be nice to be able to use <h:outputText> in this view, too, e.g. to be able to use JSF convertes for rendering the values.

  • #2
    It works for me, e.g. using <h:outputText value="#{sale.itemCount}"/> instead of ${sale.itemCount}. I guess an end state with an explicit redirect: might fail (because the GET after the initial POST would have no access to the flow scope), but if there is no redirect, which should be the default, it ought to work because #{sale} can be resolved from request scope.

    What are the details of where things go wrong for you?


    • #3
      Ok, you're right. It works for me, too. I have tried to use #{} like in all the other views of this example. I have to admit that the usage of #{}, #{sale.price} and ${sale.price} in the whole example is a bit confusing for me. So, in your opinion, what is the right way to access managed beans in SWF? Are the different types of scopes useless when SWF is used with JSF?


      • #4
        All the scopes should be accessible from JSF, so nothing much should change. End states are just a bit special (no difference here with non-JSF views) because the flow has been destroyed.


        • #5
          I did some more investigation on this topic and got even more confused.
          1. I can access the managed-beans with #{sale.price} in all views but in the first one. On submit of priceAndItemCountForm I get a javax.faces.el.PropertyNotFoundException because the identifier "sale" was resolved to null.
          2. As I said before, the usage of #{} in the view of the end-state (costOverview) does not work and I get an IllegalStateException which informs me that the flow execution is not active.
          3. Do I have the ability to use the different scopes? The example only makes use of FlowScope. When I change it to use FlashScope it does not work anymore.
          4. What's the right way to define the objects to which the form data is bound? In the example the Sale object is defined as prototype-scoped bean and a FormAction is also defined. It seems to me that the FormAction is only necessary if validation via SWF is used, right?

          By the way, I'm using version 1.0.2-SNAPSHOT-20070228-1449 of SWF. I've also extended the sellitem-jsf example to use Facelets.

          Thanks for any help.