You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Rogers Reilly (JIRA)" <de...@myfaces.apache.org> on 2006/02/28 22:03:42 UTC

[jira] Commented: (TOMAHAWK-164) compareToValidator does not work on generic EditableValueHolders, only UIInput subclasses (ADF Faces)

    [ http://issues.apache.org/jira/browse/TOMAHAWK-164?page=comments#action_12368167 ] 

Rogers Reilly commented on TOMAHAWK-164:
----------------------------------------

UIXEditableValue (the ADF class) does implement EditableValueHolder, so you can just replace the cast in line 72 with EditableValueHolder and it should work with both ADF and Tomahawk.

Note- you'll then need to cast foreignComp in line 80 to (UIComponent) to use .getId().

Haven't tested, but it compiles for me and seems logical.

> compareToValidator does not work on generic EditableValueHolders, only UIInput subclasses (ADF Faces)
> -----------------------------------------------------------------------------------------------------
>
>          Key: TOMAHAWK-164
>          URL: http://issues.apache.org/jira/browse/TOMAHAWK-164
>      Project: MyFaces Tomahawk
>         Type: Bug
>   Components: Validators
>     Versions: 1.1.2-SNAPSHOT
>     Reporter: Mike Kienenberger
>     Assignee: Mike Kienenberger
>     Priority: Minor

>
> On 2/28/06, Rogers Reilly <ro...@s-rod.com> wrote:
> > 3) a tangent, but related- if you find yourself trying to get Tomahawk &
> > ADF components working together, you may find this example helpful.  The
> > Tomahawk EqualsValidator won't work if you're comparing the component to
> > an ADF component, and here's why:
> > UIInput foreignComp = (UIInput) uiComponent.getParent().findComponent(_for);
> >  in EqualsValidator (line 72) is casting the "compare to" component to
> > UIInput, but ADF input components don't extend UInput.  You can create a
> > custom ADFEqualsValidator by replacing the above with:
> > UIXEditableValue foreignComp = (UIXEditableValue)
> > uiComponent.getParent().findComponent(_for);
> > or, of course, create an overarching EqualsValidator that tries both casts.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira