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...