/*
* If the link is a submitlink then we pretend to have clicked it
*/
else if (linkComponent instanceof SubmitLink)
{
SubmitLink submitLink = (SubmitLink)linkComponent;
String pageRelativePath = submitLink.getInputName();
getParametersForNextRequest().put(pageRelativePath, new String[] { "x" });
Form<?> form = submitLink.getForm();
form.visitFormComponents(new FormComponent.IVisitor()
{
public Object formComponent(IFormVisitorParticipant formComponent)
{
FormComponent<?> component = (FormComponent<?>)formComponent;
if (getParametersForNextRequest().containsKey(component.getInputName()) == false)
{
getParametersForNextRequest().put(component.getInputName(),
new String[] { component.getDefaultModelObjectAsString() });
}
return IVisitor.CONTINUE_TRAVERSAL;
}
});
submitForm(submitLink.getForm().getPageRelativePath());
}
// if the link is a normal link (or ResourceLink)
else if (linkComponent instanceof AbstractLink)
{
AbstractLink link = (AbstractLink)linkComponent;