ICEfaces
  1. ICEfaces
  2. ICE-5766

sparkle generator ActionSource2 support

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Alpha3
    • Fix Version/s: 2.0-Beta2, 2.0.0
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      sparkle

      Description

      Most properties follow a simple pattern, having a tag attribute name from which one can derive the StateHelper key, and the getter and setter method names. The action and actionListener attributes, as part of an ActionSource2 implementing component, are a whole other matter.

      The action attribute is represented in the component by MethodExpression getActionExpression() and void setActionExpression(MethodExpression) methods. As well, there are deprecated legacy MethodBinding getAction() and void setAction(MethodBinding) methods, which use wrapper code to call into the ActionExpression methods.

      The actionListener attribute is even more complicated, with the preferred API involving void addActionListener(ActionListener), void removeActionListener(ActionListener), ActionListener[] getActionListeners(). This means that there's no classical getter/setter, and any Tag class or Facelets Handler class would have to use javax.faces.event.MethodExpressionActionListener to wrap the MethodExpression with an ActionListener implementation.

      The immediate attribute behaves like any other property, but its TLD doc and Javadoc has a different explanation than the UIInput variant of immediate.

      With sparkle, we can see two main scenarios for Meta classes using ActionSource2. The first is where the generated Base class in some way extends a concrete implementation of ActionSource2, like UICommand. The second scenario is where the generated Base class itself should implement ActionSource2, effectively duplicating UICommand.

      In the first scenario, we only want to create entries for action/actionListener/immediate in the xml files, like the TLD. We don't want to generate any code in the Base class, and need only properly invoke setActionExpression(-), addActionListener, setImmediate(-) from the JSP Tag class. It's not necessary for creating Facelets Handler code, since Facelets already does this. We'll have to find a way to represent this in the Meta class. The typical inherit/useTemplate fields don't exactly cover the scope of alteration necessary. And with immediate, we'd still have to add some way of differentiating between the two immediate attributes.

      In the second scenario, we would have to generate all the code that UICommand already has, into the Base class, then do everything from the above scenario as well. It's likely that the Meta class would have to specify something to differentiate the two scenarios, such as have inherit=false.

        Issue Links

          Activity

          Repository Revision Date User Message
          ICEsoft Public SVN Repository #21721 Thu Jun 10 21:58:05 MDT 2010 adnan.durrani Fix towards ICE-5766 (sparkle generator ActionSource2 support)
          Files Changed
          Commit graph ADD /icefaces/scratchpads/sparkle/generator/src/org/icefaces/generator/behavior/Behavior.java
          Commit graph MODIFY /icefaces/scratchpads/sparkle/generator/src/org/icefaces/generator/context/ComponentContext.java
          Commit graph ADD /icefaces/scratchpads/sparkle/generator/src/org/icefaces/component/annotation/ActionSource.java
          Commit graph ADD /icefaces/scratchpads/sparkle/generator/src/org/icefaces/generator/behavior
          Commit graph MODIFY /icefaces/scratchpads/sparkle/generator/src/org/icefaces/generator/artifacts/ComponentArtifact.java
          Commit graph MODIFY /icefaces/scratchpads/sparkle/generator/src/org/icefaces/generator/context/GeneratorContext.java
          Commit graph ADD /icefaces/scratchpads/sparkle/generator/src/org/icefaces/generator/behavior/ActionSourceBehavior.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #21552 Sun May 30 22:36:23 MDT 2010 adnan.durrani Fix towards ICE-5766(sparkle generator ActionSource2 support)
          Files Changed
          Commit graph MODIFY /icefaces/scratchpads/sparkle/component/src/org/icefaces/component/pushbutton/PushButtonMeta.java
          Commit graph MODIFY /icefaces/scratchpads/sparkle/generator/src/org/icefaces/generator/TagClassGenerator.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #21480 Wed May 26 09:46:02 MDT 2010 judy.guglielmin ICE-5766 workaround modifications so UICommand ActionListener/MethodExpression bindings will be allowed in generator. jsf tags are turned off--not supported in ICEfaces-2.0 anyways (yet)
          Files Changed
          Commit graph MODIFY /icefaces/scratchpads/sparkle/generator/src/org/icefaces/generator/FileWriter.java
          Commit graph MODIFY /icefaces/scratchpads/sparkle/generator/src/org/icefaces/generator/TagClassGenerator.java
          Commit graph MODIFY /icefaces/scratchpads/sparkle/generator/src/org/icefaces/component/annotation/PropertyTemplate.java
          Commit graph MODIFY /icefaces/scratchpads/sparkle/generator/src/org/icefaces/generator/Generator.java

            People

            • Assignee:
              Mark Collette
              Reporter:
              Mark Collette
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: