* Test that testing if a component is on the ajax response can handle if the response is
* encoded.
*/
public void testAssertComponentOnAjaxResponse_encoding()
{
final IModel labelModel = new IModel()
{
private static final long serialVersionUID = 1L;
private String value;
public Object getObject()
{
return value;
}
public void setObject(Object object)
{
value = (String)object;
}
public void detach()
{
}
};
labelModel.setObject("Label 1");
final Label label = new Label(MockPageWithLinkAndLabel.LABEL_ID, labelModel);
label.setOutputMarkupId(true);
final Page page = new MockPageWithLinkAndLabel();
AjaxLink ajaxLink = new AjaxLink(MockPageWithLinkAndLabel.LINK_ID)
{
private static final long serialVersionUID = 1L;
public void onClick(AjaxRequestTarget target)
{
labelModel.setObject("Label which needs encoding: [] ][");
target.addComponent(label);
}
};
ajaxLink.setOutputMarkupId(true);