You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Gregg Bolinger <gd...@gmail.com> on 2006/06/06 17:03:02 UTC

Client Side Validation

I could have sworm MyFaces could do Client Side (Javascript) validation.  Am
I wrong?  I've search the web and mailing lists and didn't fine anything.

Thanks.

Gregg

Re: Client Side Validation

Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi!
> Ugh, thanks but no thanks. :)  I'll just right my own javascript until
> something else comes along as part of MyFaces.
There is no need to be shy against struts-shale, its a very slim library
for JSF - you didnt need the whole struts stuff.
Though, I understand when you try to avoid any new dependency, I try the
same ;-)

Ciao,
Mario


Re: Client Side Validation

Posted by Gregg Bolinger <gd...@gmail.com>.
Ugh, thanks but no thanks. :)  I'll just right my own javascript until
something else comes along as part of MyFaces.

Gregg

On 6/6/06, Mario Ivankovits <ma...@ops.co.at> wrote:
>
> Hi Gregg!
> > I could have sworm MyFaces could do Client Side (Javascript)
> > validation.  Am I wrong?  I've search the web and mailing lists and
> > didn't fine anything.
> For now you can use struts-shale validation:
> http://struts.apache.org/struts-shale/features-commons-validator.html
> There you will find some validation tags which can do both - client and
> server side navigation.
>
> There is effort to integrate such a beast in MyFaces out of the box.
>
> Ciao,
> Mario
>
>

Re: Client Side Validation

Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi Gregg!
> I could have sworm MyFaces could do Client Side (Javascript)
> validation.  Am I wrong?  I've search the web and mailing lists and
> didn't fine anything.
For now you can use struts-shale validation:
http://struts.apache.org/struts-shale/features-commons-validator.html
There you will find some validation tags which can do both - client and
server side navigation.

There is effort to integrate such a beast in MyFaces out of the box.

Ciao,
Mario


Re: navigation rule

Posted by Cosma Colanicchia <co...@gmail.com>.
The default suffix is appended in the myfaces ViewHandler
implementation. Omitting the DEFAULT_SUFFIX init parameter causes a
"default" default suffix to be used, that is .jsp :-)

It seems that the default suffix is applied only if using extension
mapping for your jsf pages.. you could try to use a /faces/* mapping
and see if this resolve your problem.


Cosma

2006/6/6, L Frohman <lf...@gmail.com>:
> In the <to-view-id> tag in faces-config.xml navigation, myfaces always
> puts a / in front and adds .jsp at the end of any urls, if those are not
> already there. Is there a way to prevent this behaviour? I want to
> navigate to the acegi security filter,
>
> <to-view-id>j_acegi_security_check</to-view-id>
>
> but I get an error "/j_acegi_security_check.jsp" not found.
>
> Thanks,
> Lance
>
>

navigation rule

Posted by L Frohman <lf...@gmail.com>.
In the <to-view-id> tag in faces-config.xml navigation, myfaces always
puts a / in front and adds .jsp at the end of any urls, if those are not
already there. Is there a way to prevent this behaviour? I want to
navigate to the acegi security filter, 
 
<to-view-id>j_acegi_security_check</to-view-id>
 
but I get an error "/j_acegi_security_check.jsp" not found.
 
Thanks,
Lance


Re: Client Side Validation

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

tomahawk-sandbox?, yes, that was what I thought at first actually.

I've read the discussion on the dev list from nabble, let's see how it fits
and then the discussion can continue after seeing some stuff in action
rather than in theory.

Next week hopefully, I'll be presenting the results.

Regards,

Cagatay
www.jroller.com/page/cagataycivici

On 6/6/06, Mario Ivankovits <ma...@ops.co.at> wrote:
>
> Hi Cagatay!
> > Sure it's under ASL Mario, I'm just extending to the tomahawk.
> Great, just, could you please place it in tomahawk-sandbox at first.
> A short discussion on myfaces-dev about this topic brought up
> immediately additional ideas which we have to take into account then.
>
>
> Thanks!
> Ciao,
> Mario
>
>

Re: creating a custom component by aggregation

Posted by Andrew Robinson <an...@gmail.com>.
I've done it without facelets, but it was tricky. I had to create the
components in the constructor, and set their parent attribute, but not
add them to the children list. Then I had to maintain their state
myself in the restoreState and saveState functions.

The only side affect it had was that parent components wanting to
"surf" the component tree would not find my inner components as I
never added them to the children list.

If I had the time I could have found out where the components were
getting added back to the parent during the restore view phase, but I
didn't bother since I got it working the above way.

Something like:

public class MyCompositeComponent extends UIComponentBase {
...
private UICommand myInner;

public MyCompositeComponent() {
  myInner = (UICommand)getFacesContext().getApplication().createComponent(
    UICommand.COMPONENT_TYPE;
  myInner.setParent(this);
  myInner.setId(...);
}

public void restoreState(FacesContext context, Object state) {
  Object[] array = (Object[])state;
  super.restoreState(context, array[0]);
  myInner.restoreState(context, array[1]);
}

public Object saveState(FacesContext context) {
  return new Object[] {
    super.saveState(context),
    myInner.saveState(context)
  };
}

On 6/7/06, Ionut S <si...@yahoo.com> wrote:
> I would accept your suggestion right away, but we really need to have a JSF
> component in order to add it to the tree component dynamically. Is this
> possible with facelets ?
>
>
>
> Murray Brandon <mu...@hotmagna.com> wrote:
>
>  With Facelets templating over the top of JSF it's dead easy - you just
> include some xhtml that has any number of components inside it:
>
>
>
>
> value="#{selectedPerson.telephoneNo}"/>
>
>
>
>
> We use it for all our widget controls on this project even if its a 1:1
> correllation, that way we can chop and change which JSF components we
> use at the end of the day.
> The only trick is for small sets of components you don't display/not
> display using tags, but use of the rendered=" property on the
>
> components instead.
> It works.
>
> Regards, Murray
>
> Ionut S wrote:
> > Hi,
> > I was wondering if somebody had any success in writing a custom
> > component that aggregates other existing components ?
> >
> > For example, creating a component that extends UIPanel and adding to
> > its children 2 existing components (a label and a combo box, let's say)..
> >
> > Thank you !
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam? Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> >
>
>
>
>
>
>  __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com

Re: creating a custom component by aggregation

Posted by Ionut S <si...@yahoo.com>.
I would accept your suggestion right away, but we really need to have a JSF component in order to add it to the tree component dynamically. Is this possible with facelets ?


Murray Brandon <mu...@hotmagna.com> wrote: With Facelets templating over the top of JSF it's dead easy - you just 
include some xhtml that has any number of components inside it:

                
                    
                    
value="#{selectedPerson.telephoneNo}"/>
                    
                

We use it for all our widget controls on this project even if its a 1:1 
correllation, that way we can chop and change which JSF components we 
use at the end of the day.
The only trick is for small sets of components you don't display/not 
display using  tags, but use of the rendered=" property on the 
components instead.
It works.

Regards, Murray

Ionut S wrote:
> Hi,
> I was wondering if somebody had any success in writing a custom 
> component that aggregates other existing components ?
>
> For example, creating a component that extends UIPanel and adding to 
> its children 2 existing components (a label and a combo box, let's say)..
>
> Thank you !
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>



 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: creating a custom component by aggregation

Posted by Murray Brandon <mu...@hotmagna.com>.
With Facelets templating over the top of JSF it's dead easy - you just 
include some xhtml that has any number of components inside it:

                <ui:include src="#{config.urlControls}text.xhtml">
                    <ui:param name="label" value="Telephone:"/>
                    <ui:param name="property" 
value="#{selectedPerson.telephoneNo}"/>
                    <ui:param name="rendered" value="true"/>
                </ui:include>

We use it for all our widget controls on this project even if its a 1:1 
correllation, that way we can chop and change which JSF components we 
use at the end of the day.
The only trick is for small sets of components you don't display/not 
display using <c:if> tags, but use of the rendered=" property on the 
components instead.
It works.

Regards, Murray

Ionut S wrote:
> Hi,
> I was wondering if somebody had any success in writing a custom 
> component that aggregates other existing components ?
>
> For example, creating a component that extends UIPanel and adding to 
> its children 2 existing components (a label and a combo box, let's say)..
>
> Thank you !
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>


creating a custom component by aggregation

Posted by Ionut S <si...@yahoo.com>.
Hi,
I was wondering if somebody had any success in writing a custom component that aggregates other existing components ? 

For example, creating a component that extends UIPanel and adding to its children 2 existing components (a label and a combo box, let's say)..

Thank you !

 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Client Side Validation

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

Yes, it should not be a problem, I already have a signed ICLA.

Cagatay

On 6/7/06, Mario Ivankovits <ma...@ops.co.at> wrote:
>
> Hi!
> >
> > Is there any IP issue here to solve?
> (IP - intellectual property, for those not knowing whats meant here ;-) )
>
> Due to the size of this contribution (its not only a patch) a CCLA is
> required.
> According to http://people.apache.org/~jim/committers.html Cagaty is
> already filed.
>
>
> Ciao,
> Mario
>
>

Re: Client Side Validation

Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi!
>
> Is there any IP issue here to solve?
(IP - intellectual property, for those not knowing whats meant here ;-) )

Due to the size of this contribution (its not only a patch) a CCLA is
required.
According to http://people.apache.org/~jim/committers.html Cagaty is
already filed.


Ciao,
Mario


Re: Client Side Validation

Posted by Matthias Wessendorf <ma...@apache.org>.
On 6/6/06, Mario Ivankovits <ma...@ops.co.at> wrote:
> Hi Cagatay!
> > Sure it's under ASL Mario, I'm just extending to the tomahawk.
> Great, just, could you please place it in tomahawk-sandbox at first.

Is there any IP issue here to solve?

-Matthias

> A short discussion on myfaces-dev about this topic brought up
> immediately additional ideas which we have to take into account then.
>
>
> Thanks!
> Ciao,
> Mario
>
>


-- 
Matthias Wessendorf
Aechterhoek 18
48282 Emsdetten
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

Re: Client Side Validation

Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi Cagatay!
> Sure it's under ASL Mario, I'm just extending to the tomahawk.
Great, just, could you please place it in tomahawk-sandbox at first.
A short discussion on myfaces-dev about this topic brought up
immediately additional ideas which we have to take into account then.


Thanks!
Ciao,
Mario


Re: Client Side Validation

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

Sure it's under ASL Mario, I'm just extending to the tomahawk.

Cagatay,

On 6/6/06, Cagatay Civici <ca...@gmail.com> wrote:
>
> Hi Matthias,
>
> With beta I actually mean the some of the validators like required
> validator, email validator and etc.. The rest of the validation becomes
> trivial after the infrastructure is completed.
>
> Sure, I'll send an announcement to the dev list.
>
> Regards,
>
> Cagatay "The Lunatic" Civici
>
>
>
>
>
>
> On 6/6/06, Matthias Wessendorf <matzew@apache.org > wrote:
> >
> > > Do I sound like a client validation lunatic?
> >
> > you do :-)
> >
> > And no popup is very cool.
> >
> > can you send an announcement to our dev-list, when the "beta" is
> > available ?
> >
> > -Matthias
> >
>
>

Re: Client Side Validation

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

With beta I actually mean the some of the validators like required
validator, email validator and etc.. The rest of the validation becomes
trivial after the infrastructure is completed.

Sure, I'll send an announcement to the dev list.

Regards,

Cagatay "The Lunatic" Civici





On 6/6/06, Matthias Wessendorf <ma...@apache.org> wrote:
>
> > Do I sound like a client validation lunatic?
>
> you do :-)
>
> And no popup is very cool.
>
> can you send an announcement to our dev-list, when the "beta" is available
> ?
>
> -Matthias
>

Re: Client Side Validation

Posted by Matthias Wessendorf <ma...@apache.org>.
> Do I sound like a client validation lunatic?

you do :-)

And no popup is very cool.

can you send an announcement to our dev-list, when the "beta" is available ?

-Matthias

Re: Client Side Validation

Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi Cagatay!
> Do I sound like a client validation lunatic?
Sure, you do ;-)

When can we take it over to MyFaces? :-D
What about the licensing, is it all under ASL? If not PLEASE prepare it
so before contribute it ;-)

Ciao,
Mario


Re: Client Side Validation

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

Nowadays I become a true JSF Client Side Validaton monster.

I am very close to finish my beta work on the extended validators in
tomahawk. The good thing is that only thing needed to turn on the client
validation is to set a context param ENABLE_CLIENT_VALIDATION to true. There
is "no need" to change anything on pages built with myfaces.

Also today as a result of a demand, I've integrated shale's commons
validators to the project I'm working for. I've changed the renderers of
h:message components to get rid of the annoying popups. Doing so I was able
to display the validation messages in place with h:message and h:messages.

In addition I'm about to release the latest version of my own library for
client validation.

Do I sound like a client validation lunatic?

Cheers,

Cagatay


On 6/6/06, Dave Brondsema <da...@brondsema.net> wrote:
>
> Cagatay's client side validators are at
> http://jsf-comp.sourceforge.net/components/clientvalidators/index.html
>
> Matthias Wessendorf wrote:
> > Cagatay is about to adding something
> >
> > -Matthias
> >
> > On 6/6/06, Gregg Bolinger <gd...@gmail.com> wrote:
> >> I could have sworm MyFaces could do Client Side (Javascript)
> >> validation.  Am
> >> I wrong?  I've search the web and mailing lists and didn't fine
> anything.
> >>
> >> Thanks.
> >>
> >> Gregg
> >>
> >
> >
>
>
> --
> Dave Brondsema
> Software Developer
> Cornerstone University
>
>
>
>

Re: Client Side Validation

Posted by Dave Brondsema <da...@brondsema.net>.
Cagatay's client side validators are at
http://jsf-comp.sourceforge.net/components/clientvalidators/index.html

Matthias Wessendorf wrote:
> Cagatay is about to adding something
> 
> -Matthias
> 
> On 6/6/06, Gregg Bolinger <gd...@gmail.com> wrote:
>> I could have sworm MyFaces could do Client Side (Javascript)
>> validation.  Am
>> I wrong?  I've search the web and mailing lists and didn't fine anything.
>>
>> Thanks.
>>
>> Gregg
>>
> 
> 


-- 
Dave Brondsema
Software Developer
Cornerstone University


Re: Client Side Validation

Posted by Matthias Wessendorf <ma...@apache.org>.
Cagatay is about to adding something

-Matthias

On 6/6/06, Gregg Bolinger <gd...@gmail.com> wrote:
> I could have sworm MyFaces could do Client Side (Javascript) validation.  Am
> I wrong?  I've search the web and mailing lists and didn't fine anything.
>
> Thanks.
>
> Gregg
>


-- 
Matthias Wessendorf
Aechterhoek 18
48282 Emsdetten
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com