掲示板

Get request parameters of dynamic inputs

13年前 に jacarui iuracaj によって更新されました。

Get request parameters of dynamic inputs

New Member 投稿: 2 参加年月日: 10/08/24 最新の投稿
Hi,

I've tried to add inputs in my portlet form using jQuery. Doing something like this:

<portlet:actionurl name="addHistory" var="addURL">
<portlet:param name="type" value="1" />
</portlet:actionurl>

... <script> var name = "foo"; var id = 1; jQuery('#table').addRow({ newRow: "<tr><td><input id=\"name" + id+ "\" type=\"text\" value=\"" + name + "\"/></td></tr>", addTop: false, removeTop: false }); </script>


The problem is when the form is submitted. The parameter "name1" is not set in the request.

@ProcessAction(name = "addHistory")
	public void addHistory(ActionRequest actionRequest,
			ActionResponse actionResponse) throws IOException, PortletException {
String name = ParamUtil.getString(actionRequest,"name1"); //null
...


What am I doing wrong?
13年前 に jacarui iuracaj によって更新されました。

RE: Get request parameters of dynamic inputs

New Member 投稿: 2 参加年月日: 10/08/24 最新の投稿
I forgot to put name attributes in my inputs. Solved.