ive added this...you can take advantage of it in the next release or
via a snapshot you build yourself..
/**
* Creates markup id for the input tag used to generate the checkbox
for the element with the
* specified {...@code id}.
* <p>
* NOTE It is useful to override this method if the contract for the
genreated ids should be
* fixed, for example in cases when the id generation pattern in this
method is used to predict
* ids by some external javascript. If the contract is fixed in the
user's code then upgrading
* wicket versions will guarantee not to break it should the default
contract be changed at a
* later time.
* </p>
*
* @param id
* @return markup id for the input tag
*/
protected String getCheckBoxMarkupId(String id)
{
return getMarkupId() + "-" + getInputName() + "_" + id;
}
-igor
On Fri, May 21, 2010 at 8:47 AM, Jimi <[email protected]> wrote:
>
> Hi,
>
> In our project we use CheckBoxMultipleChoice, and it has been working great.
> But now we wanted to be able to dynamically check and uncheck the checkboxes
> using javascript, without doing any server side processing (for example
> using ajax).
>
> However I noticed that the class CheckBoxMultipleChoice doesn't create real
> wicket java objects for its checkboxes. Instead it generates the html for
> these boxes as a plain string in its onComponentTagBody method. This causes
> a big problem for us, since there is no easy and safe way to get hold of the
> markup ids of these tags.
>
> Currently I have written a simple method that can calculate the markup id of
> the corresponding tag, but it uses information from the source code of
> CheckBoxMultipleChoice. My code works fine now, but if
> CheckBoxMultipleChoice is modified in the future then a wicket upgrade might
> break our code.
>
> What do you guys think about this? The way I see it the class
> CheckBoxMultipleChoice should provide a way to get hold of the markup ids of
> the checkboxes. Preferably it should add real wicket objects.
>
> Is there any way around this problem?
>
> Regards
> /Jimi
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Find-markup-id-of-checkbox-tags-of-CheckBoxMultipleChoice-To-check-uncheck-with-plain-javascript-ie--tp2226351p2226351.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]