ajax4jsf
  1. ajax4jsf
  2. AJAX4JSF-24

Use provided converter to serialize object in a4j:actionparam

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: www
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      24

      Description

      It would be nice that the a4j:actionparam uses the assigned converter (if
      provided) to serialize the value besides using it to deserialize it.

      My current use case is this:

      <c:forEach var="photo" items=#

      {photoController.userPhotos}

      ">
      <h:commandLink......>
      <a4j:support event="onclick" action=.....>
      <a4j:actionparam assignTo="#

      {photoController.currentPhoto}

      " value="#

      {photo}

      "
      converter="photoConverter" />
      </a4j:support>
      </h:commandLink>

      Where photo is a BusinessObject, and the converter is declared in
      faces-config.xml and uses object serialization to convert the value to String
      and from String. The problem is that only the getAsObject method is called, and
      not the getAsString. As a result, I get a String parameter that's nothing but
      the object's toString(), so when I try to deserialize it I get a IOException.

      I could change the object's toString method, but I'd rather not pollute my
      business object with behaviour that is specific to the presentation
      techonologies. I'd also like to be able to change the serialization method
      without modifying my BO.

      It's the first issue I ever fill, I hope I did it correctly.
      Best Regards.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            ajax4jsf-issues
            Reporter:
            pablotdl
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: