1 Reply Latest reply on Jun 16, 2009 5:50 PM by Ian Michell

    parsing expressions in messages.properties and Contexts.getEventContext().set

    Ian Michell Newbie
      Hi,

      Using Seam 2.1.1.GA I am injecting the messages map (@In Map<String, String> messages) and setting eventContext variables before using get on the map and I'm getting an exception that states that it cannot resolve the value... Code follows:

      Code for a single purchase order in my document history
      --------------------------------------------------------------------------------------------
      Contexts.getEventContext().set("trn.viewTransactions.poDocument", poList.get(0));
      Contexts.getEventContext().set("trn.viewTransactions.supplierName", poList.get(0).getSupplierOrgs().first().getCommonName());
      Contexts.getEventContext().set("trn.viewTransactions.poList", messages.get("mytransactions.messages.generated.link"));
      Contexts.getEventContext().flush();
      history.setActionDescription(messages.get("mytransactions.messages.generated.single"));
      --------------------------------------------------------------------------------------------
      Expected output: This requisition also generated this order: Order 12345 - ACME Suppliers
      Expression: This requisition also generated this order: #{trn.viewTransactions.poList}

      It throws an exception saying viewTransactions cannot be resolved on the seam namespace, this generally means that it can't find the values in the expression.

      I have tried flushing the event context to see if it makes a difference (hence the flush above). Is this a bug, or am I doing the entire thing wrong?

      Any help would be appreciated.

      Ian