}
/** Returns the parameters containing all name value params beside submit button, image button, unchecked radio
* buttons and checkboxes and without Upload information. */
private Parameters composeParameters(SubmitButton button, SubmitImage image, int x, int y) {
Parameters params = new Parameters();
for(FormElement element : this) {
String name = element.getName();
String value = element.getValue();
if(element instanceof Checkable) {
if(((Checkable)element).isChecked())
params.add(name, value != null ? value : "");
}
else if(element instanceof Select) {
Select select = (Select)element;
for(Select.Option option : select.getOptions())
if(option.isSelected())
params.add(select.getName(), option.getValue() != null ? option.getValue() : "");
}
else if(!(element instanceof SubmitButton) && !(element instanceof SubmitImage) && !(element instanceof Upload)) {
if(name != null)
params.add(name, value != null ? value : "");
}
}
if(button != null && button.getName() != null)
params.add(button.getName(), button.getValue() != null ? button.getValue() : "");
if(image != null) {
if(image.getValue() != null && image.getValue().length() > 1)
params.add(image.getName(), image.getValue());
params.add(image.getName() + ".x", "" + x);
params.add(image.getName() + ".y", "" + y);
}
return params;
}