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 <igor.vaynb...@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 <eschrei...@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-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org