You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by smallufo <sm...@gmail.com> on 2010/07/26 06:47:41 UTC

[1.4.9] Ajax displayed label not compatible with IE6/7/8 if the label contains
 tag !

If a label is default invisible and is setVisible(true) in an
AjaxButton.onSubmit() , and if that label containing <pre>xxx</pre> string,
it will fail to render in IE 6/8 .
IE6/8 report wicket-ajax.js has something wrong ...

I don't have IE7 , but I think the result is the same :


HTML
<form wicket:id="form">
    <input type="button" value="failButton" wicket:id="failButton" />
    <span wicket:id="failLabel"></span>
</form>

Java Code :
public class MainPage extends WebPage {
  private MultiLineLabel failLabel = new MultiLineLabel("failLabel");

  public MainPage()   {
    failLabel.setVisible(false);
    failLabel.setOutputMarkupPlaceholderTag(true);

    Form<Void> form = new Form<Void>("form");
    add(form);
    form.add(failLabel);

    AjaxButton failButton = new AjaxButton("failButton")     {
      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form)
 {
        failLabel.setDefaultModel(new PropertyModel<String>(MainPage.this ,
"failResult"));
        failLabel.setEscapeModelStrings(false);
        failLabel.setVisible(true);
        target.addComponent(failLabel);
      }
    };
    form.add(failButton);
  }

  /**
   * Success in Firefox/Chrome , but fail in IE 6/8 (I don't have IE7)
   */
  public String getFailResult()  {
    return "<pre><font color=\"#ff0000\">R</font></pre>";
  }
}

In the code above , if I take away "<pre>" and "</pre>" in getFailResult() ,
it works like a charm!
I think it is a bug...

Re: [1.4.9] Ajax displayed label not compatible with IE6/7/8 if the label contains
 tag !

Posted by smallufo <sm...@gmail.com>.
I have created a JIRA issue with quickstart file here :
https://issues.apache.org/jira/browse/WICKET-2965
<https://issues.apache.org/jira/browse/WICKET-2965>

2010/7/26 smallufo <sm...@gmail.com>

> HTML
> <form wicket:id="form">
>     <input type="button" value="failButton" wicket:id="failButton" />
>     <span wicket:id="failLabel"></span>
> </form>
>
> Java Code :
> public class MainPage extends WebPage {
>   private MultiLineLabel failLabel = new MultiLineLabel("failLabel");
>
>   public MainPage()   {
>     failLabel.setVisible(false);
>     failLabel.setOutputMarkupPlaceholderTag(true);
>
>     Form<Void> form = new Form<Void>("form");
>     add(form);
>     form.add(failLabel);
>
>     AjaxButton failButton = new AjaxButton("failButton")     {
>       @Override
>       protected void onSubmit(AjaxRequestTarget target, Form<?> form)
>  {
>         failLabel.setDefaultModel(new PropertyModel<String>(MainPage.this ,
> "failResult"));
>         failLabel.setEscapeModelStrings(false);
>         failLabel.setVisible(true);
>         target.addComponent(failLabel);
>       }
>     };
>     form.add(failButton);
>   }
>
>   /**
>    * Success in Firefox/Chrome , but fail in IE 6/8 (I don't have IE7)
>    */
>   public String getFailResult()  {
>     return "<pre><font color=\"#ff0000\">R</font></pre>";
>   }
> }
>
> In the code above , if I take away "<pre>" and "</pre>" in getFailResult()
> , it works like a charm!
> I think it is a bug...
>