You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by David Delbecq <de...@oma.be> on 2006/07/26 12:20:29 UTC

partial validation of value

Hello,

is it possible to handle partial validation of form content? I need 1 or 
several items in a forms to be valid at a specific submit, but as it is 
only a request for partial change in the form, it is most probable the 
rest is not valid / finished. However, i need to keep information in 
rest of form even if it's not valid.

Here is how my form must look like:


data1 [.....]
data2 [.....]
data3 [.....]
  subdata1.... (read-only)
  subdata2.... (read-only)
  subdata3.... (read-only)
  subdata4 [......]  [add-subdata-button]
data4 [.....]
data5 [.....]
[submit]

when i click add-subdata-button, i need subdata4 to be validate, but 
textual content of data 1 -> 5  must be kept without any validation 
attempt.
when i click submit, data 1->5 must be validated, but content of 
subdata4 ignored.

I suppose the JSF framework has something for this, but am not sure what.


Re: partial validation of value

Posted by David Delbecq <de...@oma.be>.
Am quite new to jsf and am not sure to understand your suggestion.
- what is the hidden form element supposed to refer to?
- am using custom composite components, and some of those component 
behave like extendable arrays, when i do operations like extend/remove 
on such composite component, i need other components to not have 
validation, neither transformation (that is it does not reach the 
backing bean it just stay inside the component until redraw)

I was thinking about using the 'immediate' on the action commands, but 
this disable all validation, so i would like, perhaps in action, to 
trigger transfer to backing bean. Example:
i click 'add' button, operation is immediate, it take the various input 
fields parts of the operation, it force them to store data to backing 
bean with validation, and when validation is done, i manipulate the 
backing bean to update view. Other non related components of the form 
simply redisplay their current value in the form view.


Julian Ray wrote:
> Perhaps a good strategy would be to add bindings to all the form elements
> you need to validate and a hidden form element at the bottom of the page and
> perform a backing-bean validation on this hidden element. You can validate
> all the values in the bound form elements at one time and as complicated
> business logic as you need.
>
> -----Original Message-----
> From: David Delbecq [mailto:delbd@oma.be] 
> Sent: Wednesday, July 26, 2006 6:20 AM
> To: MyFaces Discussion
> Subject: partial validation of value
>
> Hello,
>
> is it possible to handle partial validation of form content? I need 1 or
> several items in a forms to be valid at a specific submit, but as it is only
> a request for partial change in the form, it is most probable the rest is
> not valid / finished. However, i need to keep information in rest of form
> even if it's not valid.
>
> Here is how my form must look like:
>
>
> data1 [.....]
> data2 [.....]
> data3 [.....]
>   subdata1.... (read-only)
>   subdata2.... (read-only)
>   subdata3.... (read-only)
>   subdata4 [......]  [add-subdata-button]
> data4 [.....]
> data5 [.....]
> [submit]
>
> when i click add-subdata-button, i need subdata4 to be validate, but textual
> content of data 1 -> 5  must be kept without any validation attempt.
> when i click submit, data 1->5 must be validated, but content of
> subdata4 ignored.
>
> I suppose the JSF framework has something for this, but am not sure what.
>
>   


RE: partial validation of value

Posted by Julian Ray <ju...@yahoo.com>.
Perhaps a good strategy would be to add bindings to all the form elements
you need to validate and a hidden form element at the bottom of the page and
perform a backing-bean validation on this hidden element. You can validate
all the values in the bound form elements at one time and as complicated
business logic as you need.

-----Original Message-----
From: David Delbecq [mailto:delbd@oma.be] 
Sent: Wednesday, July 26, 2006 6:20 AM
To: MyFaces Discussion
Subject: partial validation of value

Hello,

is it possible to handle partial validation of form content? I need 1 or
several items in a forms to be valid at a specific submit, but as it is only
a request for partial change in the form, it is most probable the rest is
not valid / finished. However, i need to keep information in rest of form
even if it's not valid.

Here is how my form must look like:


data1 [.....]
data2 [.....]
data3 [.....]
  subdata1.... (read-only)
  subdata2.... (read-only)
  subdata3.... (read-only)
  subdata4 [......]  [add-subdata-button]
data4 [.....]
data5 [.....]
[submit]

when i click add-subdata-button, i need subdata4 to be validate, but textual
content of data 1 -> 5  must be kept without any validation attempt.
when i click submit, data 1->5 must be validated, but content of
subdata4 ignored.

I suppose the JSF framework has something for this, but am not sure what.