Problem in getting field value of type time-stamp passed from form to my servlet method

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem in getting field value of type time-stamp passed from form to my servlet method

tanzeem.mb
Hi ofbiz nerds,

I'm trying to pass field values of type timestamp from my form to my servlet method using java event handler. when i try to get the value of the field  using getParameter("fieldname") i am getting the value as null.

This problem did not occur when i was using a service event handler and using objectofDispatchContext.get("fieldName") . But i want to use servlet method only and i am stuck.

How can i rectify the problem.Please help

Thanks in advance
Tanzeem

Reply | Threaded
Open this post in threaded view
|

Re: Problem in getting field value of type time-stamp passed from form to my servlet method

Divesh Dutta
Hello Tanzeem,

You may try this one:

Map parameters = UtilHttp.getParameterMap(request); {Here request is
object of HttpServletRequest}
        Timestamp date = (Timestamp) parameters.get("fieldname");

Hope this may help you

Thanks
--
Divesh
       


tanzeem.mb wrote:

> Hi ofbiz nerds,
>
> I'm trying to pass field values of type timestamp from my form to my servlet
> method using java event handler. when i try to get the value of the field
> using getParameter("fieldname") i am getting the value as null.
>
> This problem did not occur when i was using a service event handler and
> using objectofDispatchContext.get("fieldName") . But i want to use servlet
> method only and i am stuck.
>
> How can i rectify the problem.Please help
>
> Thanks in advance
> Tanzeem
>
>
>  

Reply | Threaded
Open this post in threaded view
|

Re: Problem in getting field value of type time-stamp passed from form to my servlet method

tanzeem.mb
Hi
I still get null when i use parameters.get("dateFrom").
The field is defined in my forma s below

<field name="dateFrom" title="From Date">
            <date-time type="timestamp" input-method="time-dropdown"  />

        </field>

Divesh Dutta wrote
Hello Tanzeem,

You may try this one:

Map parameters = UtilHttp.getParameterMap(request); {Here request is
object of HttpServletRequest}
        Timestamp date = (Timestamp) parameters.get("fieldname");

Hope this may help you

Thanks
--
Divesh
       


tanzeem.mb wrote:
> Hi ofbiz nerds,
>
> I'm trying to pass field values of type timestamp from my form to my servlet
> method using java event handler. when i try to get the value of the field
> using getParameter("fieldname") i am getting the value as null.
>
> This problem did not occur when i was using a service event handler and
> using objectofDispatchContext.get("fieldName") . But i want to use servlet
> method only and i am stuck.
>
> How can i rectify the problem.Please help
>
> Thanks in advance
> Tanzeem
>
>
>