On 04/11/2012 07:53 PM, Andrea Del Bene wrote:
It's like if JavaScript can't tell apart a form from another. Can you
check the HTML generated for your page and see if forms have an unique id?
Checked, the IDs are unique. I couldn't figure out what the actual
problem is so, to bypass it, I just added this to intercept the enter
key and explicitly use my nested form's submit:
final TextField<String> newValueField =
new TextField<String>("newValueField", new
PropertyModel(newSubFieldValues, "[" + index + "]")){
@Override
protected void onComponentTag(ComponentTag tag){
super.onComponentTag(tag);
tag.put("onkeypress", "if(event.keyCode == 13)
{document.getElementById('" + addButton.getMarkupId() +
"').click();return false;}");
}
};
Hope this helps someone else with nested forms and the enter key.
Manos
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]