To refer to the part of this email suggesting manually setting the submitted values of the children EditableValueHolder, here is the information from the JSF spec:
submittedValue: The submitted, unconverted, value of this component. This property should only be set by the decode() method of this component, or its corresponding Renderer, or by the validate method of this component. This property should only be read by the validate() method of this component. On 6/12/07, David Delbecq <[EMAIL PROTECTED]> wrote:
Hello everyone I did a bit of investigations on how to force validation of all tabs, including those never yet rendered. It seems blocked by a characteristic of validation: Validation will be completly bypassed on most components if there has never been a _submittedValue for that component. This is important because that mean the user behind his web browser has the possibity to completly bypass validation of required fields. If you require a valid client number for a message contact form, for example, user can simply remove this field from DOM tree to ignore this (Note: this is different to not filling entry). Note: i could bypass without troubles validation there: http://example.irian.at/example-simple-20070612/sample1.jsf using this simple javascript command in url bar: javascript:document.getElementById('form1').removeChild(document.getElementById('form1:number1')) Is it expected feature of validation or a bug in myface? If it's expected behaviour, then to ensure all tabs get validated we could during decode of panel, scan tree below each non active tab, (stopping at !isRendered() components to respect specs) for each EditableValueHolder which does not have yet a submitted value, set the submited value to the converted value of model (this is like doing a encode/decode but all server side). [EMAIL PROTECTED] wrote: Hi, submitted patch wouldn't break old apps (it has default of NOT validating not-selected tabs). But it has limitation: it can validate only so far visited/rendered tabs (and only visited/rendered subcomponents) Limitation comes from the way TabbedPane is rendered: it renders only active tab in server-side tabbing (lines 552-555 in HtmlTabbedPaneRenderer). This seems to be chosen for being less evil than messing with rendered attribute in all tabs after change of selected tab [should be consulted with original commiter]. Is there any method in MyFaces allowing to create component tree w/o actually rendering it? This would allow this kind of validation. (I fear that would require to alter way rendering is functioning - decoupling rendering into creating tree and actual rendering). With regards, Zdenek
