public void test_Hidden_Values()
{
IMarkupWriter writer = newWriter();
NestedMarkupWriter nested = newNestedWriter();
IRequestCycle cycle = newCycle();
ResponseBuilder builder = newMock(ResponseBuilder.class);
IValidationDelegate delegate = newDelegate();
PageRenderSupport support = newPageRenderSupport();
ILink link = newLink();
IRender render = newRender();
MockForm form = new MockForm(delegate);
trainIsRewound(cycle, form, false);
trainGetPageRenderSupport(cycle, support);
replay();
final FormSupport fs = newFormSupport(writer, cycle, form);
verify();
trainCycleSeedEncoding(cycle);
form.setBody(new IRender() {
public void render(IMarkupWriter pwriter, IRequestCycle pcycle)
{
fs.addHiddenValue("hidden1", "value1");
fs.addHiddenValue("hidden2", "id2", "value2");
}
});
trainRegister(support, form, "myform");
trainGetParameterNames(link, new String[]{"service"});
trainGetParameterValues(link, "service", new String[] {"fred"});
trainGetNestedWriter(writer, nested);
trainGetURL(link, null, "/app");
writer.begin("form");
writer.attribute("method", "post");
writer.attribute("action", "/app");
writer.attribute("id", "myform");
render.render(writer, cycle);
writer.println();
expect(cycle.getResponseBuilder()).andReturn(builder);
expect(builder.contains(form)).andReturn(false);
trainDiv(writer, form);
trainHidden(writer, "formids", "");