You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Erich W Schreiner <es...@yahoo.com> on 2010/06/29 16:47:37 UTC

Best practice: AJAX and how to implement state indicator image?

Dear all,

I am trying to find the best way to implement a state indicator that shows 
different images. The state of the model object can be changed by the user, 
resulting in  an AJAX update being sent the server and a re-rendering of the 
model object, which should show the correct state image then.

Currently I am adding an Image for each state and override their isVisible() 
method to have only one image shown. Is there any way to do this using a single 
Image component and some dynamic way of looking up the image to render?

Related to this is the problem of showing a set of Ajax-enabled icon buttons, 
again with their visibility depending on the model state and themselves 
influencing this state. I would like to merge these buttons into a single one 
(e.g. for setting a boolean to true / false and showing a checkbox checked / 
unchecked).

TIA & best regards,
Erich

Re: Best practice: AJAX and how to implement state indicator image?

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
use non caching image?

Ernesto

On Wed, Jun 30, 2010 at 10:54 AM, Erich W Schreiner
<es...@yahoo.com> wrote:
> Hi Igor,
>
> thank you for your suggestion, the lookup of the icon to display works fine. I
> now override ResourceReference.newResource()
>
> Unfortunately, the lookup only works correctely the first time, i.e. when the
> Page is displayed. Subsequent Ajax updates and re-rendering of parts will always
> show the same (initially displayed) icon, independent of the current model
> state.
>
> Any suggestions on how to Ajax-enable this?
>
> Many thanks for your time,
> Erich
>
>
>
>
>
>
> ________________________________
> Von: Igor Vaynberg <ig...@gmail.com>
> An: users@wicket.apache.org
> Gesendet: Dienstag, den 29. Juni 2010, 17:32:27 Uhr
> Betreff: Re: Best practice: AJAX and how to implement state indicator image?
>
> the resourcereference you give your image can serve different images
> based on some condition.
>
> -igor
>
> On Tue, Jun 29, 2010 at 7:47 AM, Erich W Schreiner <es...@yahoo.com> wrote:
>> Dear all,
>>
>> I am trying to find the best way to implement a state indicator that shows
>> different images. The state of the model object can be changed by the user,
>> resulting in  an AJAX update being sent the server and a re-rendering of the
>> model object, which should show the correct state image then.
>>
>> Currently I am adding an Image for each state and override their isVisible()
>> method to have only one image shown. Is there any way to do this using a
> single
>> Image component and some dynamic way of looking up the image to render?
>>
>> Related to this is the problem of showing a set of Ajax-enabled icon buttons,
>> again with their visibility depending on the model state and themselves
>> influencing this state. I would like to merge these buttons into a single one
>> (e.g. for setting a boolean to true / false and showing a checkbox checked /
>> unchecked).
>>
>> TIA & best regards,
>> Erich
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org

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


Re: Best practice: AJAX and how to implement state indicator image?

Posted by Erich W Schreiner <es...@yahoo.com>.
Hi Igor,

thank you for your suggestion, the lookup of the icon to display works fine. I 
now override ResourceReference.newResource()

Unfortunately, the lookup only works correctely the first time, i.e. when the 
Page is displayed. Subsequent Ajax updates and re-rendering of parts will always 
show the same (initially displayed) icon, independent of the current model 
state.

Any suggestions on how to Ajax-enable this?

Many thanks for your time,
Erich






________________________________
Von: Igor Vaynberg <ig...@gmail.com>
An: users@wicket.apache.org
Gesendet: Dienstag, den 29. Juni 2010, 17:32:27 Uhr
Betreff: Re: Best practice: AJAX and how to implement state indicator image?

the resourcereference you give your image can serve different images
based on some condition.

-igor

On Tue, Jun 29, 2010 at 7:47 AM, Erich W Schreiner <es...@yahoo.com> wrote:
> Dear all,
>
> I am trying to find the best way to implement a state indicator that shows
> different images. The state of the model object can be changed by the user,
> resulting in  an AJAX update being sent the server and a re-rendering of the
> model object, which should show the correct state image then.
>
> Currently I am adding an Image for each state and override their isVisible()
> method to have only one image shown. Is there any way to do this using a 
single
> Image component and some dynamic way of looking up the image to render?
>
> Related to this is the problem of showing a set of Ajax-enabled icon buttons,
> again with their visibility depending on the model state and themselves
> influencing this state. I would like to merge these buttons into a single one
> (e.g. for setting a boolean to true / false and showing a checkbox checked /
> unchecked).
>
> TIA & best regards,
> Erich

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

Re: Best practice: AJAX and how to implement state indicator image?

Posted by Igor Vaynberg <ig...@gmail.com>.
the resourcereference you give your image can serve different images
based on some condition.

-igor

On Tue, Jun 29, 2010 at 7:47 AM, Erich W Schreiner <es...@yahoo.com> wrote:
> Dear all,
>
> I am trying to find the best way to implement a state indicator that shows
> different images. The state of the model object can be changed by the user,
> resulting in  an AJAX update being sent the server and a re-rendering of the
> model object, which should show the correct state image then.
>
> Currently I am adding an Image for each state and override their isVisible()
> method to have only one image shown. Is there any way to do this using a single
> Image component and some dynamic way of looking up the image to render?
>
> Related to this is the problem of showing a set of Ajax-enabled icon buttons,
> again with their visibility depending on the model state and themselves
> influencing this state. I would like to merge these buttons into a single one
> (e.g. for setting a boolean to true / false and showing a checkbox checked /
> unchecked).
>
> TIA & best regards,
> Erich

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