Re: Alternative method to initialise page

2008-04-30 Thread Johan Compagner
://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16975470.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: Alternative method to initialise page

2008-04-30 Thread John Patterson
or return page. igor.vaynberg wrote: heh, even though we switched to int we are pretty close to running out of flag bits already :) but oh well :) -igor -- View this message in context: http://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16975470.html Sent

Re: Alternative method to initialise page

2008-04-29 Thread John Patterson
in context: http://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16959612.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands

Re: Alternative method to initialise page

2008-04-29 Thread John Patterson
problems or more work for the more standard usecases or anti-patterns. Exactly why each use should not be left wondering how to approach the problem themselves - if they even recognise it as a problem. John -- View this message in context: http://www.nabble.com/Alternative-method

Re: Alternative method to initialise page

2008-04-29 Thread James Carman
. Exactly why each use should not be left wondering how to approach the problem themselves - if they even recognise it as a problem. John -- View this message in context: http://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16959612.html Sent from the Wicket - User

Re: Alternative method to initialise page

2008-04-29 Thread James Carman
-- View this message in context: http://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16959612.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail

Re: Alternative method to initialise page

2008-04-29 Thread John Patterson
factory methods? jwcarman wrote: Would you like me to add something like this to the wiki? // The interface... public interface IBeforeFirstRenderListener { public void onBeforeFirstRender(); } -- View this message in context: http://www.nabble.com/Alternative-method-to-initialise

Re: Alternative method to initialise page

2008-04-29 Thread Johan Compagner
First i dont want a boolen in the components that onFirstRender() is called. I want a boolean that it is not called. So in the constructor of component we set the flag and clear it when first rendered. Do remember that in onBeforeRende components/panels and all can be created again but i think

Re: Alternative method to initialise page

2008-04-29 Thread James Carman
On Tue, Apr 29, 2008 at 3:59 PM, Johan Compagner [EMAIL PROTECTED] wrote: First i dont want a boolen in the components that onFirstRender() is called. I want a boolean that it is not called. So in the constructor of component we set the flag and clear it when first rendered. Are we thinking

Re: Alternative method to initialise page

2008-04-29 Thread Johan Compagner
I am just saying if we make such a thing, that i dont want state after the fact in a components. But i guess we can then better use a bit i think we have a few left. On 4/30/08, James Carman [EMAIL PROTECTED] wrote: On Tue, Apr 29, 2008 at 3:59 PM, Johan Compagner [EMAIL PROTECTED] wrote:

Re: Alternative method to initialise page

2008-04-29 Thread Igor Vaynberg
heh, even though we switched to int we are pretty close to running out of flag bits already :) but oh well :) -igor On Tue, Apr 29, 2008 at 7:07 PM, Johan Compagner [EMAIL PROTECTED] wrote: I am just saying if we make such a thing, that i dont want state after the fact in a components.

Re: Alternative method to initialise page

2008-04-29 Thread John Patterson
wrote: heh, even though we switched to int we are pretty close to running out of flag bits already :) but oh well :) -igor -- View this message in context: http://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16975470.html Sent from the Wicket - User mailing list archive

Re: Alternative method to initialise page

2008-04-28 Thread Maurice Marrink
usecases or anti-patterns. John -- View this message in context: http://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16918361.html Sent from the Wicket - User mailing list archive at Nabble.com

Re: Alternative method to initialise page

2008-04-28 Thread James Carman
On Mon, Apr 28, 2008 at 5:57 AM, James Carman [EMAIL PROTECTED] wrote: On Sat, Apr 26, 2008 at 4:55 PM, Maurice Marrink [EMAIL PROTECTED] wrote: Such an initialize method can easily be done by users them self with a simple factory pattern. So why bloat our api with it? Could one come

Re: Alternative method to initialise page

2008-04-28 Thread Uwe Schäfer
James Carman schrieb: Or, perhaps Wicket could add in some lifecycle method annotations? pleeease don´t! using annotations for this kind of lifecycle methods is a simple abuse of them. non-obvious order, inheritance etc... lesson learned from jpa,ejb3 etc... cu uwe -- THOMAS DAILY

Re: Alternative method to initialise page

2008-04-28 Thread James Carman
On Sat, Apr 26, 2008 at 4:55 PM, Maurice Marrink [EMAIL PROTECTED] wrote: Such an initialize method can easily be done by users them self with a simple factory pattern. So why bloat our api with it? Could one come up with their own interface which means they want delayed intialization and use

Re: Alternative method to initialise page

2008-04-28 Thread James Carman
On Mon, Apr 28, 2008 at 6:27 AM, James Carman [EMAIL PROTECTED] wrote: Yes, this would involve making up some rules about the order in which the parent class' initializer methods are invoked. A couple that come to mind: 1. There should only be one initializer method declared per class

Re: Alternative method to initialise page

2008-04-28 Thread Maurice Marrink
How well did you test this? Because i think the biggest problem here is that the IComponentInstantiationListener is invoked in the constructor of Component and thus before any childclass constructor has run. Maurice On Mon, Apr 28, 2008 at 1:42 PM, James Carman [EMAIL PROTECTED] wrote: On Mon,

Re: Alternative method to initialise page

2008-04-28 Thread James Carman
On Mon, Apr 28, 2008 at 7:58 AM, Maurice Marrink [EMAIL PROTECTED] wrote: How well did you test this? Only whipped it up very quickly (based on obviously wrong assumptions :). Because i think the biggest problem here is that the IComponentInstantiationListener is invoked in the constructor

Re: Alternative method to initialise page

2008-04-28 Thread Maurice Marrink
On Mon, Apr 28, 2008 at 2:15 PM, James Carman [EMAIL PROTECTED] wrote: On Mon, Apr 28, 2008 at 7:58 AM, Maurice Marrink [EMAIL PROTECTED] wrote: How well did you test this? Only whipped it up very quickly (based on obviously wrong assumptions :). Because i think the biggest problem

Re: Alternative method to initialise page

2008-04-28 Thread James Carman
On Mon, Apr 28, 2008 at 8:31 AM, Maurice Marrink [EMAIL PROTECTED] wrote: Oh! Nasty. I thought you guys were somehow waiting until the Component was fully instantiated for this notification to occur. If Nope. One of the places where this is used, is for security

Re: Alternative method to initialise page

2008-04-28 Thread Igor Vaynberg
springbean is ok. although bends the rule rather then breaking it by not depending on any state of the super class. if we did it the other way then the dependencies would be null during the constructor call, which is obviously something we want to avoid. -igor On Mon, Apr 28, 2008 at 6:22 AM,

Re: Alternative method to initialise page

2008-04-28 Thread Igor Vaynberg
2008/4/28 Uwe Schäfer [EMAIL PROTECTED]: James Carman schrieb: Or, perhaps Wicket could add in some lifecycle method annotations? pleeease don´t! using annotations for this kind of lifecycle methods is a simple abuse of them. non-obvious order, inheritance etc... lesson learned

Re: Alternative method to initialise page

2008-04-28 Thread James Carman
On Mon, Apr 28, 2008 at 10:58 AM, Igor Vaynberg [EMAIL PROTECTED] wrote: 2008/4/28 Uwe Schäfer [EMAIL PROTECTED]: James Carman schrieb: Or, perhaps Wicket could add in some lifecycle method annotations? pleeease don´t! using annotations for this kind of

Re: Alternative method to initialise page

2008-04-28 Thread Igor Vaynberg
you can roll that, just use the beforerenderlistener you can install in the application subclass. -igor On Mon, Apr 28, 2008 at 8:03 AM, James Carman [EMAIL PROTECTED] wrote: On Mon, Apr 28, 2008 at 10:58 AM, Igor Vaynberg [EMAIL PROTECTED] wrote: 2008/4/28 Uwe Schäfer [EMAIL PROTECTED]:

Re: Alternative method to initialise page

2008-04-28 Thread James Carman
On Mon, Apr 28, 2008 at 11:05 AM, Igor Vaynberg [EMAIL PROTECTED] wrote: you can roll that, just use the beforerenderlistener you can install in the application subclass. We just have to make sure we only initialize an instance one time. The IComponentOnBeforeRenderListeners are called every

Re: Alternative method to initialise page

2008-04-28 Thread Igor Vaynberg
yes of course. you have to keep a boolean in the metadata to mark if the handler has been called already. -igor On Mon, Apr 28, 2008 at 8:12 AM, James Carman [EMAIL PROTECTED] wrote: On Mon, Apr 28, 2008 at 11:05 AM, Igor Vaynberg [EMAIL PROTECTED] wrote: you can roll that, just use the

Re: Alternative method to initialise page

2008-04-28 Thread James Carman
On Mon, Apr 28, 2008 at 11:45 AM, Igor Vaynberg [EMAIL PROTECTED] wrote: yes of course. you have to keep a boolean in the metadata to mark if the handler has been called already. Ok, gotcha! I need to keep that metadata stuff in my head. That's a nifty little trick for adding ad-hoc

Re: Alternative method to initialise page

2008-04-27 Thread Igor Vaynberg
/Alternative-method-to-initialise-page-tp16742636p16918361.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED

Re: Alternative method to initialise page

2008-04-27 Thread Stefan Simik
PagingNavigation so I had to copy-paste it and change some minor parts of the class. But it was very easy and I take the default implementations as an example how to work with them. SS -- View this message in context: http://www.nabble.com/Alternative-method-to-initialise-page

Re: Alternative method to initialise page

2008-04-27 Thread John Krasnay
On Sat, Apr 26, 2008 at 01:58:28PM -0700, John Patterson wrote: Note to self: don't post messages when half cut. But I have to break that rule just one more time Heh, no problem. Been there once or twice myself... jk - To

Re: Alternative method to initialise page

2008-04-26 Thread John Patterson
() is called from the base class -- View this message in context: http://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16742891.html Sent from the Wicket - User mailing list archive at Nabble.com

Re: Alternative method to initialise page

2008-04-26 Thread Martijn Dashorst
MyCustomisedCompopnent(_parameter.getSomething()); } } So _parameter will always be null when overrideToCreateCustomComponent() is called from the base class -- View this message in context: http://www.nabble.com/Alternative-method-to-initialise-page

Re: Alternative method to initialise page

2008-04-26 Thread John Patterson
: http://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16742891.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED

Re: Alternative method to initialise page

2008-04-26 Thread Martijn Dashorst
the base class -- View this message in context: http://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16742891.html Sent from the Wicket - User mailing list archive at Nabble.com

Re: Alternative method to initialise page

2008-04-26 Thread John Patterson
://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16911887.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: Alternative method to initialise page

2008-04-26 Thread John Patterson
to use in the component (as PagingNavigation allows) -- View this message in context: http://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16912100.html Sent from the Wicket - User mailing list archive at Nabble.com

Re: Alternative method to initialise page

2008-04-26 Thread John Krasnay
On Sat, Apr 26, 2008 at 04:46:11AM -0700, John Patterson wrote: John Krasnay wrote: This rule is too strict. Another way to avoid calling overridable methods from the constructor is to use a model: Models are fine for providing dynamic values but do not help you customise

Re: Alternative method to initialise page

2008-04-26 Thread Uwe Schäfer
John Patterson schrieb: Thanks. So is this the way we should build all components that could be extended? If so, how about adding an initialisation hook to avoid this problem and the need to call super.onBeforeRender() (which I forgot recently and took me a while to find)... and also to give

Re: Alternative method to initialise page

2008-04-26 Thread Igor Vaynberg
On Sat, Apr 26, 2008 at 4:17 AM, John Patterson [EMAIL PROTECTED] wrote: Sorry, I did find a discussion which was related [1] which ended with Igor saying: yes, but its also easy to fix. Just don't call any overridible methods inside constructors. And for everything else there is

Re: Alternative method to initialise page

2008-04-26 Thread Johan Compagner
We shouldnt call it onInitialize, onFirstRender is fine, onInitialize looks like a really after constructor call to me, but it is called much later, if it is called (onvisible checks and so on) On 4/26/08, Igor Vaynberg [EMAIL PROTECTED] wrote: On Sat, Apr 26, 2008 at 4:17 AM, John Patterson

Re: Alternative method to initialise page

2008-04-26 Thread Igor Vaynberg
onBeforeFirstRender() ? , onFirstRender() is ambiguous with its relation to onbeforerender() -igor On Sat, Apr 26, 2008 at 9:35 AM, Johan Compagner [EMAIL PROTECTED] wrote: We shouldnt call it onInitialize, onFirstRender is fine, onInitialize looks like a really after constructor call to me,

Re: Alternative method to initialise page

2008-04-26 Thread John Patterson
onBeforeFirstRender() or onPageSetup() is called only once and before rendering. -- View this message in context: http://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16916018.html Sent from the Wicket - User mailing list archive at Nabble.com

Re: Alternative method to initialise page

2008-04-26 Thread Maurice Marrink
relative to onBeforeRender()? Isn't it enough to say onBeforeFirstRender() or onPageSetup() is called only once and before rendering. -- View this message in context: http://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16916018.html Sent from the Wicket - User mailing list

Re: Alternative method to initialise page

2008-04-26 Thread John Patterson
that rule just one more time -- View this message in context: http://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16917444.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe

Re: Alternative method to initialise page

2008-04-26 Thread John Patterson
about the component not being rendered if it is not visible? That is already the case with onBeforeRender(). How is this any more confusing? -- View this message in context: http://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16917466.html Sent from the Wicket - User mailing

Re: Alternative method to initialise page

2008-04-26 Thread John Patterson
better - especially if this is a common pattern. John -- View this message in context: http://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16918361.html Sent from the Wicket - User mailing list archive at Nabble.com

Alternative method to initialise page

2008-04-17 Thread John Patterson
. Or is there already a method that should be used to do this? Thanks, John -- View this message in context: http://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16742636.html Sent from the Wicket - User mailing list archive at Nabble.com

Re: Alternative method to initialise page

2008-04-17 Thread John Patterson
-- View this message in context: http://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16742891.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED

Re: Alternative method to initialise page

2008-04-17 Thread Maurice Marrink
overrideToCreateCustomComponent() is called from the base class -- View this message in context: http://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16742891.html Sent from the Wicket - User mailing list archive at Nabble.com

Re: Alternative method to initialise page

2008-04-17 Thread Igor Vaynberg
be null when overrideToCreateCustomComponent() is called from the base class -- View this message in context: http://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16742891.html Sent from the Wicket - User mailing list archive at Nabble.com