You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Gerhard <ge...@gmail.com> on 2010/10/26 22:32:49 UTC

Re: ext-bv addon: Required Initialization for labels required change

hi ben,

thx for the information - we will check it!
(we haven't released the add-on - so we have to do some final tests.)

@rudy:
it would be nice if you can check the change with your applications.

regards,
gerhard

http://www.irian.at

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

Professional Support for Apache MyFaces



2010/10/26 <ne...@ijet.com>

>
> Just a short note that may be of interest.
> I was unable to get the ext-bv addon: Required Initialization for labels
> working "out of the box".
>
> After modifying
> at.gp.web.jsf.extval.beanval.label.interceptor.BeanValidationAwareLabelRendererInterceptor
> as follows, it seems to work well now.
>
> protected void initComponent(FacesContext facesContext, UIComponent
> uiComponent)
>     {
>         ...
>         //super.initComponent(facesContext, targetComponent);
>         ExtValUtils.configureComponentWithMetaData(facesContext,
> targetComponent, ExtValUtils.getTransformedMetaData(facesContext,
> targetComponent));
>
>         ...
>     }
>
> Any thoughts on this change? Is it appropriate?
> By the way, my web-app uses JSF 1.2, Facelets, RichFaces (3.3.3),
> Restfaces, and Orchestra.
>
> Thanks!
> Ben
>

Re: ext-bv addon: Required Initialization for labels required change

Posted by Rudy De Busscher <rd...@gmail.com>.
Ben,

Nice to hear it worked.  also good to know that it works with you combine
them.  Didn't try that yet. Thx for the info.

regards
Rudy.

On 27 October 2010 17:22, <ne...@ijet.com> wrote:

>  Rudy,
>
> FYI, I am using both the bean-val and property versions together
> successfully (I reverted my change to the bean-val version).
>
> Thanks!
> Ben
>
> ps. It was necessary to make a change in the property version to account
> for a NullPointerException. I'll start a new thread for that.
>
> -Ben
>
>
> -----Original Message-----
> *From:* neumanb@ijet.com [mailto:neumanb@ijet.com]
> *Sent:* Wednesday, October 27, 2010 10:31 AM
> *To:* dev@myfaces.apache.org
> *Subject:* RE: ext-bv addon: Required Initialization for labels required
> change
>
> Rudy,
>
> ------"But commenting out the super.initComponent as you proposed will
> result in not recognizing the Bean validation annoations anymore."------
>
> Thanks for the info. I'm sure I'll need both property *and* bean
> annotations on some properties.
> I'll try using both versions together.
>
> Ben
>
> -----Original Message-----
> *From:* Rudy De Busscher [mailto:rdebusscher@gmail.com]
> *Sent:* Wednesday, October 27, 2010 10:19 AM
> *To:* MyFaces Development
> *Subject:* Re: ext-bv addon: Required Initialization for labels required
> change
>
> Ben,
>
> There exists 2 version because the handling of Bean Validation annotations
> is completely different then the 'standard' ones (you are using JPA
> annotations but there exists also ExtVal annotations like @Required that do
> more or less the same as the Bean Validation annotations)
>
> The issue that you have now is that the Required Label add-on (BV version)
> is not recognizing the NON Bean validation annotations.
>
> I'll have a look now that I know more of the context.
>
> Did you add only the bean-validation module to the project or also
> property-validation module ?
>
> But commenting out the super.initComponent as you proposed will result in
> not recognizing the Bean validation annoations anymore.
>
> Rudy.
>
>
> On 27 October 2010 16:09, <ne...@ijet.com> wrote:
>
>>  Rudy,
>> I haven't tried the non-bean version yet but was just wondering if this is
>> the only difference between the two versions?
>> If so, why not just make one version that applies the correct component
>> init/config method based on the annotation type (bean vs property)?
>>
>> Ben
>>
>> -----Original Message-----
>> *From:* neumanb@ijet.com [mailto:neumanb@ijet.com]
>> *Sent:* Wednesday, October 27, 2010 9:40 AM
>> *To:* dev@myfaces.apache.org
>> *Subject:* RE: ext-bv addon: Required Initialization for labels required
>> change
>>
>> Hi Rudy,
>>
>> I am using both property and bean validation. The labels of concern,
>> though, are annotated using @Column(...nullable=false). So perhaps we've
>> discovered my issue. Thanks!
>> I will drop in the non-bean validation version and see how that works.
>> Is there any reason why I can't/shouldn't use both?
>>
>> Finally, the target component is standard JSF.
>>
>> Thanks!
>> Ben
>>
>>
>> -----Original Message-----
>> *From:* Rudy De Busscher [mailto:rdebusscher@gmail.com]
>> *Sent:* Wednesday, October 27, 2010 8:40 AM
>> *To:* MyFaces Development
>> *Subject:* Re: ext-bv addon: Required Initialization for labels required
>> change
>>
>> Hello Ben,
>>
>> I made a few checks and within my examples everything works (they don't
>> use Richfaces however).  Can it be that you are mixing some environments ??
>>
>> The line of code
>> *ExtValUtils.**configureComponentWithMetaData**(facesContext,
>> targetComponent, ExtValUtils.**getTransformedMetaData(**facesContext,
>> targetComponent));*
>>
>> is typical for the usage WITHOUT bean validation.
>>
>> Are you using bean validation annotations (like
>> javax.validation.constraints.NotNull) on your properties?
>>
>> If not, there exists also an add-on for the non bean validation version.
>>
>>
>> Is the target component a richfaces faces component or a standard JSF one
>> ??
>>
>> I try to check with a RichFaces component tomorrow.
>>
>> regards
>> Rudy.
>>
>>
>> On 26 October 2010 22:32, Gerhard <ge...@gmail.com> wrote:
>>
>>> hi ben,
>>>
>>> thx for the information - we will check it!
>>> (we haven't released the add-on - so we have to do some final tests.)
>>>
>>> @rudy:
>>> it would be nice if you can check the change with your applications.
>>>
>>> regards,
>>> gerhard
>>>
>>> http://www.irian.at
>>>
>>> Your JSF powerhouse -
>>> JSF Consulting, Development and
>>> Courses in English and German
>>>
>>> Professional Support for Apache MyFaces
>>>
>>>
>>>
>>> 2010/10/26 <ne...@ijet.com>
>>>
>>>
>>>> Just a short note that may be of interest.
>>>> I was unable to get the ext-bv addon: Required Initialization for labels
>>>> working "out of the box".
>>>>
>>>> After modifying
>>>> at.gp.web.jsf.extval.beanval.label.interceptor.BeanValidationAwareLabelRendererInterceptor
>>>> as follows, it seems to work well now.
>>>>
>>>> protected void initComponent(FacesContext facesContext, UIComponent
>>>> uiComponent)
>>>>     {
>>>>         ...
>>>>         //super.initComponent(facesContext, targetComponent);
>>>>         ExtValUtils.configureComponentWithMetaData(facesContext,
>>>> targetComponent, ExtValUtils.getTransformedMetaData(facesContext,
>>>> targetComponent));
>>>>
>>>>         ...
>>>>     }
>>>>
>>>> Any thoughts on this change? Is it appropriate?
>>>> By the way, my web-app uses JSF 1.2, Facelets, RichFaces (3.3.3),
>>>> Restfaces, and Orchestra.
>>>>
>>>> Thanks!
>>>> Ben
>>>>
>>>
>>>
>>
>

Re: NPE in Required Initialization for labels addon (property version)

Posted by Gerhard <ge...@gmail.com>.
hi ben,

i've committed both - see [1]

regards,
gerhard

[1] http://code.google.com/p/os890/source/detail?r=378

http://www.irian.at

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

Professional Support for Apache MyFaces


2010/10/28 <ne...@ijet.com>

>  Great, I see the change in the bean-validation version.
> Don't forget the property version ;)
>
> # This patch file was generated by NetBeans IDE
> # It uses platform neutral UTF-8 encoding and \n newlines.
> --- Base (BASE)
> +++ Locally Modified (Based On LOCAL)
> @@ -117,8 +117,11 @@
>
>          }
>          else
>          {
> +            String value = (String) uiOutput.getValue();
> +            if (value != null) {
>              applyRequiredMarkerUsingValue(facesContext, uiOutput, (String)
> uiOutput.getValue());
>          }
> +        }
>          if (setEscapeToFalse)
>          {
>              doSetEscapeToFalse(uiOutput);
> --Ben
>
> -----Original Message-----
> *From:* Gerhard [mailto:gerhard.petracek@gmail.com]
> *Sent:* Wednesday, October 27, 2010 6:32 PM
> *To:* MyFaces Development
> *Subject:* Re: NPE in Required Initialization for labels addon (property
> version)
>
> thx ben - i've committed it.
>
> regards,
> gerhard
>
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>
>
>
> 2010/10/27 <ne...@ijet.com>
>
>>  This null-check was also needed in the Bean Validation version.
>>
>> Thanks!
>> Ben
>>
>> -----Original Message-----
>> *From:* Ben Neuman
>> *Sent:* Wednesday, October 27, 2010 11:31 AM
>> *To:* 'MyFaces Development'
>> *Subject:* NPE in Required Initialization for labels addon (property
>> version)
>>
>> I had to make a small change in the Required Initialization for labels
>> (property version) to resolve a NullPointerException.
>>
>> In DefaultRequiredLabelInitializer I added a null value check. Without, I
>> was getting NullPointerExceptions.
>>
>> protected void applyRequiredMarker(FacesContext facesContext, UIOutput
>> uiOutput)
>> {
>>     ValueExpression expression = uiOutput.getValueExpression("value");
>>
>>         if (expression != null)
>>         {
>>             applyRequiredMarkerUsingExpression(facesContext, uiOutput,
>> expression.getExpressionString());
>>         }
>>         else
>>         {
>>             String value = (String) uiOutput.getValue();
>>             if (value != null) {
>>                 applyRequiredMarkerUsingValue(facesContext, uiOutput,
>> value);
>>             }
>>         }
>>         ...
>> }
>>
>> Thanks!
>> Ben
>>
>>
>

Re: Required Label Marker Placement

Posted by Rudy De Busscher <rd...@gmail.com>.
Ben,

We need some indication indeed if we have to put something on non required
fields also.  So I think you're solution would be OK (will see it in the
code)

regards
Rudy.

On 4 November 2010 14:47, <ne...@ijet.com> wrote:

>  I haven't disappeared. Just very busy with the paying job and life.
> I have made the changes to work for me and it looks great but have not had
> time to work with the unit tests.
>
> Just an FYI, this change did require that I pass a boolean 'required' flag
> along through the 'applyMarker's chain of methods, since we are marking both
> required and unrequired fields.
> I'm not aware of a better aproach at this time. Any thoughts?
>
> BEFORE_WITH_DUMMY sounds perfect.
>
> Thanks!
> Ben
>
>
> -----Original Message-----
> *From:* Rudy De Busscher [mailto:rdebusscher@gmail.com]
> *Sent:* Thursday, November 04, 2010 9:21 AM
> *To:* MyFaces Development
> *Subject:* Re: Required Label Marker Placement
>
> Hi,
>
> We should make it configurable and use BEFORE_WITH_DUMMY (or something)
> instead of BEFORE.
>
> I'll make the changes next week, or if you like, you can send us a patch
> that we can use.
>
> regards
> Rudy.
>
>
> On 28 October 2010 18:36, Gerhard <ge...@gmail.com> wrote:
>
>> +1
>> i'll review and apply the patch as soon as you have finished the mentioned
>> features.
>>
>> regards,
>> gerhard
>>
>> http://www.irian.at
>>
>> Your JSF powerhouse -
>> JSF Consulting, Development and
>> Courses in English and German
>>
>> Professional Support for Apache MyFaces
>>
>>
>>
>> 2010/10/28 <ne...@ijet.com>
>>
>>  Hi all.
>>> I've been playing with the required label addon and have found that a
>>> modification in marker rendering has
>>> improved the appearance of my app.
>>> I just want to get feedback from the rest as to whether this might be a
>>> change worth integrating into your module.
>>>
>>> Essentially, the current implementation simply prepends the marker to the
>>> label (when applying marker before value).
>>> Visually, I do not like my required marker displacing the label. I would
>>> prefer that all labels, required and otherwise, align vertically based on
>>> the label text, and that the required markers appear left of this vertical
>>> alignment.
>>> As so:
>>> *First Name:
>>> *Last Name:
>>>  Middle Name:
>>>
>>> In order to do this, I've prepended the required marker where necessary
>>> and a space where not necessary.
>>> I have also set the font of the 'marker' to monospace.
>>>
>>> Would this be a worthy addition to the addon? We could of course allow
>>> the developer to turn this off through some configuration param.
>>>
>>> Thanks!
>>> Ben Neuman
>>>
>>>
>>>
>>>
>>>
>>
>>
>

RE: Required Label Marker Placement

Posted by ne...@ijet.com.
I haven't disappeared. Just very busy with the paying job and life. 
I have made the changes to work for me and it looks great but have not had time to work with the unit tests. 
 
Just an FYI, this change did require that I pass a boolean 'required' flag along through the 'applyMarker's chain of methods, since we are marking both required and unrequired fields. 
I'm not aware of a better aproach at this time. Any thoughts?
 
BEFORE_WITH_DUMMY sounds perfect. 
 
Thanks!
Ben
 

-----Original Message-----
From: Rudy De Busscher [mailto:rdebusscher@gmail.com]
Sent: Thursday, November 04, 2010 9:21 AM
To: MyFaces Development
Subject: Re: Required Label Marker Placement


Hi,

We should make it configurable and use BEFORE_WITH_DUMMY (or something) instead of BEFORE.

I'll make the changes next week, or if you like, you can send us a patch that we can use.

regards
Rudy.



On 28 October 2010 18:36, Gerhard < gerhard.petracek@gmail.com> wrote:


+1 
i'll review and apply the patch as soon as you have finished the mentioned features.

regards,
gerhard

http://www.irian.at

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

Professional Support for Apache MyFaces




2010/10/28 < neumanb@ijet.com> 


Hi all. 
I've been playing with the required label addon and have found that a modification in marker rendering has 
improved the appearance of my app. 
I just want to get feedback from the rest as to whether this might be a change worth integrating into your module.
 
Essentially, the current implementation simply prepends the marker to the label (when applying marker before value).
Visually, I do not like my required marker displacing the label. I would prefer that all labels, required and otherwise, align vertically based on the label text, and that the required markers appear left of this vertical alignment.
As so:
*First Name:
*Last Name:
 Middle Name:
 
In order to do this, I've prepended the required marker where necessary and a space where not necessary. 
I have also set the font of the 'marker' to monospace.
 
Would this be a worthy addition to the addon? We could of course allow the developer to turn this off through some configuration param.
 
Thanks!
Ben Neuman
 
 
 
 




Re: Required Label Marker Placement

Posted by Rudy De Busscher <rd...@gmail.com>.
Hi,

We should make it configurable and use BEFORE_WITH_DUMMY (or something)
instead of BEFORE.

I'll make the changes next week, or if you like, you can send us a patch
that we can use.

regards
Rudy.


On 28 October 2010 18:36, Gerhard <ge...@gmail.com> wrote:

> +1
> i'll review and apply the patch as soon as you have finished the mentioned
> features.
>
> regards,
> gerhard
>
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>
>
>
> 2010/10/28 <ne...@ijet.com>
>
>  Hi all.
>> I've been playing with the required label addon and have found that a
>> modification in marker rendering has
>> improved the appearance of my app.
>> I just want to get feedback from the rest as to whether this might be a
>> change worth integrating into your module.
>>
>> Essentially, the current implementation simply prepends the marker to the
>> label (when applying marker before value).
>> Visually, I do not like my required marker displacing the label. I would
>> prefer that all labels, required and otherwise, align vertically based on
>> the label text, and that the required markers appear left of this vertical
>> alignment.
>> As so:
>> *First Name:
>> *Last Name:
>>  Middle Name:
>>
>> In order to do this, I've prepended the required marker where necessary
>> and a space where not necessary.
>> I have also set the font of the 'marker' to monospace.
>>
>> Would this be a worthy addition to the addon? We could of course allow the
>> developer to turn this off through some configuration param.
>>
>> Thanks!
>> Ben Neuman
>>
>>
>>
>>
>>
>
>

Re: Required Label Marker Placement

Posted by Gerhard <ge...@gmail.com>.
+1
i'll review and apply the patch as soon as you have finished the mentioned
features.

regards,
gerhard

http://www.irian.at

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

Professional Support for Apache MyFaces



2010/10/28 <ne...@ijet.com>

>  Hi all.
> I've been playing with the required label addon and have found that a
> modification in marker rendering has
> improved the appearance of my app.
> I just want to get feedback from the rest as to whether this might be a
> change worth integrating into your module.
>
> Essentially, the current implementation simply prepends the marker to the
> label (when applying marker before value).
> Visually, I do not like my required marker displacing the label. I would
> prefer that all labels, required and otherwise, align vertically based on
> the label text, and that the required markers appear left of this vertical
> alignment.
> As so:
> *First Name:
> *Last Name:
>  Middle Name:
>
> In order to do this, I've prepended the required marker where necessary and
> a space where not necessary.
> I have also set the font of the 'marker' to monospace.
>
> Would this be a worthy addition to the addon? We could of course allow the
> developer to turn this off through some configuration param.
>
> Thanks!
> Ben Neuman
>
>
>
>
>

Required Label Marker Placement

Posted by ne...@ijet.com.
Hi all. 
I've been playing with the required label addon and have found that a modification in marker rendering has 
improved the appearance of my app. 
I just want to get feedback from the rest as to whether this might be a change worth integrating into your module.
 
Essentially, the current implementation simply prepends the marker to the label (when applying marker before value).
Visually, I do not like my required marker displacing the label. I would prefer that all labels, required and otherwise, align vertically based on the label text, and that the required markers appear left of this vertical alignment.
As so:
*First Name:
*Last Name:
 Middle Name:
 
In order to do this, I've prepended the required marker where necessary and a space where not necessary. 
I have also set the font of the 'marker' to monospace.
 
Would this be a worthy addition to the addon? We could of course allow the developer to turn this off through some configuration param.
 
Thanks!
Ben Neuman
 
 
 
 

RE: NPE in Required Initialization for labels addon (property version)

Posted by ne...@ijet.com.
Great, I see the change in the bean-validation version. 
Don't forget the property version ;)
 
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -117,8 +117,11 @@
         }
         else
         {
+            String value = (String) uiOutput.getValue();
+            if (value != null) {
             applyRequiredMarkerUsingValue(facesContext, uiOutput, (String) uiOutput.getValue());
         }
+        }
         if (setEscapeToFalse)
         {
             doSetEscapeToFalse(uiOutput);

--Ben

-----Original Message-----
From: Gerhard [mailto:gerhard.petracek@gmail.com]
Sent: Wednesday, October 27, 2010 6:32 PM
To: MyFaces Development
Subject: Re: NPE in Required Initialization for labels addon (property version)


thx ben - i've committed it. 

regards,
gerhard

http://www.irian.at

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

Professional Support for Apache MyFaces




2010/10/27 < neumanb@ijet.com>


This null-check was also needed in the Bean Validation version.
 
Thanks!
Ben

-----Original Message-----
From: Ben Neuman 
Sent: Wednesday, October 27, 2010 11:31 AM
To: 'MyFaces Development'
Subject: NPE in Required Initialization for labels addon (property version)


I had to make a small change in the Required Initialization for labels (property version) to resolve a NullPointerException.
 
In DefaultRequiredLabelInitializer I added a null value check. Without, I was getting NullPointerExceptions.
 
protected void applyRequiredMarker(FacesContext facesContext, UIOutput uiOutput) 
{
    ValueExpression expression = uiOutput.getValueExpression("value");
 
        if (expression != null)
        {
            applyRequiredMarkerUsingExpression(facesContext, uiOutput, expression.getExpressionString());
        }
        else
        {
            String value = (String) uiOutput.getValue();
            if (value != null) {                
                applyRequiredMarkerUsingValue(facesContext, uiOutput, value);
            }
        }
        ...
}
 
Thanks!
Ben



Re: NPE in Required Initialization for labels addon (property version)

Posted by Gerhard <ge...@gmail.com>.
thx ben - i've committed it.

regards,
gerhard

http://www.irian.at

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

Professional Support for Apache MyFaces



2010/10/27 <ne...@ijet.com>

>  This null-check was also needed in the Bean Validation version.
>
> Thanks!
> Ben
>
> -----Original Message-----
> *From:* Ben Neuman
> *Sent:* Wednesday, October 27, 2010 11:31 AM
> *To:* 'MyFaces Development'
> *Subject:* NPE in Required Initialization for labels addon (property
> version)
>
> I had to make a small change in the Required Initialization for labels
> (property version) to resolve a NullPointerException.
>
> In DefaultRequiredLabelInitializer I added a null value check. Without, I
> was getting NullPointerExceptions.
>
> protected void applyRequiredMarker(FacesContext facesContext, UIOutput
> uiOutput)
> {
>     ValueExpression expression = uiOutput.getValueExpression("value");
>
>         if (expression != null)
>         {
>             applyRequiredMarkerUsingExpression(facesContext, uiOutput,
> expression.getExpressionString());
>         }
>         else
>         {
>             String value = (String) uiOutput.getValue();
>             if (value != null) {
>                 applyRequiredMarkerUsingValue(facesContext, uiOutput,
> value);
>             }
>         }
>         ...
> }
>
> Thanks!
> Ben
>
>

RE: NPE in Required Initialization for labels addon (property version)

Posted by ne...@ijet.com.
This null-check was also needed in the Bean Validation version.
 
Thanks!
Ben

-----Original Message-----
From: Ben Neuman 
Sent: Wednesday, October 27, 2010 11:31 AM
To: 'MyFaces Development'
Subject: NPE in Required Initialization for labels addon (property version)


I had to make a small change in the Required Initialization for labels (property version) to resolve a NullPointerException.
 
In DefaultRequiredLabelInitializer I added a null value check. Without, I was getting NullPointerExceptions.
 
protected void applyRequiredMarker(FacesContext facesContext, UIOutput uiOutput) 
{
    ValueExpression expression = uiOutput.getValueExpression("value");
 
        if (expression != null)
        {
            applyRequiredMarkerUsingExpression(facesContext, uiOutput, expression.getExpressionString());
        }
        else
        {
            String value = (String) uiOutput.getValue();
            if (value != null) {                
                applyRequiredMarkerUsingValue(facesContext, uiOutput, value);
            }
        }
        ...
}
 
Thanks!
Ben


NPE in Required Initialization for labels addon (property version)

Posted by ne...@ijet.com.
I had to make a small change in the Required Initialization for labels (property version) to resolve a NullPointerException.
 
In DefaultRequiredLabelInitializer I added a null value check. Without, I was getting NullPointerExceptions.
 
protected void applyRequiredMarker(FacesContext facesContext, UIOutput uiOutput) 
{
    ValueExpression expression = uiOutput.getValueExpression("value");
 
        if (expression != null)
        {
            applyRequiredMarkerUsingExpression(facesContext, uiOutput, expression.getExpressionString());
        }
        else
        {
            String value = (String) uiOutput.getValue();
            if (value != null) {                
                applyRequiredMarkerUsingValue(facesContext, uiOutput, value);
            }
        }
        ...
}
 
Thanks!
Ben

RE: ext-bv addon: Required Initialization for labels required change

Posted by ne...@ijet.com.
Rudy,
 
FYI, I am using both the bean-val and property versions together successfully (I reverted my change to the bean-val version).
 
Thanks!
Ben
 
ps. It was necessary to make a change in the property version to account for a NullPointerException. I'll start a new thread for that.
 
-Ben
 

-----Original Message-----
From: neumanb@ijet.com [mailto:neumanb@ijet.com]
Sent: Wednesday, October 27, 2010 10:31 AM
To: dev@myfaces.apache.org
Subject: RE: ext-bv addon: Required Initialization for labels required change


Rudy,
 
------"But commenting out the super.initComponent as you proposed will result in not recognizing the Bean validation annoations anymore."------
 
Thanks for the info. I'm sure I'll need both property and bean annotations on some properties. 
I'll try using both versions together.
 
Ben

-----Original Message-----
From: Rudy De Busscher [mailto:rdebusscher@gmail.com]
Sent: Wednesday, October 27, 2010 10:19 AM
To: MyFaces Development
Subject: Re: ext-bv addon: Required Initialization for labels required change


Ben,

There exists 2 version because the handling of Bean Validation annotations is completely different then the 'standard' ones (you are using JPA annotations but there exists also ExtVal annotations like @Required that do more or less the same as the Bean Validation annotations)

The issue that you have now is that the Required Label add-on (BV version) is not recognizing the NON Bean validation annotations.

I'll have a look now that I know more of the context.

Did you add only the bean-validation module to the project or also property-validation module ?

But commenting out the super.initComponent as you proposed will result in not recognizing the Bean validation annoations anymore.

Rudy.



On 27 October 2010 16:09, < neumanb@ijet.com> wrote:


Rudy, 
I haven't tried the non-bean version yet but was just wondering if this is the only difference between the two versions?
If so, why not just make one version that applies the correct component init/config method based on the annotation type (bean vs property)?
 
Ben

-----Original Message-----
From: neumanb@ijet.com [mailto: neumanb@ijet.com]
Sent: Wednesday, October 27, 2010 9:40 AM
To: dev@myfaces.apache.org
Subject: RE: ext-bv addon: Required Initialization for labels required change


Hi Rudy,
 
I am using both property and bean validation. The labels of concern, though, are annotated using @Column(...nullable=false). So perhaps we've discovered my issue. Thanks!
I will drop in the non-bean validation version and see how that works. 
Is there any reason why I can't/shouldn't use both?
 
Finally, the target component is standard JSF.
 
Thanks!
Ben
 

-----Original Message-----
From: Rudy De Busscher [mailto: rdebusscher@gmail.com]
Sent: Wednesday, October 27, 2010 8:40 AM
To: MyFaces Development
Subject: Re: ext-bv addon: Required Initialization for labels required change


Hello Ben,

I made a few checks and within my examples everything works (they don't use Richfaces however).  Can it be that you are mixing some environments ??

The line of code 
ExtValUtils.configureComponentWithMetaData(facesContext, targetComponent, ExtValUtils.getTransformedMetaData(facesContext, targetComponent));

is typical for the usage WITHOUT bean validation.

Are you using bean validation annotations (like javax.validation.constraints.NotNull) on your properties?

If not, there exists also an add-on for the non bean validation version.


Is the target component a richfaces faces component or a standard JSF one ??

I try to check with a RichFaces component tomorrow.

regards
Rudy.



On 26 October 2010 22:32, Gerhard < gerhard.petracek@gmail.com> wrote:


hi ben, 

thx for the information - we will check it!
(we haven't released the add-on - so we have to do some final tests.)

@rudy:
it would be nice if you can check the change with your applications.


regards,
gerhard

http://www.irian.at

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

Professional Support for Apache MyFaces




2010/10/26 < neumanb@ijet.com> 



Just a short note that may be of interest. 
I was unable to get the ext-bv addon: Required Initialization for labels working "out of the box". 

After modifying at.gp.web.jsf.extval.beanval.label.interceptor.BeanValidationAwareLabelRendererInterceptor as follows, it seems to work well now. 

protected void initComponent(FacesContext facesContext, UIComponent uiComponent) 
    { 
        ... 
        //super.initComponent(facesContext, targetComponent); 
        ExtValUtils.configureComponentWithMetaData(facesContext, targetComponent, ExtValUtils.getTransformedMetaData(facesContext, targetComponent));

        ... 
    } 

Any thoughts on this change? Is it appropriate? 
By the way, my web-app uses JSF 1.2, Facelets, RichFaces (3.3.3), Restfaces, and Orchestra. 

Thanks! 
Ben 





RE: ext-bv addon: Required Initialization for labels required change

Posted by ne...@ijet.com.
Rudy,
 
------"But commenting out the super.initComponent as you proposed will result in not recognizing the Bean validation annoations anymore."------
 
Thanks for the info. I'm sure I'll need both property and bean annotations on some properties. 
I'll try using both versions together.
 
Ben

-----Original Message-----
From: Rudy De Busscher [mailto:rdebusscher@gmail.com]
Sent: Wednesday, October 27, 2010 10:19 AM
To: MyFaces Development
Subject: Re: ext-bv addon: Required Initialization for labels required change


Ben,

There exists 2 version because the handling of Bean Validation annotations is completely different then the 'standard' ones (you are using JPA annotations but there exists also ExtVal annotations like @Required that do more or less the same as the Bean Validation annotations)

The issue that you have now is that the Required Label add-on (BV version) is not recognizing the NON Bean validation annotations.

I'll have a look now that I know more of the context.

Did you add only the bean-validation module to the project or also property-validation module ?

But commenting out the super.initComponent as you proposed will result in not recognizing the Bean validation annoations anymore.

Rudy.



On 27 October 2010 16:09, < neumanb@ijet.com> wrote:


Rudy, 
I haven't tried the non-bean version yet but was just wondering if this is the only difference between the two versions?
If so, why not just make one version that applies the correct component init/config method based on the annotation type (bean vs property)?
 
Ben

-----Original Message-----
From: neumanb@ijet.com [mailto: neumanb@ijet.com]
Sent: Wednesday, October 27, 2010 9:40 AM
To: dev@myfaces.apache.org
Subject: RE: ext-bv addon: Required Initialization for labels required change


Hi Rudy,
 
I am using both property and bean validation. The labels of concern, though, are annotated using @Column(...nullable=false). So perhaps we've discovered my issue. Thanks!
I will drop in the non-bean validation version and see how that works. 
Is there any reason why I can't/shouldn't use both?
 
Finally, the target component is standard JSF.
 
Thanks!
Ben
 

-----Original Message-----
From: Rudy De Busscher [mailto: rdebusscher@gmail.com]
Sent: Wednesday, October 27, 2010 8:40 AM
To: MyFaces Development
Subject: Re: ext-bv addon: Required Initialization for labels required change


Hello Ben,

I made a few checks and within my examples everything works (they don't use Richfaces however).  Can it be that you are mixing some environments ??

The line of code 
ExtValUtils.configureComponentWithMetaData(facesContext, targetComponent, ExtValUtils.getTransformedMetaData(facesContext, targetComponent));

is typical for the usage WITHOUT bean validation.

Are you using bean validation annotations (like javax.validation.constraints.NotNull) on your properties?

If not, there exists also an add-on for the non bean validation version.


Is the target component a richfaces faces component or a standard JSF one ??

I try to check with a RichFaces component tomorrow.

regards
Rudy.



On 26 October 2010 22:32, Gerhard < gerhard.petracek@gmail.com> wrote:


hi ben, 

thx for the information - we will check it!
(we haven't released the add-on - so we have to do some final tests.)

@rudy:
it would be nice if you can check the change with your applications.


regards,
gerhard

http://www.irian.at

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

Professional Support for Apache MyFaces




2010/10/26 < neumanb@ijet.com> 



Just a short note that may be of interest. 
I was unable to get the ext-bv addon: Required Initialization for labels working "out of the box". 

After modifying at.gp.web.jsf.extval.beanval.label.interceptor.BeanValidationAwareLabelRendererInterceptor as follows, it seems to work well now. 

protected void initComponent(FacesContext facesContext, UIComponent uiComponent) 
    { 
        ... 
        //super.initComponent(facesContext, targetComponent); 
        ExtValUtils.configureComponentWithMetaData(facesContext, targetComponent, ExtValUtils.getTransformedMetaData(facesContext, targetComponent));

        ... 
    } 

Any thoughts on this change? Is it appropriate? 
By the way, my web-app uses JSF 1.2, Facelets, RichFaces (3.3.3), Restfaces, and Orchestra. 

Thanks! 
Ben 





Re: ext-bv addon: Required Initialization for labels required change

Posted by Rudy De Busscher <rd...@gmail.com>.
Ben,

There exists 2 version because the handling of Bean Validation annotations
is completely different then the 'standard' ones (you are using JPA
annotations but there exists also ExtVal annotations like @Required that do
more or less the same as the Bean Validation annotations)

The issue that you have now is that the Required Label add-on (BV version)
is not recognizing the NON Bean validation annotations.

I'll have a look now that I know more of the context.

Did you add only the bean-validation module to the project or also
property-validation module ?

But commenting out the super.initComponent as you proposed will result in
not recognizing the Bean validation annoations anymore.

Rudy.


On 27 October 2010 16:09, <ne...@ijet.com> wrote:

>  Rudy,
> I haven't tried the non-bean version yet but was just wondering if this is
> the only difference between the two versions?
> If so, why not just make one version that applies the correct component
> init/config method based on the annotation type (bean vs property)?
>
> Ben
>
> -----Original Message-----
> *From:* neumanb@ijet.com [mailto:neumanb@ijet.com]
> *Sent:* Wednesday, October 27, 2010 9:40 AM
> *To:* dev@myfaces.apache.org
> *Subject:* RE: ext-bv addon: Required Initialization for labels required
> change
>
> Hi Rudy,
>
> I am using both property and bean validation. The labels of concern,
> though, are annotated using @Column(...nullable=false). So perhaps we've
> discovered my issue. Thanks!
> I will drop in the non-bean validation version and see how that works.
> Is there any reason why I can't/shouldn't use both?
>
> Finally, the target component is standard JSF.
>
> Thanks!
> Ben
>
>
> -----Original Message-----
> *From:* Rudy De Busscher [mailto:rdebusscher@gmail.com]
> *Sent:* Wednesday, October 27, 2010 8:40 AM
> *To:* MyFaces Development
> *Subject:* Re: ext-bv addon: Required Initialization for labels required
> change
>
> Hello Ben,
>
> I made a few checks and within my examples everything works (they don't use
> Richfaces however).  Can it be that you are mixing some environments ??
>
> The line of code
> *ExtValUtils.**configureComponentWithMetaData**(facesContext,
> targetComponent, ExtValUtils.**getTransformedMetaData(**facesContext,
> targetComponent));*
>
> is typical for the usage WITHOUT bean validation.
>
> Are you using bean validation annotations (like
> javax.validation.constraints.NotNull) on your properties?
>
> If not, there exists also an add-on for the non bean validation version.
>
>
> Is the target component a richfaces faces component or a standard JSF one
> ??
>
> I try to check with a RichFaces component tomorrow.
>
> regards
> Rudy.
>
>
> On 26 October 2010 22:32, Gerhard <ge...@gmail.com> wrote:
>
>> hi ben,
>>
>> thx for the information - we will check it!
>> (we haven't released the add-on - so we have to do some final tests.)
>>
>> @rudy:
>> it would be nice if you can check the change with your applications.
>>
>> regards,
>> gerhard
>>
>> http://www.irian.at
>>
>> Your JSF powerhouse -
>> JSF Consulting, Development and
>> Courses in English and German
>>
>> Professional Support for Apache MyFaces
>>
>>
>>
>> 2010/10/26 <ne...@ijet.com>
>>
>>
>>> Just a short note that may be of interest.
>>> I was unable to get the ext-bv addon: Required Initialization for labels
>>> working "out of the box".
>>>
>>> After modifying
>>> at.gp.web.jsf.extval.beanval.label.interceptor.BeanValidationAwareLabelRendererInterceptor
>>> as follows, it seems to work well now.
>>>
>>> protected void initComponent(FacesContext facesContext, UIComponent
>>> uiComponent)
>>>     {
>>>         ...
>>>         //super.initComponent(facesContext, targetComponent);
>>>         ExtValUtils.configureComponentWithMetaData(facesContext,
>>> targetComponent, ExtValUtils.getTransformedMetaData(facesContext,
>>> targetComponent));
>>>
>>>         ...
>>>     }
>>>
>>> Any thoughts on this change? Is it appropriate?
>>> By the way, my web-app uses JSF 1.2, Facelets, RichFaces (3.3.3),
>>> Restfaces, and Orchestra.
>>>
>>> Thanks!
>>> Ben
>>>
>>
>>
>

RE: ext-bv addon: Required Initialization for labels required change

Posted by ne...@ijet.com.
Rudy, 
I haven't tried the non-bean version yet but was just wondering if this is the only difference between the two versions?
If so, why not just make one version that applies the correct component init/config method based on the annotation type (bean vs property)?
 
Ben

-----Original Message-----
From: neumanb@ijet.com [mailto:neumanb@ijet.com]
Sent: Wednesday, October 27, 2010 9:40 AM
To: dev@myfaces.apache.org
Subject: RE: ext-bv addon: Required Initialization for labels required change


Hi Rudy,
 
I am using both property and bean validation. The labels of concern, though, are annotated using @Column(...nullable=false). So perhaps we've discovered my issue. Thanks!
I will drop in the non-bean validation version and see how that works. 
Is there any reason why I can't/shouldn't use both?
 
Finally, the target component is standard JSF.
 
Thanks!
Ben
 

-----Original Message-----
From: Rudy De Busscher [mailto:rdebusscher@gmail.com]
Sent: Wednesday, October 27, 2010 8:40 AM
To: MyFaces Development
Subject: Re: ext-bv addon: Required Initialization for labels required change


Hello Ben,

I made a few checks and within my examples everything works (they don't use Richfaces however).  Can it be that you are mixing some environments ??

The line of code 
ExtValUtils.configureComponentWithMetaData(facesContext, targetComponent, ExtValUtils.getTransformedMetaData(facesContext, targetComponent));

is typical for the usage WITHOUT bean validation.

Are you using bean validation annotations (like javax.validation.constraints.NotNull) on your properties?

If not, there exists also an add-on for the non bean validation version.


Is the target component a richfaces faces component or a standard JSF one ??

I try to check with a RichFaces component tomorrow.

regards
Rudy.



On 26 October 2010 22:32, Gerhard < gerhard.petracek@gmail.com> wrote:


hi ben, 

thx for the information - we will check it!
(we haven't released the add-on - so we have to do some final tests.)

@rudy:
it would be nice if you can check the change with your applications.


regards,
gerhard

http://www.irian.at

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

Professional Support for Apache MyFaces




2010/10/26 < neumanb@ijet.com> 



Just a short note that may be of interest. 
I was unable to get the ext-bv addon: Required Initialization for labels working "out of the box". 

After modifying at.gp.web.jsf.extval.beanval.label.interceptor.BeanValidationAwareLabelRendererInterceptor as follows, it seems to work well now. 

protected void initComponent(FacesContext facesContext, UIComponent uiComponent) 
    { 
        ... 
        //super.initComponent(facesContext, targetComponent); 
        ExtValUtils.configureComponentWithMetaData(facesContext, targetComponent, ExtValUtils.getTransformedMetaData(facesContext, targetComponent));

        ... 
    } 

Any thoughts on this change? Is it appropriate? 
By the way, my web-app uses JSF 1.2, Facelets, RichFaces (3.3.3), Restfaces, and Orchestra. 

Thanks! 
Ben 




RE: ext-bv addon: Required Initialization for labels required change

Posted by ne...@ijet.com.
Hi Rudy,
 
I am using both property and bean validation. The labels of concern, though, are annotated using @Column(...nullable=false). So perhaps we've discovered my issue. Thanks!
I will drop in the non-bean validation version and see how that works. 
Is there any reason why I can't/shouldn't use both?
 
Finally, the target component is standard JSF.
 
Thanks!
Ben
 

-----Original Message-----
From: Rudy De Busscher [mailto:rdebusscher@gmail.com]
Sent: Wednesday, October 27, 2010 8:40 AM
To: MyFaces Development
Subject: Re: ext-bv addon: Required Initialization for labels required change


Hello Ben,

I made a few checks and within my examples everything works (they don't use Richfaces however).  Can it be that you are mixing some environments ??

The line of code 
ExtValUtils.configureComponentWithMetaData(facesContext, targetComponent, ExtValUtils.getTransformedMetaData(facesContext, targetComponent));

is typical for the usage WITHOUT bean validation.

Are you using bean validation annotations (like javax.validation.constraints.NotNull) on your properties?

If not, there exists also an add-on for the non bean validation version.


Is the target component a richfaces faces component or a standard JSF one ??

I try to check with a RichFaces component tomorrow.

regards
Rudy.



On 26 October 2010 22:32, Gerhard < gerhard.petracek@gmail.com> wrote:


hi ben, 

thx for the information - we will check it!
(we haven't released the add-on - so we have to do some final tests.)

@rudy:
it would be nice if you can check the change with your applications.


regards,
gerhard

http://www.irian.at

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

Professional Support for Apache MyFaces




2010/10/26 < neumanb@ijet.com> 



Just a short note that may be of interest. 
I was unable to get the ext-bv addon: Required Initialization for labels working "out of the box". 

After modifying at.gp.web.jsf.extval.beanval.label.interceptor.BeanValidationAwareLabelRendererInterceptor as follows, it seems to work well now. 

protected void initComponent(FacesContext facesContext, UIComponent uiComponent) 
    { 
        ... 
        //super.initComponent(facesContext, targetComponent); 
        ExtValUtils.configureComponentWithMetaData(facesContext, targetComponent, ExtValUtils.getTransformedMetaData(facesContext, targetComponent));

        ... 
    } 

Any thoughts on this change? Is it appropriate? 
By the way, my web-app uses JSF 1.2, Facelets, RichFaces (3.3.3), Restfaces, and Orchestra. 

Thanks! 
Ben 




Re: ext-bv addon: Required Initialization for labels required change

Posted by Rudy De Busscher <rd...@gmail.com>.
Hello Ben,

I made a few checks and within my examples everything works (they don't use
Richfaces however).  Can it be that you are mixing some environments ??

The line of code
* ExtValUtils.**configureComponentWithMetaData**(facesContext,
targetComponent, ExtValUtils.**getTransformedMetaData(**facesContext,
targetComponent));*

is typical for the usage WITHOUT bean validation.

Are you using bean validation annotations (like
javax.validation.constraints.NotNull) on your properties?

If not, there exists also an add-on for the non bean validation version.


Is the target component a richfaces faces component or a standard JSF one ??

I try to check with a RichFaces component tomorrow.

regards
Rudy.


On 26 October 2010 22:32, Gerhard <ge...@gmail.com> wrote:

> hi ben,
>
> thx for the information - we will check it!
> (we haven't released the add-on - so we have to do some final tests.)
>
> @rudy:
> it would be nice if you can check the change with your applications.
>
> regards,
> gerhard
>
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>
>
>
> 2010/10/26 <ne...@ijet.com>
>
>
>> Just a short note that may be of interest.
>> I was unable to get the ext-bv addon: Required Initialization for labels
>> working "out of the box".
>>
>> After modifying
>> at.gp.web.jsf.extval.beanval.label.interceptor.BeanValidationAwareLabelRendererInterceptor
>> as follows, it seems to work well now.
>>
>> protected void initComponent(FacesContext facesContext, UIComponent
>> uiComponent)
>>     {
>>         ...
>>         //super.initComponent(facesContext, targetComponent);
>>         ExtValUtils.configureComponentWithMetaData(facesContext,
>> targetComponent, ExtValUtils.getTransformedMetaData(facesContext,
>> targetComponent));
>>
>>         ...
>>     }
>>
>> Any thoughts on this change? Is it appropriate?
>> By the way, my web-app uses JSF 1.2, Facelets, RichFaces (3.3.3),
>> Restfaces, and Orchestra.
>>
>> Thanks!
>> Ben
>>
>
>