You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Martin Marinschek <ma...@gmail.com> on 2007/06/18 06:57:43 UTC

Client-side validator / dataTable

Hi Cagatay,

currently there is an NPE happening with the client-side validator and
UIInputs in a dataTable (you can see this on the newly added
sandbox-example-page:

http://localhost:8000/pprPanelGroupDataTable.jsf

)

I've fixed this with a change which will essentially disable
client-side navigation - please look a little deeper into this, and
also bear in mind that you can't traverse the component tree - it is
just not possible in JSF as soon as you reach a dataTable or other
fly-weight-pattern components. I don't have a big problem if you do it
until a table is reached, but of course we should make sure an NPE is
not happening if a table with inputs is included on the page. If you
want to discuss some more on this, feel free to contact me directly or
via the lists.

regards,

Martin

---------------

find below the change:

    //todo: This won't work - there is no way to traverse the
component tree properly!
    //Traverses the component tree recursively, queues validation
calls starting from the root
	public static void queueCVCalls(UIComponent root) {
	/*	if( root.getChildCount() > 0 ) {
			for( int i = 0; i< root.getChildCount() ; i++ )
				queueCVCalls( (UIComponent) root.getChildren().get( i ) );
		} else {
			if( root instanceof UIInput ) {
				UIInput input = (UIInput) root;
				addCVCall( createCVCall( input ) );
			}
		} */
	}

-- 

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: Client-side validator / dataTable

Posted by Cagatay Civici <ca...@gmail.com>.
Hi Martin,

Yes this was an old issue related to tree traversing and uidata stuff. I
remember we've discussed this at past.

I was only traversing the tree because client validation is in sandbox and I
was planning to remove the tree traversing and move that stuff to renderers
once it's out of the sandbox.

I think I can remove the tree traversing in sandbox too by extended the
tomahawk input renderers now in sandbox too, this would work. Or disable
traversing in case the component is type of uidata.

I'm on it, thanks for the heads up!

Cheers,

On 6/18/07, Matthias Wessendorf <ma...@apache.org> wrote:
>
> >         public static void queueCVCalls(UIComponent root) {
> >         /*      if( root.getChildCount() > 0 ) {
> >                         for( int i = 0; i< root.getChildCount() ; i++ )
> >                                 queueCVCalls( (UIComponent)
> root.getChildren().get( i ) );
> >                 } else {
> >                         if( root instanceof UIInput ) {
> >                                 UIInput input = (UIInput) root;
>
> EditableValueHolder
>
>
> >                                 addCVCall( createCVCall( input ) );
> >                         }
> >                 } */
> >         }
> >
> > --
> >
> > http://www.irian.at
> >
> > Your JSF powerhouse -
> > JSF Consulting, Development and
> > Courses in English and German
> >
> > Professional Support for Apache MyFaces
> >
>
>
> --
> Matthias Wessendorf
>
> further stuff:
> blog: http://matthiaswessendorf.wordpress.com/
> mail: matzew-at-apache-dot-org
>

Re: Client-side validator / dataTable

Posted by Matthias Wessendorf <ma...@apache.org>.
>         public static void queueCVCalls(UIComponent root) {
>         /*      if( root.getChildCount() > 0 ) {
>                         for( int i = 0; i< root.getChildCount() ; i++ )
>                                 queueCVCalls( (UIComponent) root.getChildren().get( i ) );
>                 } else {
>                         if( root instanceof UIInput ) {
>                                 UIInput input = (UIInput) root;

EditableValueHolder


>                                 addCVCall( createCVCall( input ) );
>                         }
>                 } */
>         }
>
> --
>
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>


-- 
Matthias Wessendorf

further stuff:
blog: http://matthiaswessendorf.wordpress.com/
mail: matzew-at-apache-dot-org