You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Abdullah Shaikh <ab...@viithiisys.com> on 2009/08/05 10:03:32 UTC

how to get multiple input parameters

I am having a service, which expects "names" parameter as a List. So in my
html form I have mutliple text field as "names".

How do I get multiple values, I mean the values which we get if using
request.getParameterValues() ?

I tried looking into ofbiz code, I found that we can have fields named
"fieldname_o_N" to get multiple values, but when I use
UtilHttp.parseMultiFormData(parameters), the map is empty, but
UtilHttp.getMultiFormRowCount(request) returns the correct count.

Should I manually get the form data in a java event ?

Note - I am not using Form widgets.

Re: how to get multiple input parameters

Posted by Abdullah Shaikh <ab...@viithiisys.com>.
I have tried having "names" as a List in service and passing multiple
"names" text field, ofbiz does create a "names" list, but then if I have
only a single "names" field then it throws a casting exception as in this
case it passes the "names" fields as a string which is correct.

I guess I need to write a java event, get the "names" field from request,
create a List manually and then pass it to the service.

Any suggestions ?


On Wed, Aug 5, 2009 at 1:33 PM, Abdullah Shaikh <
abdullah.shaikh@viithiisys.com> wrote:

> I am having a service, which expects "names" parameter as a List. So in my
> html form I have mutliple text field as "names".
>
> How do I get multiple values, I mean the values which we get if using
> request.getParameterValues() ?
>
> I tried looking into ofbiz code, I found that we can have fields named
> "fieldname_o_N" to get multiple values, but when I use
> UtilHttp.parseMultiFormData(parameters), the map is empty, but
> UtilHttp.getMultiFormRowCount(request) returns the correct count.
>
> Should I manually get the form data in a java event ?
>
> Note - I am not using Form widgets.
>