Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Forms are binding because their inputs have the same names. Help.
I have to identical forms in an MVCPortlet. But both are in different
.jsp files
This is a rought structure of the forms.
<aui:form action="actionURL" name="crud_form">
<aui:input name="id"/>
<aui:input name="name"/>
<aui/form>
Both have the same actionURLs, but different names.
For some reason, whatever value is in the first form it gets
autofilled into the second form.
For example, if in the first form I have id = 1 and name = foo,
and then I submit. In the second form which is on the next page will
have id = 1, and name = foo.
Even if I try to set the values from the .jsp files by setting
value="another value", it gets overwritten. I tried using
model-context and in both cases this still happends. I tried using
different ids for each input, but it still happens.
Sorry, if I am not clear enpugh. Thanks
Hi ,
You can try using below method for clearing request parameters in your action method:
PortalUtil.clearRequestParameters(renderRequest);