Howto clean Form Fields after Form is submitted

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

Howto clean Form Fields after Form is submitted

consolex
Hi,

i built some Demo Application to quickadd a Customer, within ofbiz. I used the FormWidget to do this.
The Formdata gets posted to an Event, the Event does the mapping and calls the service. But when it returns to the initial view, where data was collected via the form, the form fields show what was entered previously.

How to achieve that the form is empty again. I tried deleting the  requestAttributes and
requestParameters but without success.

thx for helping me

have a nice day,

Michael
Reply | Threaded
Open this post in threaded view
|

Re: Howto clean Form Fields after Form is submitted

BJ Freeman
Look at how a customer, Employee, person are done in the party component.


consolex sent the following on 10/29/2008 3:42 AM:

> Hi,
>
> i built some Demo Application to quickadd a Customer, within ofbiz. I used
> the FormWidget to do this.
> The Formdata gets posted to an Event, the Event does the mapping and calls
> the service. But when it returns to the initial view, where data was
> collected via the form, the form fields show what was entered previously.
>
> How to achieve that the form is empty again. I tried deleting the
> requestAttributes and
> requestParameters but without success.
>
> thx for helping me
>
> have a nice day,
>
> Michael
Reply | Threaded
Open this post in threaded view
|

Re: Howto clean Form Fields after Form is submitted

BJ Freeman
also look at the lookup for products.

BJ Freeman sent the following on 10/29/2008 3:52 AM:

> Look at how a customer, Employee, person are done in the party component.
>
>
> consolex sent the following on 10/29/2008 3:42 AM:
>> Hi,
>>
>> i built some Demo Application to quickadd a Customer, within ofbiz. I used
>> the FormWidget to do this.
>> The Formdata gets posted to an Event, the Event does the mapping and calls
>> the service. But when it returns to the initial view, where data was
>> collected via the form, the form fields show what was entered previously.
>>
>> How to achieve that the form is empty again. I tried deleting the
>> requestAttributes and
>> requestParameters but without success.
>>
>> thx for helping me
>>
>> have a nice day,
>>
>> Michael
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Howto clean Form Fields after Form is submitted

consolex
In reply to this post by BJ Freeman
ok, this is how i always try get forward, the problem is that i dont understand in which part of the framework (presentation or businesslogic) or at which state of the framework flow the action has to be taken.

what variable of the servlet-context do i have to delete? Or what XML-Element is responsible for clearing the data?


thx

BJ Freeman wrote
Look at how a customer, Employee, person are done in the party component.


consolex sent the following on 10/29/2008 3:42 AM:
> Hi,
>
> i built some Demo Application to quickadd a Customer, within ofbiz. I used
> the FormWidget to do this.
> The Formdata gets posted to an Event, the Event does the mapping and calls
> the service. But when it returns to the initial view, where data was
> collected via the form, the form fields show what was entered previously.
>
> How to achieve that the form is empty again. I tried deleting the
> requestAttributes and
> requestParameters but without success.
>
> thx for helping me
>
> have a nice day,
>
> Michael
Reply | Threaded
Open this post in threaded view
|

Re: Howto clean Form Fields after Form is submitted

Rashko Rejmer
Hi,
One of the tricks that I have used in such situations is to use  
parameter-name in form field tag.

<field parameter-name="partyId" name="partyId_field_name"

In this case the name of the field can be different from the parameter  
that will be passed, and because of this form widget will not fill the  
field with the old data.

Hope this helps
Rashko Rejmer

On Oct 29, 2008, at 2:50 PM, consolex wrote:

>
> ok, this is how i always try get forward, the problem is that i dont
> understand in which part of the framework (presentation or  
> businesslogic) or
> at which state of the framework flow the action has to be taken.
>
> what variable of the servlet-context do i have to delete? Or what
> XML-Element is responsible for clearing the data?
>
>
> thx
>
>
> BJ Freeman wrote:
>>
>> Look at how a customer, Employee, person are done in the party  
>> component.
>>
>>
>> consolex sent the following on 10/29/2008 3:42 AM:
>>> Hi,
>>>
>>> i built some Demo Application to quickadd a Customer, within  
>>> ofbiz. I
>>> used
>>> the FormWidget to do this.
>>> The Formdata gets posted to an Event, the Event does the mapping and
>>> calls
>>> the service. But when it returns to the initial view, where data was
>>> collected via the form, the form fields show what was entered  
>>> previously.
>>>
>>> How to achieve that the form is empty again. I tried deleting the
>>> requestAttributes and
>>> requestParameters but without success.
>>>
>>> thx for helping me
>>>
>>> have a nice day,
>>>
>>> Michael
>>
>>
> :confused::confused:
> --
> View this message in context: http://www.nabble.com/Howto-clean-Form-Fields-after-Form-is-submitted-tp20224461p20226382.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>

Reply | Threaded
Open this post in threaded view
|

Re: Howto clean Form Fields after Form is submitted

BJ Freeman
In reply to this post by consolex
if fields are filled and there is no rollback(not added to the db) you
can see the new data in the fields, this is usually prepared in the
actions of a widget, for display.


consolex sent the following on 10/29/2008 5:50 AM:

> ok, this is how i always try get forward, the problem is that i dont
> understand in which part of the framework (presentation or businesslogic) or
> at which state of the framework flow the action has to be taken.
>
> what variable of the servlet-context do i have to delete? Or what
> XML-Element is responsible for clearing the data?
>
>
> thx
>
>
> BJ Freeman wrote:
>> Look at how a customer, Employee, person are done in the party component.
>>
>>
>> consolex sent the following on 10/29/2008 3:42 AM:
>>> Hi,
>>>
>>> i built some Demo Application to quickadd a Customer, within ofbiz. I
>>> used
>>> the FormWidget to do this.
>>> The Formdata gets posted to an Event, the Event does the mapping and
>>> calls
>>> the service. But when it returns to the initial view, where data was
>>> collected via the form, the form fields show what was entered previously.
>>>
>>> How to achieve that the form is empty again. I tried deleting the
>>> requestAttributes and
>>> requestParameters but without success.
>>>
>>> thx for helping me
>>>
>>> have a nice day,
>>>
>>> Michael
>>
> :confused::confused:
Reply | Threaded
Open this post in threaded view
|

Re: Howto clean Form Fields after Form is submitted

consolex
ok, how do define in an action inside the form widget to not autofill the form field?

When i try it with "paramter-name" the form-field is clean like i would like to have, but then i cant put name="uiLabels.foobar" cause then the value of the property file gets prefilled into the form-field.

the mechanism in the background tries to autofill the form field if it finds any variable in the  context with the same name! how to turn this off? maybe in the <field   ... tag?



<quote author="BJ Freeman">
if fields are filled and there is no rollback(not added to the db) you
can see the new data in the fields, this is usually prepared in the
actions of a widget, for display.


consolex sent the following on 10/29/2008 5:50 AM:
> ok, this is how i always try get forward, the problem is that i dont
> understand in which part of the framework (presentation or businesslogic) or
> at which state of the framework flow the action has to be taken.
>
> what variable of the servlet-context do i have to delete? Or what
> XML-Element is responsible for clearing the data?
>
>
> thx
>
>
> BJ Freeman wrote:
>> Look at how a customer, Employee, person are done in the party component.
>>
>>
>> consolex sent the following on 10/29/2008 3:42 AM:
>>> Hi,
>>>
>>> i built some Demo Application to quickadd a Customer, within ofbiz. I
>>> used
>>> the FormWidget to do this.
>>> The Formdata gets posted to an Event, the Event does the mapping and
>>> calls
>>> the service. But when it returns to the initial view, where data was
>>> collected via the form, the form fields show what was entered previously.
>>>
>>> How to achieve that the form is empty again. I tried deleting the
>>> requestAttributes and
>>> requestParameters but without success.
>>>
>>> thx for helping me
>>>
>>> have a nice day,
>>>
>>> Michael
>>
> :confused::confused:


Reply | Threaded
Open this post in threaded view
|

Re: Howto clean Form Fields after Form is submitted

Adrian Crum
Try map-name.

-Adrian

consolex wrote:

> ok, how do define in an action inside the form widget to not autofill the
> form field?
>
> When i try it with "paramter-name" the form-field is clean like i would like
> to have, but then i cant put name="uiLabels.foobar" cause then the value of
> the property file gets prefilled into the form-field.
>
> the mechanism in the background tries to autofill the form field if it finds
> any variable in the  context with the same name! how to turn this off? maybe
> in the <field   ... tag?
>
>
>
>
> BJ Freeman wrote:
>> if fields are filled and there is no rollback(not added to the db) you
>> can see the new data in the fields, this is usually prepared in the
>> actions of a widget, for display.
>>
>>
>> consolex sent the following on 10/29/2008 5:50 AM:
>>> ok, this is how i always try get forward, the problem is that i dont
>>> understand in which part of the framework (presentation or businesslogic)
>>> or
>>> at which state of the framework flow the action has to be taken.
>>>
>>> what variable of the servlet-context do i have to delete? Or what
>>> XML-Element is responsible for clearing the data?
>>>
>>>
>>> thx
>>>
>>>
>>> BJ Freeman wrote:
>>>> Look at how a customer, Employee, person are done in the party
>>>> component.
>>>>
>>>>
>>>> consolex sent the following on 10/29/2008 3:42 AM:
>>>>> Hi,
>>>>>
>>>>> i built some Demo Application to quickadd a Customer, within ofbiz. I
>>>>> used
>>>>> the FormWidget to do this.
>>>>> The Formdata gets posted to an Event, the Event does the mapping and
>>>>> calls
>>>>> the service. But when it returns to the initial view, where data was
>>>>> collected via the form, the form fields show what was entered
>>>>> previously.
>>>>>
>>>>> How to achieve that the form is empty again. I tried deleting the
>>>>> requestAttributes and
>>>>> requestParameters but without success.
>>>>>
>>>>> thx for helping me
>>>>>
>>>>> have a nice day,
>>>>>
>>>>> Michael
>>> :confused::confused:
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: Howto clean Form Fields after Form is submitted

consolex
In reply to this post by consolex

<field parameter-name="firstName" title="${uiLabelMap.foobar}" name=""   does the trick!







<quote author="BJ Freeman">
if fields are filled and there is no rollback(not added to the db) you
can see the new data in the fields, this is usually prepared in the
actions of a widget, for display.


consolex sent the following on 10/29/2008 5:50 AM:
> ok, this is how i always try get forward, the problem is that i dont
> understand in which part of the framework (presentation or businesslogic) or
> at which state of the framework flow the action has to be taken.
>
> what variable of the servlet-context do i have to delete? Or what
> XML-Element is responsible for clearing the data?
>
>
> thx
>
>
> BJ Freeman wrote:
>> Look at how a customer, Employee, person are done in the party component.
>>
>>
>> consolex sent the following on 10/29/2008 3:42 AM:
>>> Hi,
>>>
>>> i built some Demo Application to quickadd a Customer, within ofbiz. I
>>> used
>>> the FormWidget to do this.
>>> The Formdata gets posted to an Event, the Event does the mapping and
>>> calls
>>> the service. But when it returns to the initial view, where data was
>>> collected via the form, the form fields show what was entered previously.
>>>
>>> How to achieve that the form is empty again. I tried deleting the
>>> requestAttributes and
>>> requestParameters but without success.
>>>
>>> thx for helping me
>>>
>>> have a nice day,
>>>
>>> Michael
>>
> :confused::confused: