pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Bartlett <cbartlet...@gmail.com>
Subject Re: Question regarding listeners
Date Fri, 06 Jan 2012 15:23:23 GMT
As Mark said, this is what the Bindable interface is for when
deserializing BXML using BXMLSerializer.
http://pivot.apache.org/tutorials/bxml-primer.htmlhttp://pivot.apache.org/2.0/docs/api/org/apache/pivot/beans/Bindable.html
http://pivot.apache.org/2.0/docs/api/org/apache/pivot/beans/BXMLSerializer.html
If you are not using BXMLSerializer, but perhaps building the
Component graph manually, you would just need to keep references to
any object which you wish to initialize, and then call that code at
the appropriate point in your application's lifecycle.
Chris

On 6 January 2012 09:16, Mark Dodgson <mark.dodgson@googlemail.com> wrote:
> Hi,
>
> I am very new to pivot/java (started yesterday) so might be totally wrong,
> but I came accross the example on the pivot website which sounds like what
> you are after.
>
> http://pivot.apache.org/tutorials/push-buttons.html
>
> Implementing bindable provides an initialize method that is called once on
> startup
>
> Regards,
>
> Doddi
>
>
> On 6 January 2012 07:59, V SANTOSH PAVAN RAJU BS <pavanraju.mca@gmail.com>
> wrote:
>>
>> Hi,
>> Is there any listeners that can be used to execute some block of code at
>> initialization time.
>> For example, buttonPressListeners  execute a block of code when that
>> corresponding button was clicked.
>> But, i want to execute a block of code that should run at initialization
>> time only, without any event occurs.
>>
>> I wrote some code to do this.
>>
>> this.getComponentClassListeners().add(new ComponentClassListener() {
>> @Override
>> public void focusedComponentChanged(Component component) {
>> custIdTest = WindowContext.getCustomerId(AccountInformationPane.this);
>> System.out.println(custIdTest);
>> }
>> });
>>
>> Here i tried to get a value from other class which is WindowContext in to
>> AccountInformationPane class which extends BoxPane.
>> System.out.println(custIdTest); this statement was executed
>> infinitely......
>>
>> So is there any other way to do this?
>> --
>> Thanks & Regards
>> B.S.V.S.Pavan Raju.
>> Skype: skype_pavan1
>> Hyderabad.
>>
>

Mime
View raw message