Hi,

You can override #setOptionAttributes() -
https://github.com/apache/wicket/blob/77d8bf32d2063ac0174fc383da81ac2d6bcc482b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractChoice.java#L457

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Sep 26, 2017 at 1:41 PM, Lorne Malvo <[email protected]>
wrote:

>
> Is there a simple way to insert a "title" HTML attribute into each option
> of
> a DropDownChoice, in order to display a different tool tip with each
> choice?
>
> I tried doing it simply by adding HTML in a ChoiceRenderer, but could not
> get Wicket to not escape the HTML (can't call setEscapeModelStrings(false))
> on a DropDownChoice.
>
> I also tried this...
> https://stackoverflow.com/questions/12234738/wicket-dropdownchoice-titles-
> tooltips-for-options
> ... but it didn't work for me. First, that method was always calling
> toString() on my model object to display the option, which is not what I
> wanted, and I couldn't see a way to make that subclass non-generic.
> Secondly, even if I had had the aforementioned problem, the tooltip didn't
> even show up.
>
> Anyway to do this simply?
>
> Thanks in advance!
>
>
> --
> Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-
> f1842947.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to