Details

      Description

      Given

      class Foo

      { Bar bar; // Getters and setters List<Bar> bars; // Getters and setters }

      <h:selectOneMenu value="#

      {foo.bar}

      " >
      <f:selectItems value="#

      {foo.bars}

      " var="bar" itemLabel="#

      {bar.label}

      " itemValue="#

      {bar}

      " />
      <s:convertEntity /> || <s:convertObject />
      </h:selectOneMenu>

      I want to be able to have my setter/getter reference an object and not write the boilerplate for converting to/from a string.

      I also want to reference a managed entity, and have that managed entity set back into the setter so I can see the changes updated in the database with no boilerplate, and avoid LIEs.

        Gliffy Diagrams

          Activity

          Hide
          pmuir Pete Muir added a comment -

          The UID you store should NOT be based on some list order solution, it needs to be based on an ID stored in a map because otherwise if the backing list order changes, the converter fails.

          Show
          pmuir Pete Muir added a comment - The UID you store should NOT be based on some list order solution, it needs to be based on an ID stored in a map because otherwise if the backing list order changes, the converter fails.
          Hide
          nickarls Nicklas Karlsson added a comment -

          I have some code for this (pretty similar EntityStore arch that Seam 2 had). Works on a conceptual level but currently waiting on the persistence module for polishing.

          Show
          nickarls Nicklas Karlsson added a comment - I have some code for this (pretty similar EntityStore arch that Seam 2 had). Works on a conceptual level but currently waiting on the persistence module for polishing.
          Hide
          lincolnthree Lincoln Baxter III added a comment -

          Hey Jason,

          I saw the code you sent me, but I don't remember exactly how you implemented it. Is this what you were trying to address?

          Show
          lincolnthree Lincoln Baxter III added a comment - Hey Jason, I saw the code you sent me, but I don't remember exactly how you implemented it. Is this what you were trying to address?
          Hide
          bleathem Brian Leathem added a comment -

          From IRC:

          (09:51:34 PM) stuartdouglas: really EntityConverter can be replaced with a generic conversation scoped convertre
          (09:52:13 PM) stuartdouglas: basically you have a conversation scoped components with a map<String, Object>
          (09:52:29 PM) stuartdouglas: when you convert to a String you generate a arbitrary string id and store it
          (09:52:39 PM) stuartdouglas: to convert back you just do a map lookup
          (09:52:52 PM) stuartdouglas: so you can convert anything as long as you have a conversation active
          (09:57:40 PM) bleathem: one could use the view scope, no?
          (09:57:48 PM) bleathem: you always post back to the same page
          (09:57:49 PM) stuartdouglas: yes, any long lived scope would work

          Show
          bleathem Brian Leathem added a comment - From IRC: (09:51:34 PM) stuartdouglas: really EntityConverter can be replaced with a generic conversation scoped convertre (09:52:13 PM) stuartdouglas: basically you have a conversation scoped components with a map<String, Object> (09:52:29 PM) stuartdouglas: when you convert to a String you generate a arbitrary string id and store it (09:52:39 PM) stuartdouglas: to convert back you just do a map lookup (09:52:52 PM) stuartdouglas: so you can convert anything as long as you have a conversation active (09:57:40 PM) bleathem: one could use the view scope, no? (09:57:48 PM) bleathem: you always post back to the same page (09:57:49 PM) stuartdouglas: yes, any long lived scope would work
          Hide
          hantsy hantsy bai added a comment -

          I noticed a ObjectConverter was added into the Seam faces repository. But the apidoc said it can only be applied in a long run Conversation scoped, how to process when I use request, view, transient conversation scope.

          why not put the converted objects in the viewMap of the view root? They can be created when view root was created and be destroyed when the view root was destroyed.

          Show
          hantsy hantsy bai added a comment - I noticed a ObjectConverter was added into the Seam faces repository. But the apidoc said it can only be applied in a long run Conversation scoped, how to process when I use request, view, transient conversation scope. why not put the converted objects in the viewMap of the view root? They can be created when view root was created and be destroyed when the view root was destroyed.

            People

            • Assignee:
              lightguard Jason Porter
              Reporter:
              pmuir Pete Muir
            • Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development