Re: Wicket 1.5: Question (or feature request) afterOnInitialize()

2011-08-14 Thread armandoxxx
my fix was 



if someone needs it .. 

Regards

Armando 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Question-or-feature-request-afterOnInitialize-tp3732520p3743198.html
Sent from the Users forum 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: Wicket 1.5: Question (or feature request) afterOnInitialize()

2011-08-11 Thread Bruno Borges
Yes, now I understood. :-) Thanks

*Bruno Borges*
www.brunoborges.com.br
+55 21 76727099



On Fri, Aug 12, 2011 at 2:56 AM, armandoxxx wrote:

> @IGor: I figured it out .. no need for new features.
>
> @Bruno: if you cann onAfterInitialize() in onInitialize() you can't be sure
> all components on the page we're
>  initialized()
>
>
> Regards
>
> Armando
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Question-or-feature-request-afterOnInitialize-tp3732520p3738002.html
> Sent from the Users forum 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: Wicket 1.5: Question (or feature request) afterOnInitialize()

2011-08-11 Thread armandoxxx
@IGor: I figured it out .. no need for new features. 

@Bruno: if you cann onAfterInitialize() in onInitialize() you can't be sure
all components on the page we're 
 initialized()


Regards

Armando


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Question-or-feature-request-afterOnInitialize-tp3732520p3738002.html
Sent from the Users forum 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: Wicket 1.5: Question (or feature request) afterOnInitialize()

2011-08-11 Thread Bruno Borges
Isn't this correct?

onInitialize() {
  super.onInitialize();
  ... // whatever I put here would be the same as overriding
onAfterInitialize();
}

*Bruno Borges*
www.brunoborges.com.br
+55 21 76727099



On Thu, Aug 11, 2011 at 12:35 PM, Igor Vaynberg wrote:

> On Thu, Aug 11, 2011 at 4:35 AM, armandoxxx 
> wrote:
> > Igor: thank you for your reply and your solution. Could you please
> discuss
> > this case with other developers and let me know what they think?
>
> this is the place where the developers discuss things. if any of them
> want to chime in they are free to do so. this list is our main means
> of communication.
>
> > In my
> > opinion framework should make my job easier not force me to do
> workarounds
> > to get what I need. Just a thought.
>
> nothing i have shown you is a workaround, it is using extension points
> offered by the framework to layer in new functionality specific to
> your usecase.
>
> -igor
>
>
> >
> > Martin: thank you :D
> >
> > Kind regards
> >
> > Armando
> >
> > --
> > View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Question-or-feature-request-afterOnInitialize-tp3732520p3735601.html
> > Sent from the Users forum 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: Wicket 1.5: Question (or feature request) afterOnInitialize()

2011-08-11 Thread Igor Vaynberg
On Thu, Aug 11, 2011 at 4:35 AM, armandoxxx  wrote:
> Igor: thank you for your reply and your solution. Could you please discuss
> this case with other developers and let me know what they think?

this is the place where the developers discuss things. if any of them
want to chime in they are free to do so. this list is our main means
of communication.

> In my
> opinion framework should make my job easier not force me to do workarounds
> to get what I need. Just a thought.

nothing i have shown you is a workaround, it is using extension points
offered by the framework to layer in new functionality specific to
your usecase.

-igor


>
> Martin: thank you :D
>
> Kind regards
>
> Armando
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Question-or-feature-request-afterOnInitialize-tp3732520p3735601.html
> Sent from the Users forum 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: Wicket 1.5: Question (or feature request) afterOnInitialize()

2011-08-11 Thread armandoxxx
Igor: thank you for your reply and your solution. Could you please discuss
this case with other developers and let me know what they think? In my
opinion framework should make my job easier not force me to do workarounds
to get what I need. Just a thought. 

Martin: thank you :D 

Kind regards

Armando

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Question-or-feature-request-afterOnInitialize-tp3732520p3735601.html
Sent from the Users forum 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: Wicket 1.5: Question (or feature request) afterOnInitialize()

2011-08-10 Thread Martin Grigorov
Now I'm convinced we need onAfterInitialize() :-)

On Wed, Aug 10, 2011 at 8:42 PM, Igor Vaynberg  wrote:
> what if a component is added later during a panel swap?
>
> -igor
>
> On Wed, Aug 10, 2011 at 10:34 AM, Martin Grigorov  
> wrote:
>> That's why I put "MyPage.java:" above it.
>> I've never tried to make the page invisible :-)
>>
>> On Wed, Aug 10, 2011 at 8:32 PM, Igor Vaynberg  
>> wrote:
>>> this will get called more than once for a component that starts out
>>> and remains invisible for a while.
>>>
>>> -igor
>>>
>>>
>>> On Wed, Aug 10, 2011 at 10:25 AM, Martin Grigorov  
>>> wrote:
 MyPage.java:
 protected void onBeforeRender() {

        if (!hasBeenRendered()) {
            send(...);
        }

        super.onBeforeRender();
    }

 On Wed, Aug 10, 2011 at 8:18 PM, armandoxxx  
 wrote:
> @pedro I know. That's why I didn't put the event call in onInitialize()
> method ;)
>
> @martin: I if use on before render .. my event would be triggered 
> everytime
> my component renders .. so if I want 1 time event after the component is
> initialized I have to use somekind of a flag for this event to be called
> just once. So that's why I suggested afterInitialized() method ;)
>
> thank you guys for responses
>
> Regards
>
> Armando
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Question-or-feature-request-afterOnInitialize-tp3732520p3733649.html
> Sent from the Users forum 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
>
>



 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.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
>>>
>>>
>>
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.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
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket 1.5: Question (or feature request) afterOnInitialize()

2011-08-10 Thread Igor Vaynberg
what if a component is added later during a panel swap?

-igor

On Wed, Aug 10, 2011 at 10:34 AM, Martin Grigorov  wrote:
> That's why I put "MyPage.java:" above it.
> I've never tried to make the page invisible :-)
>
> On Wed, Aug 10, 2011 at 8:32 PM, Igor Vaynberg  
> wrote:
>> this will get called more than once for a component that starts out
>> and remains invisible for a while.
>>
>> -igor
>>
>>
>> On Wed, Aug 10, 2011 at 10:25 AM, Martin Grigorov  
>> wrote:
>>> MyPage.java:
>>> protected void onBeforeRender() {
>>>
>>>        if (!hasBeenRendered()) {
>>>            send(...);
>>>        }
>>>
>>>        super.onBeforeRender();
>>>    }
>>>
>>> On Wed, Aug 10, 2011 at 8:18 PM, armandoxxx  
>>> wrote:
 @pedro I know. That's why I didn't put the event call in onInitialize()
 method ;)

 @martin: I if use on before render .. my event would be triggered everytime
 my component renders .. so if I want 1 time event after the component is
 initialized I have to use somekind of a flag for this event to be called
 just once. So that's why I suggested afterInitialized() method ;)

 thank you guys for responses

 Regards

 Armando

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Question-or-feature-request-afterOnInitialize-tp3732520p3733649.html
 Sent from the Users forum 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


>>>
>>>
>>>
>>> --
>>> Martin Grigorov
>>> jWeekend
>>> Training, Consulting, Development
>>> http://jWeekend.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
>>
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.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: Wicket 1.5: Question (or feature request) afterOnInitialize()

2011-08-10 Thread Martin Grigorov
That's why I put "MyPage.java:" above it.
I've never tried to make the page invisible :-)

On Wed, Aug 10, 2011 at 8:32 PM, Igor Vaynberg  wrote:
> this will get called more than once for a component that starts out
> and remains invisible for a while.
>
> -igor
>
>
> On Wed, Aug 10, 2011 at 10:25 AM, Martin Grigorov  
> wrote:
>> MyPage.java:
>> protected void onBeforeRender() {
>>
>>        if (!hasBeenRendered()) {
>>            send(...);
>>        }
>>
>>        super.onBeforeRender();
>>    }
>>
>> On Wed, Aug 10, 2011 at 8:18 PM, armandoxxx  wrote:
>>> @pedro I know. That's why I didn't put the event call in onInitialize()
>>> method ;)
>>>
>>> @martin: I if use on before render .. my event would be triggered everytime
>>> my component renders .. so if I want 1 time event after the component is
>>> initialized I have to use somekind of a flag for this event to be called
>>> just once. So that's why I suggested afterInitialized() method ;)
>>>
>>> thank you guys for responses
>>>
>>> Regards
>>>
>>> Armando
>>>
>>> --
>>> View this message in context: 
>>> http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Question-or-feature-request-afterOnInitialize-tp3732520p3733649.html
>>> Sent from the Users forum 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
>>>
>>>
>>
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.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
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket 1.5: Question (or feature request) afterOnInitialize()

2011-08-10 Thread Igor Vaynberg
this will get called more than once for a component that starts out
and remains invisible for a while.

-igor


On Wed, Aug 10, 2011 at 10:25 AM, Martin Grigorov  wrote:
> MyPage.java:
> protected void onBeforeRender() {
>
>        if (!hasBeenRendered()) {
>            send(...);
>        }
>
>        super.onBeforeRender();
>    }
>
> On Wed, Aug 10, 2011 at 8:18 PM, armandoxxx  wrote:
>> @pedro I know. That's why I didn't put the event call in onInitialize()
>> method ;)
>>
>> @martin: I if use on before render .. my event would be triggered everytime
>> my component renders .. so if I want 1 time event after the component is
>> initialized I have to use somekind of a flag for this event to be called
>> just once. So that's why I suggested afterInitialized() method ;)
>>
>> thank you guys for responses
>>
>> Regards
>>
>> Armando
>>
>> --
>> View this message in context: 
>> http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Question-or-feature-request-afterOnInitialize-tp3732520p3733649.html
>> Sent from the Users forum 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
>>
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.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: Wicket 1.5: Question (or feature request) afterOnInitialize()

2011-08-10 Thread Martin Grigorov
MyPage.java:
protected void onBeforeRender() {

if (!hasBeenRendered()) {
send(...);
}

super.onBeforeRender();
}

On Wed, Aug 10, 2011 at 8:18 PM, armandoxxx  wrote:
> @pedro I know. That's why I didn't put the event call in onInitialize()
> method ;)
>
> @martin: I if use on before render .. my event would be triggered everytime
> my component renders .. so if I want 1 time event after the component is
> initialized I have to use somekind of a flag for this event to be called
> just once. So that's why I suggested afterInitialized() method ;)
>
> thank you guys for responses
>
> Regards
>
> Armando
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Question-or-feature-request-afterOnInitialize-tp3732520p3733649.html
> Sent from the Users forum 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
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket 1.5: Question (or feature request) afterOnInitialize()

2011-08-10 Thread Igor Vaynberg
we cant keep building these things because eventually someone will ask
for onAfterAfterInitialized() and so on. what we can do is make it
easy for you to build your own. you can create your own
IComponentOnBeforeRenderListener that checks if the component being
rendered is a page and if it is visits all the children and invokes
your callback if it hasnt been already invoked. you can keep track of
whether or not its been invoked by using component metadata.

-igor


On Wed, Aug 10, 2011 at 3:23 AM, armandoxxx  wrote:
> Hey guys ...
>
> With wicket 1.5 we got events. So far so good but I got a case where i'm
> missing after on initialize method call.
>
> I have lot's of panels on my page, and I create them in onInitialize() code.
> But I need to send a 1 time event after all components are initialized.
> - problem #1: If I send an event from onInitialize():  not sure that all
> components are initialized !
> - problem #2: If is send an event from onConfigure() or onBeforeRender(),
> the event get send everytime component is rendered ...
>
> So current solution is to create a flag in my panels that sendEventOnInit()
> method was allready called ..
>
> but it would be better  to have a method onInitialized() |
> afterInitialized() (pick your favorite name).
>
> If someone has better approach, please let me know about it !
>
> Kind regards
>
> Armando
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Question-or-feature-request-afterOnInitialize-tp3732520p3732520.html
> Sent from the Users forum 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: Wicket 1.5: Question (or feature request) afterOnInitialize()

2011-08-10 Thread armandoxxx
@pedro I know. That's why I didn't put the event call in onInitialize()
method ;)

@martin: I if use on before render .. my event would be triggered everytime
my component renders .. so if I want 1 time event after the component is
initialized I have to use somekind of a flag for this event to be called
just once. So that's why I suggested afterInitialized() method ;)

thank you guys for responses 

Regards 

Armando

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Question-or-feature-request-afterOnInitialize-tp3732520p3733649.html
Sent from the Users forum 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: Wicket 1.5: Question (or feature request) afterOnInitialize()

2011-08-10 Thread Martin Grigorov
You almost found it yourself.
Use onBeforeRender() + hasBeenRendered() instead of your custom flag.


On Wed, Aug 10, 2011 at 1:23 PM, armandoxxx  wrote:
> Hey guys ...
>
> With wicket 1.5 we got events. So far so good but I got a case where i'm
> missing after on initialize method call.
>
> I have lot's of panels on my page, and I create them in onInitialize() code.
> But I need to send a 1 time event after all components are initialized.
> - problem #1: If I send an event from onInitialize():  not sure that all
> components are initialized !
> - problem #2: If is send an event from onConfigure() or onBeforeRender(),
> the event get send everytime component is rendered ...
>
> So current solution is to create a flag in my panels that sendEventOnInit()
> method was allready called ..
>
> but it would be better  to have a method onInitialized() |
> afterInitialized() (pick your favorite name).
>
> If someone has better approach, please let me know about it !
>
> Kind regards
>
> Armando
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Question-or-feature-request-afterOnInitialize-tp3732520p3732520.html
> Sent from the Users forum 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
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket 1.5: Question (or feature request) afterOnInitialize()

2011-08-10 Thread Pedro Santos
Hi Armando, the problem #1 is rather about not have the entire
component tree connected already. onInitialize is called when the
component is aware of its path to page, at this moment, a triggered
even will not reach new nodes addition in the component tree.

On Wed, Aug 10, 2011 at 7:23 AM, armandoxxx  wrote:
> Hey guys ...
>
> With wicket 1.5 we got events. So far so good but I got a case where i'm
> missing after on initialize method call.
>
> I have lot's of panels on my page, and I create them in onInitialize() code.
> But I need to send a 1 time event after all components are initialized.
> - problem #1: If I send an event from onInitialize():  not sure that all
> components are initialized !
> - problem #2: If is send an event from onConfigure() or onBeforeRender(),
> the event get send everytime component is rendered ...
>
> So current solution is to create a flag in my panels that sendEventOnInit()
> method was allready called ..
>
> but it would be better  to have a method onInitialized() |
> afterInitialized() (pick your favorite name).
>
> If someone has better approach, please let me know about it !
>
> Kind regards
>
> Armando
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Question-or-feature-request-afterOnInitialize-tp3732520p3732520.html
> Sent from the Users forum 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
>
>



-- 
Pedro Henrique Oliveira dos Santos

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Wicket 1.5: Question (or feature request) afterOnInitialize()

2011-08-10 Thread armandoxxx
Hey guys ... 

With wicket 1.5 we got events. So far so good but I got a case where i'm
missing after on initialize method call. 

I have lot's of panels on my page, and I create them in onInitialize() code.
But I need to send a 1 time event after all components are initialized. 
- problem #1: If I send an event from onInitialize():  not sure that all
components are initialized !
- problem #2: If is send an event from onConfigure() or onBeforeRender(),
the event get send everytime component is rendered ... 

So current solution is to create a flag in my panels that sendEventOnInit()
method was allready called .. 

but it would be better  to have a method onInitialized() |
afterInitialized() (pick your favorite name). 

If someone has better approach, please let me know about it ! 

Kind regards

Armando

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Question-or-feature-request-afterOnInitialize-tp3732520p3732520.html
Sent from the Users forum 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