Errors on top of form while keeping FORM information

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

Errors on top of form while keeping FORM information

S.Hage
Hi all,

   When submitting a form and errors returned, OFbiz shows errors on top of the form and then shows the form while keeping all the information on it.
 
   Can someone explain to me how OFBiz do that?  I searched the code to figure this out but no luck.


Thank in advance ...

S. Hage



Reply | Threaded
Open this post in threaded view
|

Re: Errors on top of form while keeping FORM information

Scott Gray-2
Basically if the context contains any errorMessages then the  
ScreenRenderer adds isError = true to the context, then when  
ModelFormField.getEntry(...) is called it checks for isError in the  
context and if true uses the request parameters to fetch form values  
rather than using the actual source of the data.

Regards
Scott

On 5/10/2009, at 1:24 PM, S. Hage wrote:

>
> Hi all,
>
>   When submitting a form and errors returned, OFbiz shows errors on  
> top of
> the form and then shows the form while keeping all the information  
> on it.
>
>   Can someone explain to me how OFBiz do that?  I searched the code to
> figure this out but no luck.
>
>
> Thank in advance ...
>
> S. Hage
>
>
>
>
>
> -----
> _-_-_-_-_-_-_-_-_-_-_
>
> S. Hage
>
> [hidden email]
> --
> View this message in context: http://www.nabble.com/Errors-on-top-of-form-while-keeping-FORM-information-tp25743636p25743636.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Errors on top of form while keeping FORM information

S.Hage
Hi Scott,

this means, we have to set _ERROR_MESSAGE_ context, and then OFBiz do the rest for us according to the response in controller.xml...


Scott Gray-2 wrote
Basically if the context contains any errorMessages then the  
ScreenRenderer adds isError = true to the context, then when  
ModelFormField.getEntry(...) is called it checks for isError in the  
context and if true uses the request parameters to fetch form values  
rather than using the actual source of the data.

Regards
Scott

On 5/10/2009, at 1:24 PM, S. Hage wrote:

>
> Hi all,
>
>   When submitting a form and errors returned, OFbiz shows errors on  
> top of
> the form and then shows the form while keeping all the information  
> on it.
>
>   Can someone explain to me how OFBiz do that?  I searched the code to
> figure this out but no luck.
>
>
> Thank in advance ...
>
> S. Hage
>
>
>
>
>
> -----
> _-_-_-_-_-_-_-_-_-_-_
>
> S. Hage
>
> saad.hage@hotmail.com
> --
> View this message in context: http://www.nabble.com/Errors-on-top-of-form-while-keeping-FORM-information-tp25743636p25743636.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>


 
Reply | Threaded
Open this post in threaded view
|

Re: Errors on top of form while keeping FORM information

Scott Gray-2
If you want OFBiz to do the same thing without any error messages  
being present then you can add useRequestParameters = true to the  
context prior to the form being rendered i.e. in the screen or form  
actions.

Regards
Scott

On 5/10/2009, at 2:05 PM, S. Hage wrote:

>
> Hi Scott,
>
> this means, we have to set _ERROR_MESSAGE_ context, and then OFBiz  
> do the
> rest for us according to the response in controller.xml...
>
>
>
> Scott Gray-2 wrote:
>>
>> Basically if the context contains any errorMessages then the
>> ScreenRenderer adds isError = true to the context, then when
>> ModelFormField.getEntry(...) is called it checks for isError in the
>> context and if true uses the request parameters to fetch form values
>> rather than using the actual source of the data.
>>
>> Regards
>> Scott
>>
>> On 5/10/2009, at 1:24 PM, S. Hage wrote:
>>
>>>
>>> Hi all,
>>>
>>>  When submitting a form and errors returned, OFbiz shows errors on
>>> top of
>>> the form and then shows the form while keeping all the information
>>> on it.
>>>
>>>  Can someone explain to me how OFBiz do that?  I searched the code  
>>> to
>>> figure this out but no luck.
>>>
>>>
>>> Thank in advance ...
>>>
>>> S. Hage
>>>
>>>
>>>
>>>
>>>
>>> -----
>>> _-_-_-_-_-_-_-_-_-_-_
>>>
>>> S. Hage
>>>
>>> [hidden email]
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Errors-on-top-of-form-while-keeping-FORM-information-tp25743636p25743636.html
>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>
>>
>>
>>
>>
>
>
> -----
> _-_-_-_-_-_-_-_-_-_-_
>
> S. Hage
>
> [hidden email]
> --
> View this message in context: http://www.nabble.com/Errors-on-top-of-form-while-keeping-FORM-information-tp25743636p25743826.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>


smime.p7s (3K) Download Attachment