Re: AjaxSelfUpdatingBehavior and nested values updating

2009-10-07 Thread zabian

Great, this is exactly what i need.
I just didn't know how to convert one model to another or that you can 
get property of model object directly from model :)


I appreciate your commitment.

Regards,
Wojtek


Jeremy Thomerson pisze:

AbstractReadOnlyModel point = new AbstractReadOnlyModel() { ...
return point from your service ... }

PropertyModel lat = new PropertyModel(point, "latitude");
PropertyModel lng = new PropertyModel(point, "longitude");
Label latLabel = new Label("lat", lat);
Label lngLabel = new Label("lng", lng);


--
Jeremy Thomerson
http://www.wickettraining.com



2009/10/7 zabian 

  

Hi,
I want to add self-updating panel which displays some nested properties ie.
two coordinates (x,y - let's say the Point class object).
The point is updated by ejb or webservice.

I tried to use the example from wicket-examples page - clock using
AjaxSelfUpdatingBehavior.
But example case updates just one value, so the model is easy -
AbstractReadOnlyModel.
My case is similar, I could use AbstractReadOnlyModel which
getObject() calls my ejb or webservice and returns the Point object.
The problem is how to populate nested properties to the Labels on each
update of AjaxSelfUpdatingBehavior.

I'm still fresh to the models, could anybody help me?

Regards,
Wojtek





-
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: AjaxSelfUpdatingBehavior and nested values updating

2009-10-07 Thread Jeremy Thomerson
Oh, then just add the panel that contains those labels, or add the labels
themselves, to the ajax response (target.addComponent)

--
Jeremy Thomerson
http://www.wickettraining.com



On Wed, Oct 7, 2009 at 10:00 AM, Jeremy Thomerson  wrote:

> AbstractReadOnlyModel point = new AbstractReadOnlyModel() { ...
> return point from your service ... }
>
> PropertyModel lat = new PropertyModel(point, "latitude");
> PropertyModel lng = new PropertyModel(point, "longitude");
> Label latLabel = new Label("lat", lat);
> Label lngLabel = new Label("lng", lng);
>
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
> 2009/10/7 zabian 
>
> Hi,
>> I want to add self-updating panel which displays some nested properties
>> ie. two coordinates (x,y - let's say the Point class object).
>> The point is updated by ejb or webservice.
>>
>> I tried to use the example from wicket-examples page - clock using
>> AjaxSelfUpdatingBehavior.
>> But example case updates just one value, so the model is easy -
>> AbstractReadOnlyModel.
>> My case is similar, I could use AbstractReadOnlyModel which
>> getObject() calls my ejb or webservice and returns the Point object.
>> The problem is how to populate nested properties to the Labels on each
>> update of AjaxSelfUpdatingBehavior.
>>
>> I'm still fresh to the models, could anybody help me?
>>
>> Regards,
>> Wojtek
>>
>>
>>
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>


Re: AjaxSelfUpdatingBehavior and nested values updating

2009-10-07 Thread Jeremy Thomerson
AbstractReadOnlyModel point = new AbstractReadOnlyModel() { ...
return point from your service ... }

PropertyModel lat = new PropertyModel(point, "latitude");
PropertyModel lng = new PropertyModel(point, "longitude");
Label latLabel = new Label("lat", lat);
Label lngLabel = new Label("lng", lng);


--
Jeremy Thomerson
http://www.wickettraining.com



2009/10/7 zabian 

> Hi,
> I want to add self-updating panel which displays some nested properties ie.
> two coordinates (x,y - let's say the Point class object).
> The point is updated by ejb or webservice.
>
> I tried to use the example from wicket-examples page - clock using
> AjaxSelfUpdatingBehavior.
> But example case updates just one value, so the model is easy -
> AbstractReadOnlyModel.
> My case is similar, I could use AbstractReadOnlyModel which
> getObject() calls my ejb or webservice and returns the Point object.
> The problem is how to populate nested properties to the Labels on each
> update of AjaxSelfUpdatingBehavior.
>
> I'm still fresh to the models, could anybody help me?
>
> Regards,
> Wojtek
>
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: AjaxSelfUpdatingBehavior and nested values updating

2009-10-07 Thread Michael O'Cleirigh

Hi Wojtek,

Create a panel that contains the setup to present the properties of your 
Point class.


Add the 'AjaxSelfUpdatingTimerBehavior' to the panel.

So long as the PointPanel is setup properly using an IModel 
implementation that knows how to populate itself and the nested fields 
there is nothing else you need to do.


It sounds like you don't have the panel without the ajax working.  You 
should look at the CompoundPropertyModel or build a custom IModel 
implementation to allow you to access the fields of the Point object.


See the wiki for more examples: 
http://cwiki.apache.org/WICKET/working-with-wicket-models.html


Mike


Hi,
I want to add self-updating panel which displays some nested 
properties ie. two coordinates (x,y - let's say the Point class object).

The point is updated by ejb or webservice.

I tried to use the example from wicket-examples page - clock using 
AjaxSelfUpdatingBehavior.
But example case updates just one value, so the model is easy - 
AbstractReadOnlyModel.
My case is similar, I could use AbstractReadOnlyModel which 
getObject() calls my ejb or webservice and returns the Point object.
The problem is how to populate nested properties to the Labels on each 
update of AjaxSelfUpdatingBehavior.


I'm still fresh to the models, could anybody help me?

Regards,
Wojtek





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





AjaxSelfUpdatingBehavior and nested values updating

2009-10-07 Thread zabian

Hi,
I want to add self-updating panel which displays some nested properties 
ie. two coordinates (x,y - let's say the Point class object).

The point is updated by ejb or webservice.

I tried to use the example from wicket-examples page - clock using 
AjaxSelfUpdatingBehavior.
But example case updates just one value, so the model is easy - 
AbstractReadOnlyModel.
My case is similar, I could use AbstractReadOnlyModel which 
getObject() calls my ejb or webservice and returns the Point object.
The problem is how to populate nested properties to the Labels on each 
update of AjaxSelfUpdatingBehavior.


I'm still fresh to the models, could anybody help me?

Regards,
Wojtek





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