the cons of this have already been discussed in this thread. see the
"onWire" messages.

-igor


On 3/12/07, Rüdiger Schulz <[EMAIL PROTECTED]> wrote:

Hm, that looks good!

What would any of the Wicket developers say to that approach? Is there
some hidden catch waiting to happen, or this ok?

I'm not sure if a behaviour like that should end up in Wicket core (e.g.
a method Component#onFirstAttach()), but I think I'll use that in some
of my components.

ChuckDeal schrieb:
> I had also hoped that the new Constructor in 2.0 would have been useful.
> But, I have been using the following solution in 1.2 / 1.3 to overcome
not
> having the parent at Component construction time.  Then, all of my
Panels
> extend this Panel instead of the core Panel.  It has been working for me
for
> quite some time.
>
> Chuck
>
> public abstract class InitializablePanel extends Panel {
>       private boolean initialized;
>
>       /**
>        * Constructor for InitializablePanel
>        *
>        * @param id
>        */
>       public InitializablePanel(String id) {
>               super(id);
>
>               commonInit();
>       }
>
>       /**
>        * Constructor for InitializablePanel
>        *
>        * @param id
>        * @param model
>        */
>       public InitializablePanel(String id, IModel model) {
>               super(id, model);
>
>               commonInit();
>       }
>
>       /**
>        * commonInit
>        */
>       private void commonInit() {
>               initialized = false;
>       }
>
>       /**
>        * This method will be called by onAttach, therefore subclasses
>        * should override this method to create their components.
>        */
>       protected abstract void createComponents();
>
>       /**
>        * @see wicket.Component#onAttach()
>        */
>       @Override
>       protected void onAttach() {
>               if (!initialized) {
>                       createComponents();
>                       initialized = true;
>               }
>       }
>
>
>
> Rüdiger Schulz-3 wrote:
>> Same here, having rolled out a 1.2.3 project with no need for updating,
>> and currently in the final stages of a 1.2.5 project, which will
>> eventually update to 1.3 if it comes out. Never did any tests beyond
1.2.
>>
>> Regarding the constructor change:
>>
>> the 1.x way of compiling the hierarchie via add() methods was very
>> natural for me, as I have quite some experience in swing. Specifying
the
>> parent in the constructor always seemed odd to me; still I came across
>> some situations where it would have been useful to have it in the
>> constructor.
>>
>> What I once tried was to add all my components in onAttach() but that
>> didn't work of course (subcomponents were added again next request).
But
>> some common method in Component where that could be done *after* the
>> constructor would be cool (if that is somehow possible).
>>
>> What I was looking forward to in 2.x were mostly the Java 5 IModels and
>> so on, as I think this would make the code a lot more readable.
>>
>> Well, just my 2 cents here :)
>>
>>
>> Rüdiger
>>
>> Dipu schrieb:
>>> We are still using 1.2.1 and 1.2.5 for our production and near
production
>>> projects.
>>>
>>>
>>> Thanks
>>> Dipu
>>>
>>>
>>> ----- Original Message -----
>>> From: "Eelco Hillenius" <[EMAIL PROTECTED]>
>>> To: "Wicket User List" <[email protected]>
>>> Sent: Tuesday, March 06, 2007 10:12 PM
>>> Subject: [Wicket-user] IMPORTANT: your opinion on the constructor
change
>>> in2.0
>>>
>>>
>>>> Hi,
>>>>
>>>> We (Wicket's developers) are having some discussion over 1.3 vs 2.0
>>>> and how difficult it is as a nun-funded project to spend so much time
>>>> synchronizing the branches.
>>>>
>>>> A major issue in the discussion is that not everyone is convinced
>>>> anymore that the constructor change in 2.0 is for the better. There
>>>> are pros and cons for sure, but we want to get your opinion on this.
>>>>
>>>> Please help us out giving your opinion. We want to know:
>>>>
>>>> 1) Who uses 2.0 for serious projects?
>>>>
>>>> 2) What do you think of the constructor change? Do you prefer 1.3's
>>>> add style or 2.0's style of passing in the parent construction time.
>>>>
>>>> 3) If we would ever backtrack on the constructor change (*if*, don't
>>>> panic for now) how much trouble would that give you?
>>>>
>>>> Please don't be shy giving your opinion. This is an important issue
in
>>>> the future development of Wicket.
>>>>
>>>> Regards,
>>>>
>>>> Eelco
>>>>
>>>>
-------------------------------------------------------------------------
>>>> Take Surveys. Earn Cash. Influence the Future of IT
>>>> Join SourceForge.net's Techsay panel and you'll get the chance to
share
>>>> your
>>>> opinions on IT & business topics through brief surveys-and earn cash
>>>>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>>>> _______________________________________________
>>>> Wicket-user mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/wicket-user
>>>
>>>
-------------------------------------------------------------------------
>>> Take Surveys. Earn Cash. Influence the Future of IT
>>> Join SourceForge.net's Techsay panel and you'll get the chance to
share
>>> your
>>> opinions on IT & business topics through brief surveys-and earn cash
>>>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>>> _______________________________________________
>>> Wicket-user mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/wicket-user
>>>
>>>
>>
>>
-------------------------------------------------------------------------
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to share
>> your
>> opinions on IT & business topics through brief surveys-and earn cash
>>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>> _______________________________________________
>> Wicket-user mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/wicket-user
>>
>>
>


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to