RE: Single inheritence in parts
This issue has come up many, many times before: http://www.mail-archive.com/users@wicket.apache.org/msg06381.html http://www.mail-archive.com/wicket-u...@lists.sourceforge.net/msg26247.h tml Unfortunately some people try to convince the group that proposals like the one you have presented here are not in line with Java's 'single inheritance' model and therefore must be 'multiple inheritance' but they are clearly not understanding the issue properly. What you are suggesting here is not 'the horror of multiple inheritance'. It is simply single inheritance with 'multiple overridable markup sections' and therefore would IMHO be an excellent enhancement to Wicket. Stefan and I were discussing multiple options more than a year ago and Stefan even went to the effort of creating a Wicket patch that implemented support for overriding multiple sections but I'm pretty sure it hasn't yet been added to SVN. Stefan raised a feature request for this in JIRA: https://issues.apache.org/jira/browse/WICKET-1134 The only thing extra that we discussed that you have not included in your sample is that when we move from ONE overridable markup section to MULTIPLE overridable sections (but still only a single super class/markup!) we need to introduce and a way of identifying each section (which obviously isn't required when you limit the number of overridable sections to 1. The great thing about identifying which section you are overriding is that you can pick and choose which sections you override and which you just 'default' to the markup of the super class/markup file. I'm actually thinking that using specific wicket:extend and wicket:child is a big hinderance to chaining in a hierarchy because you have a different tag depending on whether you are providing a 'markup section' to be overridden or whether you are overriding a 'markup section'. This gets awkward and clumsy when it comes to flexible 'chaining' down an inheritance hierarchy and Java has no such equivalent. We could probably have a single tag to be used consistently in super or subclass to allow very simple syntax that supports fluid inheritance down a markup hierarchy: wicket:namedsection id=header (or whatever) Overriding is then optional: absence of a named section in a subclass markup simply means that the markup from the closest superclass markup should be used. I really hope this gets implemented soon. The 'workaround' that is often suggested is a 'component based' workaround rather than a truly object oriented approach that allows multiple sections to be overridden. As a hard line OOer that doesn't quite cut it. I have even gone to the extent of creating a special markup preparser that lets me write markup with multiple overridable sections which are then compiled to 'flattened' markup for Wicket to process at run time. It works extremely well and satisfies my needs but it would be nicer if it was supported natively in Wicket. -Original Message- From: Arjun Dhar [mailto:dhar...@yahoo.com] Sent: Monday, 5 July 2010 3:40 PM To: users@wicket.apache.org Subject: Single inheritence in parts Hi, all the examples etc suggest that Single inheritence is possible but I cant break it up. The break up is essential when you want to merge common parts of your MARKUP with multiple specific parts of the Child page. Example: HTML HEADtitleBASE TEMPLATE / PARENT PAGE/title/HEAD BODY wicket:child / br / h2Some other Html common/h2 wicket:child / /BODY /HTML --- HTML HEADtitleCHILD PAGE 1/title/HEAD BODY wicket:extend Part 1 specific to Child Page /wicket:extend Any HTML here can be ignored as conceptually anyway what appears in extend is what should be rendered from a child page. wicket:extend Part 2 Specific to Child Page (will appear after common HTML in parent page) /wicket:extend /BODY /HTML I tried this, only the first part renders. I'm wondering if we can add such capability. Conceptually I don't see why not. If already possible do let me know or consider as a feature request?! -Thanks Arjun -- View this message in context: http://apache- wicket.1842946.n4.nabble.com/Single-inheritence-in-parts- tp2278064p2278064.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Single inheritence in parts
Search the list for this and you'll find some quite long discussions. Basically, it's not going to happen. This would be multiple inheritance, not single. Hi Jeremy, I hope I don't sound confrontationalist when I say this but this is clearly not a case of multiple inheritance. For this request to be deemed to be multiple inheritance one class/markup file would need to be inheriting from two separate super classes/markup files. That is not what is requested here. There remains only a single super class/markup file. All that is requested here is for multiple markup sections to be overridden in this single inheritance scenario - just like Java does not restrict you to overriding only a single method in any Java class: You can override as many methods as you like in a Java class but that does not break Java's single inheritance model - which constrains the number of base classes to ONE, not the number of methods you can override to ONE. All this user (and others before him) are asking is for wicket to support the overriding of N markup sections without instead of the arbitrarily imposed constraint of N = 1. Jeremy Thomerson -- sent from my smartphone - please excuse formatting and spelling errors On Jul 5, 2010 12:41 AM, Arjun Dhar dhar...@yahoo.com wrote: Hi, all the examples etc suggest that Single inheritence is possible but I cant break it up. The break up is essential when you want to merge common parts of your MARKUP with multiple specific parts of the Child page. Example: HTML HEADtitleBASE TEMPLATE / PARENT PAGE/title/HEAD BODY wicket:child / br / h2Some other Html common/h2 wicket:child / /BODY /HTML --- HTML HEADtitleCHILD PAGE 1/title/HEAD BODY wicket:extend Part 1 specific to Child Page /wicket:extend Any HTML here can be ignored as conceptually anyway what appears in extend is what should be rendered from a child page. wicket:extend Part 2 Specific to Child Page (will appear after common HTML in parent page) /wicket:extend /BODY /HTML I tried this, only the first part renders. I'm wondering if we can add such capability. Conceptually I don't see why not. If already possible do let me know or consider as a feature request?! -Thanks Arjun -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Single-inheritence-in-parts- tp2278064p2278064.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Single inheritence in parts
class Page extends Page { abstract Component getPart1(); abstract Component getPart2(); } html div wicket:id=id4part1 / wicket:child / div wicket:id=id4part2 / On Thu, Jul 8, 2010 at 5:49 AM, Chris Colman chr...@stepaheadsoftware.comwrote: Search the list for this and you'll find some quite long discussions. Basically, it's not going to happen. This would be multiple inheritance, not single. Hi Jeremy, I hope I don't sound confrontationalist when I say this but this is clearly not a case of multiple inheritance. For this request to be deemed to be multiple inheritance one class/markup file would need to be inheriting from two separate super classes/markup files. That is not what is requested here. There remains only a single super class/markup file. All that is requested here is for multiple markup sections to be overridden in this single inheritance scenario - just like Java does not restrict you to overriding only a single method in any Java class: You can override as many methods as you like in a Java class but that does not break Java's single inheritance model - which constrains the number of base classes to ONE, not the number of methods you can override to ONE. All this user (and others before him) are asking is for wicket to support the overriding of N markup sections without instead of the arbitrarily imposed constraint of N = 1. Jeremy Thomerson -- sent from my smartphone - please excuse formatting and spelling errors On Jul 5, 2010 12:41 AM, Arjun Dhar dhar...@yahoo.com wrote: Hi, all the examples etc suggest that Single inheritence is possible but I cant break it up. The break up is essential when you want to merge common parts of your MARKUP with multiple specific parts of the Child page. Example: HTML HEADtitleBASE TEMPLATE / PARENT PAGE/title/HEAD BODY wicket:child / br / h2Some other Html common/h2 wicket:child / /BODY /HTML --- HTML HEADtitleCHILD PAGE 1/title/HEAD BODY wicket:extend Part 1 specific to Child Page /wicket:extend Any HTML here can be ignored as conceptually anyway what appears in extend is what should be rendered from a child page. wicket:extend Part 2 Specific to Child Page (will appear after common HTML in parent page) /wicket:extend /BODY /HTML I tried this, only the first part renders. I'm wondering if we can add such capability. Conceptually I don't see why not. If already possible do let me know or consider as a feature request?! -Thanks Arjun -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Single-inheritence-in-parts- tp2278064p2278064.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Single inheritence in parts
class Page extends Page { abstract Component getPart1(); abstract Component getPart2(); } html div wicket:id=id4part1 / wicket:child / div wicket:id=id4part2 / That's the component based workaround that I mentioned which IMHO isn't really the pure markup OO solution we're proposing. I'm hoping for true markup inheritance that supports multiple overridable sections that doesn't mandate a Java side coding change each time a markup editor adds or removes a particular overridable section. On Thu, Jul 8, 2010 at 5:49 AM, Chris Colman chr...@stepaheadsoftware.comwrote: Search the list for this and you'll find some quite long discussions. Basically, it's not going to happen. This would be multiple inheritance, not single. Hi Jeremy, I hope I don't sound confrontationalist when I say this but this is clearly not a case of multiple inheritance. For this request to be deemed to be multiple inheritance one class/markup file would need to be inheriting from two separate super classes/markup files. That is not what is requested here. There remains only a single super class/markup file. All that is requested here is for multiple markup sections to be overridden in this single inheritance scenario - just like Java does not restrict you to overriding only a single method in any Java class: You can override as many methods as you like in a Java class but that does not break Java's single inheritance model - which constrains the number of base classes to ONE, not the number of methods you can override to ONE. All this user (and others before him) are asking is for wicket to support the overriding of N markup sections without instead of the arbitrarily imposed constraint of N = 1. Jeremy Thomerson -- sent from my smartphone - please excuse formatting and spelling errors On Jul 5, 2010 12:41 AM, Arjun Dhar dhar...@yahoo.com wrote: Hi, all the examples etc suggest that Single inheritence is possible but I cant break it up. The break up is essential when you want to merge common parts of your MARKUP with multiple specific parts of the Child page. Example: HTML HEADtitleBASE TEMPLATE / PARENT PAGE/title/HEAD BODY wicket:child / br / h2Some other Html common/h2 wicket:child / /BODY /HTML --- HTML HEADtitleCHILD PAGE 1/title/HEAD BODY wicket:extend Part 1 specific to Child Page /wicket:extend Any HTML here can be ignored as conceptually anyway what appears in extend is what should be rendered from a child page. wicket:extend Part 2 Specific to Child Page (will appear after common HTML in parent page) /wicket:extend /BODY /HTML I tried this, only the first part renders. I'm wondering if we can add such capability. Conceptually I don't see why not. If already possible do let me know or consider as a feature request?! -Thanks Arjun -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Single-inheritence-in-parts- tp2278064p2278064.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Single inheritence in parts
And, this method doesn't really work very well either. You can't reliably call those abstract methods from the superclass' constructor. On Thu, Jul 8, 2010 at 2:47 PM, Chris Colman chr...@stepaheadsoftware.com wrote: class Page extends Page { abstract Component getPart1(); abstract Component getPart2(); } html div wicket:id=id4part1 / wicket:child / div wicket:id=id4part2 / That's the component based workaround that I mentioned which IMHO isn't really the pure markup OO solution we're proposing. I'm hoping for true markup inheritance that supports multiple overridable sections that doesn't mandate a Java side coding change each time a markup editor adds or removes a particular overridable section. On Thu, Jul 8, 2010 at 5:49 AM, Chris Colman chr...@stepaheadsoftware.comwrote: Search the list for this and you'll find some quite long discussions. Basically, it's not going to happen. This would be multiple inheritance, not single. Hi Jeremy, I hope I don't sound confrontationalist when I say this but this is clearly not a case of multiple inheritance. For this request to be deemed to be multiple inheritance one class/markup file would need to be inheriting from two separate super classes/markup files. That is not what is requested here. There remains only a single super class/markup file. All that is requested here is for multiple markup sections to be overridden in this single inheritance scenario - just like Java does not restrict you to overriding only a single method in any Java class: You can override as many methods as you like in a Java class but that does not break Java's single inheritance model - which constrains the number of base classes to ONE, not the number of methods you can override to ONE. All this user (and others before him) are asking is for wicket to support the overriding of N markup sections without instead of the arbitrarily imposed constraint of N = 1. Jeremy Thomerson -- sent from my smartphone - please excuse formatting and spelling errors On Jul 5, 2010 12:41 AM, Arjun Dhar dhar...@yahoo.com wrote: Hi, all the examples etc suggest that Single inheritence is possible but I cant break it up. The break up is essential when you want to merge common parts of your MARKUP with multiple specific parts of the Child page. Example: HTML HEADtitleBASE TEMPLATE / PARENT PAGE/title/HEAD BODY wicket:child / br / h2Some other Html common/h2 wicket:child / /BODY /HTML --- HTML HEADtitleCHILD PAGE 1/title/HEAD BODY wicket:extend Part 1 specific to Child Page /wicket:extend Any HTML here can be ignored as conceptually anyway what appears in extend is what should be rendered from a child page. wicket:extend Part 2 Specific to Child Page (will appear after common HTML in parent page) /wicket:extend /BODY /HTML I tried this, only the first part renders. I'm wondering if we can add such capability. Conceptually I don't see why not. If already possible do let me know or consider as a feature request?! -Thanks Arjun -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Single-inheritence-in-parts- tp2278064p2278064.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Single inheritence in parts
class Page extends Page { abstract Component getPart1(String id); abstract Component getPart2(String id); onBeforeRender() { if (get(part1)==null) { add(getPart1(part1)); } if (get(part2)==null) { add(getPart2(part1)); } }} in 1.5 it would be done like this class Page extends Page { abstract Component getPart1(String id); abstract Component getPart2(String id); onInitialize() { add(getPart1(part1)); add(getPart2(part1)); }} -igor On Thu, Jul 8, 2010 at 2:23 PM, James Carman ja...@carmanconsulting.com wrote: And, this method doesn't really work very well either. You can't reliably call those abstract methods from the superclass' constructor. On Thu, Jul 8, 2010 at 2:47 PM, Chris Colman chr...@stepaheadsoftware.com wrote: class Page extends Page { abstract Component getPart1(); abstract Component getPart2(); } html div wicket:id=id4part1 / wicket:child / div wicket:id=id4part2 / That's the component based workaround that I mentioned which IMHO isn't really the pure markup OO solution we're proposing. I'm hoping for true markup inheritance that supports multiple overridable sections that doesn't mandate a Java side coding change each time a markup editor adds or removes a particular overridable section. On Thu, Jul 8, 2010 at 5:49 AM, Chris Colman chr...@stepaheadsoftware.comwrote: Search the list for this and you'll find some quite long discussions. Basically, it's not going to happen. This would be multiple inheritance, not single. Hi Jeremy, I hope I don't sound confrontationalist when I say this but this is clearly not a case of multiple inheritance. For this request to be deemed to be multiple inheritance one class/markup file would need to be inheriting from two separate super classes/markup files. That is not what is requested here. There remains only a single super class/markup file. All that is requested here is for multiple markup sections to be overridden in this single inheritance scenario - just like Java does not restrict you to overriding only a single method in any Java class: You can override as many methods as you like in a Java class but that does not break Java's single inheritance model - which constrains the number of base classes to ONE, not the number of methods you can override to ONE. All this user (and others before him) are asking is for wicket to support the overriding of N markup sections without instead of the arbitrarily imposed constraint of N = 1. Jeremy Thomerson -- sent from my smartphone - please excuse formatting and spelling errors On Jul 5, 2010 12:41 AM, Arjun Dhar dhar...@yahoo.com wrote: Hi, all the examples etc suggest that Single inheritence is possible but I cant break it up. The break up is essential when you want to merge common parts of your MARKUP with multiple specific parts of the Child page. Example: HTML HEADtitleBASE TEMPLATE / PARENT PAGE/title/HEAD BODY wicket:child / br / h2Some other Html common/h2 wicket:child / /BODY /HTML --- HTML HEADtitleCHILD PAGE 1/title/HEAD BODY wicket:extend Part 1 specific to Child Page /wicket:extend Any HTML here can be ignored as conceptually anyway what appears in extend is what should be rendered from a child page. wicket:extend Part 2 Specific to Child Page (will appear after common HTML in parent page) /wicket:extend /BODY /HTML I tried this, only the first part renders. I'm wondering if we can add such capability. Conceptually I don't see why not. If already possible do let me know or consider as a feature request?! -Thanks Arjun -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Single-inheritence-in-parts- tp2278064p2278064.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Single inheritence in parts
Use a pre render listener to call your render method. The constructor stuff is pretty bad though. If you have the listener look for the @PostConstruct annotation it even looks like its supposed to work that way. imo if multiple markup section inheritance were implemented you would really limit how your allowed to use the framework. As it is its simple (ignoring constructor/rendering pains) and in your control not the frameworks. On Thu, Jul 8, 2010 at 5:23 PM, James Carman ja...@carmanconsulting.comwrote: And, this method doesn't really work very well either. You can't reliably call those abstract methods from the superclass' constructor. On Thu, Jul 8, 2010 at 2:47 PM, Chris Colman chr...@stepaheadsoftware.com wrote: class Page extends Page { abstract Component getPart1(); abstract Component getPart2(); } html div wicket:id=id4part1 / wicket:child / div wicket:id=id4part2 / That's the component based workaround that I mentioned which IMHO isn't really the pure markup OO solution we're proposing. I'm hoping for true markup inheritance that supports multiple overridable sections that doesn't mandate a Java side coding change each time a markup editor adds or removes a particular overridable section. On Thu, Jul 8, 2010 at 5:49 AM, Chris Colman chr...@stepaheadsoftware.comwrote: Search the list for this and you'll find some quite long discussions. Basically, it's not going to happen. This would be multiple inheritance, not single. Hi Jeremy, I hope I don't sound confrontationalist when I say this but this is clearly not a case of multiple inheritance. For this request to be deemed to be multiple inheritance one class/markup file would need to be inheriting from two separate super classes/markup files. That is not what is requested here. There remains only a single super class/markup file. All that is requested here is for multiple markup sections to be overridden in this single inheritance scenario - just like Java does not restrict you to overriding only a single method in any Java class: You can override as many methods as you like in a Java class but that does not break Java's single inheritance model - which constrains the number of base classes to ONE, not the number of methods you can override to ONE. All this user (and others before him) are asking is for wicket to support the overriding of N markup sections without instead of the arbitrarily imposed constraint of N = 1. Jeremy Thomerson -- sent from my smartphone - please excuse formatting and spelling errors On Jul 5, 2010 12:41 AM, Arjun Dhar dhar...@yahoo.com wrote: Hi, all the examples etc suggest that Single inheritence is possible but I cant break it up. The break up is essential when you want to merge common parts of your MARKUP with multiple specific parts of the Child page. Example: HTML HEADtitleBASE TEMPLATE / PARENT PAGE/title/HEAD BODY wicket:child / br / h2Some other Html common/h2 wicket:child / /BODY /HTML --- HTML HEADtitleCHILD PAGE 1/title/HEAD BODY wicket:extend Part 1 specific to Child Page /wicket:extend Any HTML here can be ignored as conceptually anyway what appears in extend is what should be rendered from a child page. wicket:extend Part 2 Specific to Child Page (will appear after common HTML in parent page) /wicket:extend /BODY /HTML I tried this, only the first part renders. I'm wondering if we can add such capability. Conceptually I don't see why not. If already possible do let me know or consider as a feature request?! -Thanks Arjun -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Single-inheritence-in-parts- tp2278064p2278064.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Single inheritence in parts
Right, it's doable, but there's a bit of homework you have to do to make sure it all works correctly. You have to solve the whole onFirstRender problem in a reliable way. Our base page has an overridable onFirstRender() method that subclasses can override if they wish to do this sort of initialization. I like the onInitialize() method name better, though. On Thu, Jul 8, 2010 at 5:29 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote: class Page extends Page { abstract Component getPart1(String id); abstract Component getPart2(String id); onBeforeRender() { if (get(part1)==null) { add(getPart1(part1)); } if (get(part2)==null) { add(getPart2(part1)); } }} in 1.5 it would be done like this class Page extends Page { abstract Component getPart1(String id); abstract Component getPart2(String id); onInitialize() { add(getPart1(part1)); add(getPart2(part1)); }} -igor On Thu, Jul 8, 2010 at 2:23 PM, James Carman ja...@carmanconsulting.com wrote: And, this method doesn't really work very well either. You can't reliably call those abstract methods from the superclass' constructor. On Thu, Jul 8, 2010 at 2:47 PM, Chris Colman chr...@stepaheadsoftware.com wrote: class Page extends Page { abstract Component getPart1(); abstract Component getPart2(); } html div wicket:id=id4part1 / wicket:child / div wicket:id=id4part2 / That's the component based workaround that I mentioned which IMHO isn't really the pure markup OO solution we're proposing. I'm hoping for true markup inheritance that supports multiple overridable sections that doesn't mandate a Java side coding change each time a markup editor adds or removes a particular overridable section. On Thu, Jul 8, 2010 at 5:49 AM, Chris Colman chr...@stepaheadsoftware.comwrote: Search the list for this and you'll find some quite long discussions. Basically, it's not going to happen. This would be multiple inheritance, not single. Hi Jeremy, I hope I don't sound confrontationalist when I say this but this is clearly not a case of multiple inheritance. For this request to be deemed to be multiple inheritance one class/markup file would need to be inheriting from two separate super classes/markup files. That is not what is requested here. There remains only a single super class/markup file. All that is requested here is for multiple markup sections to be overridden in this single inheritance scenario - just like Java does not restrict you to overriding only a single method in any Java class: You can override as many methods as you like in a Java class but that does not break Java's single inheritance model - which constrains the number of base classes to ONE, not the number of methods you can override to ONE. All this user (and others before him) are asking is for wicket to support the overriding of N markup sections without instead of the arbitrarily imposed constraint of N = 1. Jeremy Thomerson -- sent from my smartphone - please excuse formatting and spelling errors On Jul 5, 2010 12:41 AM, Arjun Dhar dhar...@yahoo.com wrote: Hi, all the examples etc suggest that Single inheritence is possible but I cant break it up. The break up is essential when you want to merge common parts of your MARKUP with multiple specific parts of the Child page. Example: HTML HEADtitleBASE TEMPLATE / PARENT PAGE/title/HEAD BODY wicket:child / br / h2Some other Html common/h2 wicket:child / /BODY /HTML --- HTML HEADtitleCHILD PAGE 1/title/HEAD BODY wicket:extend Part 1 specific to Child Page /wicket:extend Any HTML here can be ignored as conceptually anyway what appears in extend is what should be rendered from a child page. wicket:extend Part 2 Specific to Child Page (will appear after common HTML in parent page) /wicket:extend /BODY /HTML I tried this, only the first part renders. I'm wondering if we can add such capability. Conceptually I don't see why not. If already possible do let me know or consider as a feature request?! -Thanks Arjun -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Single-inheritence-in-parts- tp2278064p2278064.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands,
Re: Single inheritence in parts
Right, well put then. :) On Thu, Jul 8, 2010 at 5:41 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote: my point was simply that it is trivial to solve, it has a well known solution, and this is not the only usecase where it applies. you will need to do your homework no matter which way you go. -igor On Thu, Jul 8, 2010 at 2:35 PM, James Carman ja...@carmanconsulting.com wrote: Right, it's doable, but there's a bit of homework you have to do to make sure it all works correctly. You have to solve the whole onFirstRender problem in a reliable way. Our base page has an overridable onFirstRender() method that subclasses can override if they wish to do this sort of initialization. I like the onInitialize() method name better, though. On Thu, Jul 8, 2010 at 5:29 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote: class Page extends Page { abstract Component getPart1(String id); abstract Component getPart2(String id); onBeforeRender() { if (get(part1)==null) { add(getPart1(part1)); } if (get(part2)==null) { add(getPart2(part1)); } }} in 1.5 it would be done like this class Page extends Page { abstract Component getPart1(String id); abstract Component getPart2(String id); onInitialize() { add(getPart1(part1)); add(getPart2(part1)); }} -igor On Thu, Jul 8, 2010 at 2:23 PM, James Carman ja...@carmanconsulting.com wrote: And, this method doesn't really work very well either. You can't reliably call those abstract methods from the superclass' constructor. On Thu, Jul 8, 2010 at 2:47 PM, Chris Colman chr...@stepaheadsoftware.com wrote: class Page extends Page { abstract Component getPart1(); abstract Component getPart2(); } html div wicket:id=id4part1 / wicket:child / div wicket:id=id4part2 / That's the component based workaround that I mentioned which IMHO isn't really the pure markup OO solution we're proposing. I'm hoping for true markup inheritance that supports multiple overridable sections that doesn't mandate a Java side coding change each time a markup editor adds or removes a particular overridable section. On Thu, Jul 8, 2010 at 5:49 AM, Chris Colman chr...@stepaheadsoftware.comwrote: Search the list for this and you'll find some quite long discussions. Basically, it's not going to happen. This would be multiple inheritance, not single. Hi Jeremy, I hope I don't sound confrontationalist when I say this but this is clearly not a case of multiple inheritance. For this request to be deemed to be multiple inheritance one class/markup file would need to be inheriting from two separate super classes/markup files. That is not what is requested here. There remains only a single super class/markup file. All that is requested here is for multiple markup sections to be overridden in this single inheritance scenario - just like Java does not restrict you to overriding only a single method in any Java class: You can override as many methods as you like in a Java class but that does not break Java's single inheritance model - which constrains the number of base classes to ONE, not the number of methods you can override to ONE. All this user (and others before him) are asking is for wicket to support the overriding of N markup sections without instead of the arbitrarily imposed constraint of N = 1. Jeremy Thomerson -- sent from my smartphone - please excuse formatting and spelling errors On Jul 5, 2010 12:41 AM, Arjun Dhar dhar...@yahoo.com wrote: Hi, all the examples etc suggest that Single inheritence is possible but I cant break it up. The break up is essential when you want to merge common parts of your MARKUP with multiple specific parts of the Child page. Example: HTML HEADtitleBASE TEMPLATE / PARENT PAGE/title/HEAD BODY wicket:child / br / h2Some other Html common/h2 wicket:child / /BODY /HTML --- HTML HEADtitleCHILD PAGE 1/title/HEAD BODY wicket:extend Part 1 specific to Child Page /wicket:extend Any HTML here can be ignored as conceptually anyway what appears in extend is what should be rendered from a child page. wicket:extend Part 2 Specific to Child Page (will appear after common HTML in parent page) /wicket:extend /BODY /HTML I tried this, only the first part renders. I'm wondering if we can add such capability. Conceptually I don't see why not. If already possible do let me know or consider as a feature request?! -Thanks Arjun -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Single-inheritence-in-parts- tp2278064p2278064.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands,
Re: Single inheritence in parts
I must have been listening to the wrong people then. Sorry to continue any false hopes. Too bad; there is only a small sweet spot for markup inheritance, but with this extension it would be very sweet indeed. Thanks for the link Jeremy. Regards, Erik. On 06-07-10 22:08, Jeremy Thomerson wrote: It has not been promised. It has been disCUSSed at length. Here's the most relevant thread I remember. Look at some of the very valid points of why it would create problems from Johan / Igor. Personally, I'm against it. You can *very easily* accomplish the same thing with panels, without a whole mess of other issues. http://bit.ly/awiK6L -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Single inheritence in parts
Indeed, multiple inheritance is not the correct term in this case. The point is that the parent class' markup may contain multiple places to place components from sub-classes. Regards, Erik. Op 06-07-10 18:03, Arjun Dhar wrote: On a last note; ..am confusedmultiple inheritance generally means MANY PARENT, ONE CHILD (child inherits from multiple parents). Here there is only ONE PARENT MARKUP required and ONE CHILD markup. Maybe my perspective is not right. I'll search more material on this and educate myself. -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Single inheritence in parts
I meant wish list. Mornings after a sleepless night are not easy... Ernesto On Tue, Jul 6, 2010 at 7:53 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Hi Jeremy, Wasn't this on the which list for 1.5? [1] and [2]? Cheers, Ernesto 1-https://cwiki.apache.org/WICKET/wicket-15-wish-list.html#Wicket1.5WishList-multiplychild%252Fextendinheritance 2-https://issues.apache.org/jira/browse/WICKET-1134 On Tue, Jul 6, 2010 at 7:37 AM, Jeremy Thomerson jer...@wickettraining.com wrote: Search the list for this and you'll find some quite long discussions. Basically, it's not going to happen. This would be multiple inheritance, not single. You can easily use panels to accomplish what you're looking for. Jeremy Thomerson -- sent from my smartphone - please excuse formatting and spelling errors On Jul 5, 2010 12:41 AM, Arjun Dhar dhar...@yahoo.com wrote: Hi, all the examples etc suggest that Single inheritence is possible but I cant break it up. The break up is essential when you want to merge common parts of your MARKUP with multiple specific parts of the Child page. Example: HTML HEADtitleBASE TEMPLATE / PARENT PAGE/title/HEAD BODY wicket:child / br / h2Some other Html common/h2 wicket:child / /BODY /HTML --- HTML HEADtitleCHILD PAGE 1/title/HEAD BODY wicket:extend Part 1 specific to Child Page /wicket:extend Any HTML here can be ignored as conceptually anyway what appears in extend is what should be rendered from a child page. wicket:extend Part 2 Specific to Child Page (will appear after common HTML in parent page) /wicket:extend /BODY /HTML I tried this, only the first part renders. I'm wondering if we can add such capability. Conceptually I don't see why not. If already possible do let me know or consider as a feature request?! -Thanks Arjun -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Single-inheritence-in-parts-tp2278064p2278064.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Single inheritence in parts
Yes, this has been promised many times. And I am looking forward to it :) Regards, Erik. Op 06-07-10 07:53, Ernesto Reinaldo Barreiro wrote: Hi Jeremy, Wasn't this on the which list for 1.5? [1] and [2]? Cheers, Ernesto 1-https://cwiki.apache.org/WICKET/wicket-15-wish-list.html#Wicket1.5WishList-multiplychild%252Fextendinheritance 2-https://issues.apache.org/jira/browse/WICKET-1134 -- Sent from my SMTP compliant software Erik van Oosten http://day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Single inheritence in parts
cool ..something to look forward to (in response to other posts) FYI I tried panel it requires some code to be written, not very clean. (opposed pure markup based approach) On a last note; ..am confusedmultiple inheritance generally means MANY PARENT, ONE CHILD (child inherits from multiple parents). Here there is only ONE PARENT MARKUP required and ONE CHILD markup. Maybe my perspective is not right. I'll search more material on this and educate myself. thanks a lot -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Single-inheritence-in-parts-tp2278064p2279786.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Single inheritence in parts
On Tue, Jul 6, 2010 at 4:38 AM, Erik van Oosten e.vanoos...@grons.nlwrote: Yes, this has been promised many times. And I am looking forward to it :) Regards, Erik. Op 06-07-10 07:53, Ernesto Reinaldo Barreiro wrote: Hi Jeremy, Wasn't this on the which list for 1.5? [1] and [2]? Cheers, Ernesto 1- https://cwiki.apache.org/WICKET/wicket-15-wish-list.html#Wicket1.5WishList-multiplychild%252Fextendinheritance 2-https://issues.apache.org/jira/browse/WICKET-1134 It has not been promised. It has been disCUSSed at length. Here's the most relevant thread I remember. Look at some of the very valid points of why it would create problems from Johan / Igor. Personally, I'm against it. You can *very easily* accomplish the same thing with panels, without a whole mess of other issues. http://bit.ly/awiK6L -- Jeremy Thomerson http://www.wickettraining.com
Re: Single inheritence in parts
Search the list for this and you'll find some quite long discussions. Basically, it's not going to happen. This would be multiple inheritance, not single. You can easily use panels to accomplish what you're looking for. Jeremy Thomerson -- sent from my smartphone - please excuse formatting and spelling errors On Jul 5, 2010 12:41 AM, Arjun Dhar dhar...@yahoo.com wrote: Hi, all the examples etc suggest that Single inheritence is possible but I cant break it up. The break up is essential when you want to merge common parts of your MARKUP with multiple specific parts of the Child page. Example: HTML HEADtitleBASE TEMPLATE / PARENT PAGE/title/HEAD BODY wicket:child / br / h2Some other Html common/h2 wicket:child / /BODY /HTML --- HTML HEADtitleCHILD PAGE 1/title/HEAD BODY wicket:extend Part 1 specific to Child Page /wicket:extend Any HTML here can be ignored as conceptually anyway what appears in extend is what should be rendered from a child page. wicket:extend Part 2 Specific to Child Page (will appear after common HTML in parent page) /wicket:extend /BODY /HTML I tried this, only the first part renders. I'm wondering if we can add such capability. Conceptually I don't see why not. If already possible do let me know or consider as a feature request?! -Thanks Arjun -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Single-inheritence-in-parts-tp2278064p2278064.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Single inheritence in parts
Hi Jeremy, Wasn't this on the which list for 1.5? [1] and [2]? Cheers, Ernesto 1-https://cwiki.apache.org/WICKET/wicket-15-wish-list.html#Wicket1.5WishList-multiplychild%252Fextendinheritance 2-https://issues.apache.org/jira/browse/WICKET-1134 On Tue, Jul 6, 2010 at 7:37 AM, Jeremy Thomerson jer...@wickettraining.com wrote: Search the list for this and you'll find some quite long discussions. Basically, it's not going to happen. This would be multiple inheritance, not single. You can easily use panels to accomplish what you're looking for. Jeremy Thomerson -- sent from my smartphone - please excuse formatting and spelling errors On Jul 5, 2010 12:41 AM, Arjun Dhar dhar...@yahoo.com wrote: Hi, all the examples etc suggest that Single inheritence is possible but I cant break it up. The break up is essential when you want to merge common parts of your MARKUP with multiple specific parts of the Child page. Example: HTML HEADtitleBASE TEMPLATE / PARENT PAGE/title/HEAD BODY wicket:child / br / h2Some other Html common/h2 wicket:child / /BODY /HTML --- HTML HEADtitleCHILD PAGE 1/title/HEAD BODY wicket:extend Part 1 specific to Child Page /wicket:extend Any HTML here can be ignored as conceptually anyway what appears in extend is what should be rendered from a child page. wicket:extend Part 2 Specific to Child Page (will appear after common HTML in parent page) /wicket:extend /BODY /HTML I tried this, only the first part renders. I'm wondering if we can add such capability. Conceptually I don't see why not. If already possible do let me know or consider as a feature request?! -Thanks Arjun -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Single-inheritence-in-parts-tp2278064p2278064.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org