Issue Details (XML | Word | Printable)

Key: TAP5-51
Type: Bug Bug
Status: Closed Closed
Resolution: Invalid
Priority: Major Major
Assignee: Howard M. Lewis Ship
Reporter: Fritz Pröbstle
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Tapestry 5

"Parents before Child" concept for Component Rendering does not allow different rendering in subclasses

Created: 28/Mar/08 12:11 PM   Updated: 30/Oct/08 09:45 PM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Resolution Date: 30/Oct/08 09:45 PM


 Description  « Hide
I subclassed GridPager ( public class MyGridPager extends GridPager) to implement another pager visualisation.
After creating a MyGrid (public class MyGrid extends Grid) which uses MyGridPager and copying Grid,tml to MyGrig.tml ist was ready to test.

Start.tml:
        <t:mygrid source="tl" row="treffer" rowsPerPage="5">
               <t:parameter name="regnrcell">
                 <t:pagelink page="marke2" > ${treffer.regnr}</t:pagelink>
            </t:parameter>
        </t:mygrid>

It runs fine - but I got the "old" ,default Visualiation *AND* the new one. It is a result of the "Parents before Child" concept .
First the Parent creates its visualisatrion the my Child createy its new visualisation.

Subclasses can not decide of they want to call the implemetation of their parent or not.

Why is this implemented like this?
Why call parent implemtation at all, the child could do this explicit by calling super.XXX.( I know Annotations may make this more complex)


Can you help ?






 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Howard M. Lewis Ship added a comment - 15/Apr/08 06:28 PM
There are complex issues at foot here, and there may not be any single solution that meets all needs in all cases.

The super approach is not valid: the super class methods may be private, or have different parameters or return types.

Howard M. Lewis Ship added a comment - 06/Jun/08 11:58 PM
My approach here will be that if the child class *overrides* a method of the parent, then the overridden method will be invoked only by the parent class, not the subclass.

Howard M. Lewis Ship made changes - 07/Jun/08 12:02 AM
Field Original Value New Value
Assignee Howard M. Lewis Ship [ hlship ]
Howard M. Lewis Ship made changes - 07/Jun/08 12:02 AM
Status Open [ 1 ] In Progress [ 3 ]
Repository Revision Date User Message
ASF #664538 Sun Jun 08 19:11:57 UTC 2008 hlship TAPESTRY-2311: "Parents before Child" concept for Component Rendering does not allow different rendering in subclasses
Files Changed
MODIFY /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/InternalClassTransformationImpl.java
MODIFY /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/InternalClassTransformation.java
MODIFY /tapestry/tapestry5/trunk/tapestry-core/src/test/app1/EventHandlerDemo.tml
MODIFY /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/PageLifecycleAnnotationWorker.java
MODIFY /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/ClassTransformation.java
ADD /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/RenderPhaseMethodWorker.java (from /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ComponentLifecycleMethodWorker.java)
MODIFY /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java
MODIFY /tapestry/tapestry5/trunk/tapestry-core/src/site/apt/guide/rendering.apt
MODIFY /tapestry/tapestry5/trunk/tapestry-core/src/site/apt/upgrade.apt
ADD /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/transform/RenderPhaseMethodWorkerTest.java (from /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/transform/ComponentLifecycleMethodWorkerTest.java)
ADD /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/InjectionKey.java
MODIFY /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/OnEventWorker.java
MODIFY /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/InternalClassTransformationImplTest.java
MODIFY /tapestry/tapestry5/trunk/tapestry-core/src/site/apt/guide/event.apt
ADD /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/SimpleBeanSubclass.java
MODIFY /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
ADD /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ConstructorArg.java

Howard M. Lewis Ship made changes - 08/Jun/08 07:17 PM
Resolution Fixed [ 1 ]
Fix Version/s 5.0.13 [ 12313205 ]
Status In Progress [ 3 ] Closed [ 6 ]
Fritz Pröbstle added a comment - 17/Jul/08 11:14 AM - edited
The *override* functionality works fine if all classes base and subclass(es) are in the same package-then
the overriden function is called for subclass only.

If base and subclasses are in *different* packages only the base class function is called. ( It seams as if tapestry did not "see" the overwritten one.

This really seams to be the problem, because if you
specify the function to be "protected" (at least) tapestry can "see" it and calls the correct one.

This workaound can be done id source is available for the base class(es) and does not work if I want to subclass
core-components.( And naturally this is doen in another package, so this error prevents my to use the new *Overridíng* feature)



Fritz Pröbstle made changes - 17/Jul/08 11:14 AM
Status Closed [ 6 ] Reopened [ 4 ]
Resolution Fixed [ 1 ]
Howard M. Lewis Ship made changes - 19/Aug/08 05:12 PM
Assignee Howard M. Lewis Ship [ hlship ]
Howard M. Lewis Ship made changes - 18/Sep/08 02:25 PM
Fix Version/s 5.0.13 [ 12313205 ]
Component/s tapestry-core [ 12311285 ]
Affects Version/s 5.0.11 [ 12312968 ]
Key TAPESTRY-2311 TAP5-51
Project Tapestry [ 10573 ] Tapestry 5 [ 12310833 ]
Howard M. Lewis Ship added a comment - 30/Oct/08 09:45 PM
Still don't think there's a bug here, and your comment about different packages ... are you sure the overridden methods are protected or public?

Howard M. Lewis Ship made changes - 30/Oct/08 09:45 PM
Resolution Invalid [ 6 ]
Assignee Howard M. Lewis Ship [ hlship ]
Status Reopened [ 4 ] Closed [ 6 ]