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

            People

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

              Dates

              • Created:
                Updated:
                Resolved: