Eelco Hillenius wrote:
On 7/8/07, Sven Meier <[EMAIL PROTECTED]> wrote:
See:

   label.add(new AttributeModifier("onclick", true, new
Model("someFancyJavascript(\"fancy\")")));

... will result in something like:

  <span onclick="someFancyJavascript(\"fancy\"">

For Firefox the value of onclick is now "someFancyJavascript(\", this is
the problem I'm experiencing.

The Ajax stuff is working fine because it uses single quotes (').

Did someone create an issue for this yet?

http://issues.apache.org/jira/browse/WICKET-741

Fixed in trunk.

Additionally, around that line there is the dubious comment:

// attributes without values are possible, e.g. 'disabled'
if (value != null) { // ...


For XHTML, this isn't right - attributes must always have values.

As far as I see it, we have two options here:

 1. Automatically insert an attribute value that's the same as the name
    (which I think it always should be), for things like disabled.

 2. Prevent people adding null values to the map in the first place. To
    do this, we'd need to wrap the IValueMap in XmlTag with some magic
    on the put method to check for null values. Or we could add a
    boolean flag to IValueMap to say whether it accepts them, or
    similar.

Obviously #1 is nice and simple.

What do people think?

Best regards,

Al
--
Alastair Maw
Wicket-biased blog at http://herebebeasties.com

Reply via email to