You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Lon Varscsak <lo...@gmail.com> on 2016/08/10 23:40:17 UTC
“Duplicate” objects on a page
I have a situation where I have a Save/Cancel button up at the top of the
page and also one at the bottom. I’d love to reference the same wicket:id,
but I gather that’s not possible. I attempted to clone the object
(WicketObjects.cloneObject), but then I think I’d have duplicate ids (can’t
set id outside of the class).
Any solutions to this problem? I’d really rather not duplicate the
onClick’s (even though they mostly share common logic) if possible.
Thanks,
Lon
Re: “Duplicate” objects on a page
Posted by Sebastien <se...@gmail.com>.
Hi Lon,
You cannot have duplicate wicket:id
Some options:
- extract the onClick logic to a dedicated method
- extends your button to a dedicated class so you have the onClick only
once.
Hope this helps,
Sebastien.
On Thu, Aug 11, 2016 at 1:40 AM, Lon Varscsak <lo...@gmail.com>
wrote:
> I have a situation where I have a Save/Cancel button up at the top of the
> page and also one at the bottom. I’d love to reference the same wicket:id,
> but I gather that’s not possible. I attempted to clone the object
> (WicketObjects.cloneObject), but then I think I’d have duplicate ids (can’t
> set id outside of the class).
>
> Any solutions to this problem? I’d really rather not duplicate the
> onClick’s (even though they mostly share common logic) if possible.
>
> Thanks,
>
> Lon
>