You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Charles Moulliard <cm...@gmail.com> on 2009/09/23 16:13:41 UTC
Date validation in a form
I would like to know How I can validate the string date inputted by a
user in a textfield of my form ?
e.g : The SimpleDateformat to be used to create a java Date is : dd/MM/yyyy
So I would like to check that the user has well introduced its date
using this format
Regards,
Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer
*****************************
blog : http://cmoulliard.blogspot.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Date validation in a form
Posted by Reinout van Schouwen <re...@gmail.com>.
Hi,
Op woensdag 23-09-2009 om 10:38 uur [tijdzone -0700], schreef Igor
Vaynberg:
> see DateTextField in extensions
>
> > e.g : The SimpleDateformat to be used to create a java Date is : dd/MM/yyyy
> > So I would like to check that the user has well introduced its date
> > using this format
I happened to be looking for the same thing yesterday (more specifically
about how to do client side validation) and found these two interesting
links:
http://www.jroller.com/wireframe/entry/wicket_client_side_validation
http://cwiki.apache.org/WICKET/fancy-validation-using-ajax-alternatives-to-feedbackpanel.html
regards,
--
Reinout van Schouwen
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Date validation in a form
Posted by Igor Vaynberg <ig...@gmail.com>.
see DateTextField in extensions
-igor
On Wed, Sep 23, 2009 at 7:13 AM, Charles Moulliard <cm...@gmail.com> wrote:
> I would like to know How I can validate the string date inputted by a
> user in a textfield of my form ?
>
> e.g : The SimpleDateformat to be used to create a java Date is : dd/MM/yyyy
> So I would like to check that the user has well introduced its date
> using this format
>
> Regards,
>
> Charles Moulliard
> Senior Enterprise Architect
> Apache Camel Committer
>
> *****************************
> blog : http://cmoulliard.blogspot.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
RE: maven/quickstart question
Posted by Chris Colman <ch...@stepaheadsoftware.com>.
Cool, thanks for the info. That repository looks like the manually
managed one I maintain for ant's use to allow sharing of jars across
multiple projects. I guess maven has automated that process somewhat.
> The default value is ${user.home}/.m2/repository. This element
> is especially useful for a main build server allowing all logged-in
users
> to build from a common local repository.
>
> On Wed, Sep 23, 2009 at 11:01 PM, Chris Colman
> <chrisc@stepaheadsoftware.com
> > wrote:
>
> > I've been using wicket under for a while now, always using ant, but
now
> > I have to create a quickstart app and I'm new to maven...
> >
> > I've created the quickstart app and it runs under Jetty no problem
but
> > where does it store the Wicket and Jetty .jars?
> >
> > They don't seem to be under the directory I created using the maven
> > 'archetype:create' command.
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
>
> --
> Pedro Henrique Oliveira dos Santos
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: maven/quickstart question
Posted by Pedro Santos <pe...@gmail.com>.
They probably are at user home. You can know more about maven settings at:
http://maven.apache.org/settings.html
*
localRepository*: This value is the path of this build system's local
repository. The default value is ${user.home}/.m2/repository. This element
is especially useful for a main build server allowing all logged-in users to
build from a common local repository.
On Wed, Sep 23, 2009 at 11:01 PM, Chris Colman <chrisc@stepaheadsoftware.com
> wrote:
> I've been using wicket under for a while now, always using ant, but now
> I have to create a quickstart app and I'm new to maven...
>
> I've created the quickstart app and it runs under Jetty no problem but
> where does it store the Wicket and Jetty .jars?
>
> They don't seem to be under the directory I created using the maven
> 'archetype:create' command.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Pedro Henrique Oliveira dos Santos
maven/quickstart question
Posted by Chris Colman <ch...@stepaheadsoftware.com>.
I've been using wicket under for a while now, always using ant, but now
I have to create a quickstart app and I'm new to maven...
I've created the quickstart app and it runs under Jetty no problem but
where does it store the Wicket and Jetty .jars?
They don't seem to be under the directory I created using the maven
'archetype:create' command.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
AW: FXValidationAjaxHandler - Javascript not added if component is set visible(false) in page constructor
Posted by "Giambalvo, Christian" <Ch...@excelsisnet.com>.
maybe i'm to stupid to understand what you mean.
so please provide an example.
thx
-----Ursprüngliche Nachricht-----
Von: Giambalvo, Christian [mailto:Christian.Giambalvo@excelsisnet.com]
Gesendet: Do 24.09.2009 02:45
An: users@wicket.apache.org
Betreff: AW: FXValidationAjaxHandler - Javascript not added if component is set visible(false) in page constructor
well, it makes no sense to add the javascript to another container.
how should i validate the textfields if the javascript points to a different component?
or could you give me an example?
-----Ursprüngliche Nachricht-----
Von: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
Gesendet: Do 24.09.2009 02:32
An: users@wicket.apache.org
Betreff: Re: FXValidationAjaxHandler - Javascript not added if component is set visible(false) in page constructor
i meant add the javascript to a container that is visible.
components that are not visible do not render their javascript, it
wouldnt make any sense for them to do otherwise.
-igor
On Wed, Sep 23, 2009 at 5:16 PM, Giambalvo, Christian
<Ch...@excelsisnet.com> wrote:
> i'm sorry, but doesn't work.
>
> i attached a simple project.
> i added the needed components to a webmarkupcontainer.
> instead of panels this time i used requiredtextfields to keep it as simple
> as possible.
> one textfield is visible the other invisible.
>
> here is the generated markup:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <html xmlns="http://www.w3.org/1999/xhtml"
> xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
> <title>Wicket Demo</title>
> <link rel="stylesheet" type="text/css" href="/css/style.css"/>
> <script type="text/javascript"
> src="resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js"></script>
> <script type="text/javascript"
> src="resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js"></script>
> <script type="text/javascript"
> src="resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js"></script>
>
> <script type="text/javascript"
> id="wicket-ajax-debug-enable"><!--/*--><![CDATA[/*><!--*/
> wicketAjaxDebugEnable=true;
> /*-->]]>*/</script>
>
> <script type="text/javascript"
> id="org.wicketstuff.dojo.AbstractDefaultDojoBehavior/debug"><!--/*--><![CDATA[/*><!--*/
> var djConfig = {};
> djConfig.isDebug = true;
> djConfig.parseWidgets = false;
> djConfig.searchIds = []
>
> /*-->]]>*/</script>
>
> <script type="text/javascript"
> src="resources/org.wicketstuff.dojo.AbstractDefaultDojoBehavior/dojo-0.4/dojo.js"></script>
> <script type="text/javascript"
> src="resources/org.wicketstuff.dojo.AbstractRequireDojoBehavior/dojo-wicket/dojoWicket.js"></script>
> <script type="text/javascript"
> id="org.wicketstuff.dojo.AbstractDefaultDojoBehavior/namespaces/wicketstuff"><!--/*--><![CDATA[/*><!--*/
> dojo.registerModulePath("wicketstuff",
> "../../../resources/org.wicketstuff.dojo.AbstractDefaultDojoBehavior");
> /*-->]]>*/</script>
>
> <script type="text/javascript"
> id="org.wicketstuff.dojo.AbstractDefaultDojoBehavior/consoleDebug"><!--/*--><![CDATA[/*><!--*/
> dojo.require("dojo.debug.console");
> dojo.require("dojo.widget.Tree");
>
> /*-->]]>*/</script>
>
> <script type="text/javascript"
> id="org.wicketstuff.dojo.AbstractRequireDojoBehavior"><!--/*--><![CDATA[/*><!--*/
> dojo.require("dojo.lfx.*");
> dojo.require("dojo.gfx.*");
> dojo.require("dojo.html.*");
>
>
> /*-->]]>*/</script>
>
> <script type="text/javascript"
> id="txt11DojoParse"><!--/*--><![CDATA[/*><!--*/
> djConfig.searchIds.push("txt11");
> /*-->]]>*/</script>
>
> <script language='JavaScript' type='text/javascript'>
> var txt11_first = false;
> function txt11_validate(type) {
> with(dojo.byId('txt11').style){backgroundColor =
> '#FFF';} if (type=='valid'){
> dojo.lfx.html.highlight('txt11',
> dojo.gfx.color.hex2rgb('#98c27d'), 200).play(0)
> dojo.lfx.html.unhighlight('txt11',
> dojo.gfx.color.hex2rgb('#98c27d'), 200).play(200)
> }else{
> dojo.lfx.html.highlight('txt11',
> dojo.gfx.color.hex2rgb('#fc8682'), 200).play(0)
> ; dojo.lfx.html.unhighlight('txt11',
> dojo.gfx.color.hex2rgb('#fc8682'), 200).play(200)
> ; }
> }
> </script>
> </head>
> <body>
> <span wicket:id="container">
> <input id="txt11" onblur="javascript:var
> wcall=wicketAjaxGet('?wicket:interface=:0:container:txt1::IActivePageBehaviorListener:0:&wicket:ignoreIfNotActive=true&container:txt1='
> + this.value, function() { }, function() { });return !wcall;"
> name="container:txt1" widgetId="txt11" value="" type="text"
> wicket:id="txt1"/>
> <input id="txt22" style="display:none"></input>
> </span>
>
> </body>
> </html>
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
> Gesendet: Do 24.09.2009 00:06
> An: users@wicket.apache.org
> Betreff: Re: FXValidationAjaxHandler - Javascript not added if component is
> set visible(false) in page constructor
>
> put the two panels into a parent container that is always visible.
>
> -igor
>
> On Wed, Sep 23, 2009 at 1:37 PM, Giambalvo, Christian
> <Ch...@excelsisnet.com> wrote:
>> Hi,
>>
>> first thanks for reply.
>> Well, it's not possible to add it to a visible component.
>> Let me explain.
>> I have 2 custom panels and depending on the selection in a dropdownchoice
>> the corresponding panel gets visible or hidden. Because one of these panels
>> need to be invisible on page construction (so not both are showing up) i
>> need to set it invisible. If i then select it in the dropdownchoice i gets
>> visible.
>> And now the problem begins. Cause of the initial invisibility the needed
>> javascript code for validation of the panel fields isn't injected. How can i
>> workaround this?
>>
>> Thanks in advance
>> chris
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
>> Gesendet: Mi 23.09.2009 19:20
>> An: users@wicket.apache.org
>> Betreff: Re: FXValidationAjaxHandler - Javascript not added if component
>> is set visible(false) in page constructor
>>
>> javascript contributions do not show up for components that are not
>> visible, add it to a visible component instead.
>>
>> -igor
>>
>> On Wed, Sep 23, 2009 at 7:15 AM, Giambalvo, Christian
>> <Ch...@excelsisnet.com> wrote:
>>> Hi all,
>>>
>>> ich have a component (textfield) with an FXValidationAjaxHandler. If i
>>> set this component in pageconstructor to visible(false) then the needed
>>> javascript code for validation is not contributed to pageheader. if set
>>> to visible(true) all is fine.
>>> does anyone had the same problem and if so, is there a workaround
>>> available?
>>>
>>> greets chris
>>>
>>> snippet:
>>> ...
>>> pComponent.add(new FXValidationAjaxHandler(pFXJavascriptEvent));
>>> this.pComponent.setOutputMarkupPlaceholderTag(true);
>>> this.pComponent.setOutputMarkupId(true)
>>> this.pComponent.setVisible(false); // no javascript is added
>>> //this.pComponent.setVisible(true); // javascript is added
>>> form.add(this.pComponent);
>>> ...
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: FXValidationAjaxHandler - Javascript not added if component is
set visible(false) in page constructor
Posted by Jeremy Thomerson <je...@wickettraining.com>.
Why validate the input on a textfield that isn't displayed to the user?
--
Jeremy Thomerson
http://www.wickettraining.com
On Wed, Sep 23, 2009 at 7:45 PM, Giambalvo, Christian <
Christian.Giambalvo@excelsisnet.com> wrote:
> well, it makes no sense to add the javascript to another container.
> how should i validate the textfields if the javascript points to a
> different component?
> or could you give me an example?
>
>
> -----Ursprüngliche Nachricht-----
> Von: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
> Gesendet: Do 24.09.2009 02:32
> An: users@wicket.apache.org
> Betreff: Re: FXValidationAjaxHandler - Javascript not added if component is
> set visible(false) in page constructor
>
> i meant add the javascript to a container that is visible.
>
> components that are not visible do not render their javascript, it
> wouldnt make any sense for them to do otherwise.
>
> -igor
>
> On Wed, Sep 23, 2009 at 5:16 PM, Giambalvo, Christian
> <Ch...@excelsisnet.com> wrote:
> > i'm sorry, but doesn't work.
> >
> > i attached a simple project.
> > i added the needed components to a webmarkupcontainer.
> > instead of panels this time i used requiredtextfields to keep it as
> simple
> > as possible.
> > one textfield is visible the other invisible.
> >
> > here is the generated markup:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <html xmlns="http://www.w3.org/1999/xhtml"
> > xmlns:wicket="
> http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
> > <head>
> > <meta http-equiv="Content-Type" content="text/html;
> charset=UTF-8"/>
> > <title>Wicket Demo</title>
> > <link rel="stylesheet" type="text/css" href="/css/style.css"/>
> > <script type="text/javascript"
> >
> src="resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js"></script>
> > <script type="text/javascript"
> >
> src="resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js"></script>
> > <script type="text/javascript"
> >
> src="resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js"></script>
> >
> > <script type="text/javascript"
> > id="wicket-ajax-debug-enable"><!--/*--><![CDATA[/*><!--*/
> > wicketAjaxDebugEnable=true;
> > /*-->]]>*/</script>
> >
> > <script type="text/javascript"
> >
> id="org.wicketstuff.dojo.AbstractDefaultDojoBehavior/debug"><!--/*--><![CDATA[/*><!--*/
> > var djConfig = {};
> > djConfig.isDebug = true;
> > djConfig.parseWidgets = false;
> > djConfig.searchIds = []
> >
> > /*-->]]>*/</script>
> >
> > <script type="text/javascript"
> >
> src="resources/org.wicketstuff.dojo.AbstractDefaultDojoBehavior/dojo-0.4/dojo.js"></script>
> > <script type="text/javascript"
> >
> src="resources/org.wicketstuff.dojo.AbstractRequireDojoBehavior/dojo-wicket/dojoWicket.js"></script>
> > <script type="text/javascript"
> >
> id="org.wicketstuff.dojo.AbstractDefaultDojoBehavior/namespaces/wicketstuff"><!--/*--><![CDATA[/*><!--*/
> > dojo.registerModulePath("wicketstuff",
> > "../../../resources/org.wicketstuff.dojo.AbstractDefaultDojoBehavior");
> > /*-->]]>*/</script>
> >
> > <script type="text/javascript"
> >
> id="org.wicketstuff.dojo.AbstractDefaultDojoBehavior/consoleDebug"><!--/*--><![CDATA[/*><!--*/
> > dojo.require("dojo.debug.console");
> > dojo.require("dojo.widget.Tree");
> >
> > /*-->]]>*/</script>
> >
> > <script type="text/javascript"
> >
> id="org.wicketstuff.dojo.AbstractRequireDojoBehavior"><!--/*--><![CDATA[/*><!--*/
> > dojo.require("dojo.lfx.*");
> > dojo.require("dojo.gfx.*");
> > dojo.require("dojo.html.*");
> >
> >
> > /*-->]]>*/</script>
> >
> > <script type="text/javascript"
> > id="txt11DojoParse"><!--/*--><![CDATA[/*><!--*/
> > djConfig.searchIds.push("txt11");
> > /*-->]]>*/</script>
> >
> > <script language='JavaScript' type='text/javascript'>
> > var txt11_first = false;
> > function txt11_validate(type) {
> > with(dojo.byId('txt11').style){backgroundColor =
> > '#FFF';} if (type=='valid'){
> > dojo.lfx.html.highlight('txt11',
> > dojo.gfx.color.hex2rgb('#98c27d'), 200).play(0)
> > dojo.lfx.html.unhighlight('txt11',
> > dojo.gfx.color.hex2rgb('#98c27d'), 200).play(200)
> > }else{
> > dojo.lfx.html.highlight('txt11',
> > dojo.gfx.color.hex2rgb('#fc8682'), 200).play(0)
> > ; dojo.lfx.html.unhighlight('txt11',
> > dojo.gfx.color.hex2rgb('#fc8682'), 200).play(200)
> > ; }
> > }
> > </script>
> > </head>
> > <body>
> > <span wicket:id="container">
> > <input id="txt11" onblur="javascript:var
> >
> wcall=wicketAjaxGet('?wicket:interface=:0:container:txt1::IActivePageBehaviorListener:0:&wicket:ignoreIfNotActive=true&container:txt1='
> > + this.value, function() { }, function() { });return !wcall;"
> > name="container:txt1" widgetId="txt11" value="" type="text"
> > wicket:id="txt1"/>
> > <input id="txt22" style="display:none"></input>
> > </span>
> >
> > </body>
> > </html>
> >
> >
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
> > Gesendet: Do 24.09.2009 00:06
> > An: users@wicket.apache.org
> > Betreff: Re: FXValidationAjaxHandler - Javascript not added if component
> is
> > set visible(false) in page constructor
> >
> > put the two panels into a parent container that is always visible.
> >
> > -igor
> >
> > On Wed, Sep 23, 2009 at 1:37 PM, Giambalvo, Christian
> > <Ch...@excelsisnet.com> wrote:
> >> Hi,
> >>
> >> first thanks for reply.
> >> Well, it's not possible to add it to a visible component.
> >> Let me explain.
> >> I have 2 custom panels and depending on the selection in a
> dropdownchoice
> >> the corresponding panel gets visible or hidden. Because one of these
> panels
> >> need to be invisible on page construction (so not both are showing up) i
> >> need to set it invisible. If i then select it in the dropdownchoice i
> gets
> >> visible.
> >> And now the problem begins. Cause of the initial invisibility the needed
> >> javascript code for validation of the panel fields isn't injected. How
> can i
> >> workaround this?
> >>
> >> Thanks in advance
> >> chris
> >>
> >>
> >> -----Ursprüngliche Nachricht-----
> >> Von: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
> >> Gesendet: Mi 23.09.2009 19:20
> >> An: users@wicket.apache.org
> >> Betreff: Re: FXValidationAjaxHandler - Javascript not added if component
> >> is set visible(false) in page constructor
> >>
> >> javascript contributions do not show up for components that are not
> >> visible, add it to a visible component instead.
> >>
> >> -igor
> >>
> >> On Wed, Sep 23, 2009 at 7:15 AM, Giambalvo, Christian
> >> <Ch...@excelsisnet.com> wrote:
> >>> Hi all,
> >>>
> >>> ich have a component (textfield) with an FXValidationAjaxHandler. If i
> >>> set this component in pageconstructor to visible(false) then the needed
> >>> javascript code for validation is not contributed to pageheader. if set
> >>> to visible(true) all is fine.
> >>> does anyone had the same problem and if so, is there a workaround
> >>> available?
> >>>
> >>> greets chris
> >>>
> >>> snippet:
> >>> ...
> >>> pComponent.add(new FXValidationAjaxHandler(pFXJavascriptEvent));
> >>> this.pComponent.setOutputMarkupPlaceholderTag(true);
> >>> this.pComponent.setOutputMarkupId(true)
> >>> this.pComponent.setVisible(false); // no javascript is added
> >>> //this.pComponent.setVisible(true); // javascript is added
> >>> form.add(this.pComponent);
> >>> ...
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
AW: FXValidationAjaxHandler - Javascript not added if component is set visible(false) in page constructor
Posted by "Giambalvo, Christian" <Ch...@excelsisnet.com>.
well, it makes no sense to add the javascript to another container.
how should i validate the textfields if the javascript points to a different component?
or could you give me an example?
-----Ursprüngliche Nachricht-----
Von: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
Gesendet: Do 24.09.2009 02:32
An: users@wicket.apache.org
Betreff: Re: FXValidationAjaxHandler - Javascript not added if component is set visible(false) in page constructor
i meant add the javascript to a container that is visible.
components that are not visible do not render their javascript, it
wouldnt make any sense for them to do otherwise.
-igor
On Wed, Sep 23, 2009 at 5:16 PM, Giambalvo, Christian
<Ch...@excelsisnet.com> wrote:
> i'm sorry, but doesn't work.
>
> i attached a simple project.
> i added the needed components to a webmarkupcontainer.
> instead of panels this time i used requiredtextfields to keep it as simple
> as possible.
> one textfield is visible the other invisible.
>
> here is the generated markup:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <html xmlns="http://www.w3.org/1999/xhtml"
> xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
> <title>Wicket Demo</title>
> <link rel="stylesheet" type="text/css" href="/css/style.css"/>
> <script type="text/javascript"
> src="resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js"></script>
> <script type="text/javascript"
> src="resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js"></script>
> <script type="text/javascript"
> src="resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js"></script>
>
> <script type="text/javascript"
> id="wicket-ajax-debug-enable"><!--/*--><![CDATA[/*><!--*/
> wicketAjaxDebugEnable=true;
> /*-->]]>*/</script>
>
> <script type="text/javascript"
> id="org.wicketstuff.dojo.AbstractDefaultDojoBehavior/debug"><!--/*--><![CDATA[/*><!--*/
> var djConfig = {};
> djConfig.isDebug = true;
> djConfig.parseWidgets = false;
> djConfig.searchIds = []
>
> /*-->]]>*/</script>
>
> <script type="text/javascript"
> src="resources/org.wicketstuff.dojo.AbstractDefaultDojoBehavior/dojo-0.4/dojo.js"></script>
> <script type="text/javascript"
> src="resources/org.wicketstuff.dojo.AbstractRequireDojoBehavior/dojo-wicket/dojoWicket.js"></script>
> <script type="text/javascript"
> id="org.wicketstuff.dojo.AbstractDefaultDojoBehavior/namespaces/wicketstuff"><!--/*--><![CDATA[/*><!--*/
> dojo.registerModulePath("wicketstuff",
> "../../../resources/org.wicketstuff.dojo.AbstractDefaultDojoBehavior");
> /*-->]]>*/</script>
>
> <script type="text/javascript"
> id="org.wicketstuff.dojo.AbstractDefaultDojoBehavior/consoleDebug"><!--/*--><![CDATA[/*><!--*/
> dojo.require("dojo.debug.console");
> dojo.require("dojo.widget.Tree");
>
> /*-->]]>*/</script>
>
> <script type="text/javascript"
> id="org.wicketstuff.dojo.AbstractRequireDojoBehavior"><!--/*--><![CDATA[/*><!--*/
> dojo.require("dojo.lfx.*");
> dojo.require("dojo.gfx.*");
> dojo.require("dojo.html.*");
>
>
> /*-->]]>*/</script>
>
> <script type="text/javascript"
> id="txt11DojoParse"><!--/*--><![CDATA[/*><!--*/
> djConfig.searchIds.push("txt11");
> /*-->]]>*/</script>
>
> <script language='JavaScript' type='text/javascript'>
> var txt11_first = false;
> function txt11_validate(type) {
> with(dojo.byId('txt11').style){backgroundColor =
> '#FFF';} if (type=='valid'){
> dojo.lfx.html.highlight('txt11',
> dojo.gfx.color.hex2rgb('#98c27d'), 200).play(0)
> dojo.lfx.html.unhighlight('txt11',
> dojo.gfx.color.hex2rgb('#98c27d'), 200).play(200)
> }else{
> dojo.lfx.html.highlight('txt11',
> dojo.gfx.color.hex2rgb('#fc8682'), 200).play(0)
> ; dojo.lfx.html.unhighlight('txt11',
> dojo.gfx.color.hex2rgb('#fc8682'), 200).play(200)
> ; }
> }
> </script>
> </head>
> <body>
> <span wicket:id="container">
> <input id="txt11" onblur="javascript:var
> wcall=wicketAjaxGet('?wicket:interface=:0:container:txt1::IActivePageBehaviorListener:0:&wicket:ignoreIfNotActive=true&container:txt1='
> + this.value, function() { }, function() { });return !wcall;"
> name="container:txt1" widgetId="txt11" value="" type="text"
> wicket:id="txt1"/>
> <input id="txt22" style="display:none"></input>
> </span>
>
> </body>
> </html>
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
> Gesendet: Do 24.09.2009 00:06
> An: users@wicket.apache.org
> Betreff: Re: FXValidationAjaxHandler - Javascript not added if component is
> set visible(false) in page constructor
>
> put the two panels into a parent container that is always visible.
>
> -igor
>
> On Wed, Sep 23, 2009 at 1:37 PM, Giambalvo, Christian
> <Ch...@excelsisnet.com> wrote:
>> Hi,
>>
>> first thanks for reply.
>> Well, it's not possible to add it to a visible component.
>> Let me explain.
>> I have 2 custom panels and depending on the selection in a dropdownchoice
>> the corresponding panel gets visible or hidden. Because one of these panels
>> need to be invisible on page construction (so not both are showing up) i
>> need to set it invisible. If i then select it in the dropdownchoice i gets
>> visible.
>> And now the problem begins. Cause of the initial invisibility the needed
>> javascript code for validation of the panel fields isn't injected. How can i
>> workaround this?
>>
>> Thanks in advance
>> chris
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
>> Gesendet: Mi 23.09.2009 19:20
>> An: users@wicket.apache.org
>> Betreff: Re: FXValidationAjaxHandler - Javascript not added if component
>> is set visible(false) in page constructor
>>
>> javascript contributions do not show up for components that are not
>> visible, add it to a visible component instead.
>>
>> -igor
>>
>> On Wed, Sep 23, 2009 at 7:15 AM, Giambalvo, Christian
>> <Ch...@excelsisnet.com> wrote:
>>> Hi all,
>>>
>>> ich have a component (textfield) with an FXValidationAjaxHandler. If i
>>> set this component in pageconstructor to visible(false) then the needed
>>> javascript code for validation is not contributed to pageheader. if set
>>> to visible(true) all is fine.
>>> does anyone had the same problem and if so, is there a workaround
>>> available?
>>>
>>> greets chris
>>>
>>> snippet:
>>> ...
>>> pComponent.add(new FXValidationAjaxHandler(pFXJavascriptEvent));
>>> this.pComponent.setOutputMarkupPlaceholderTag(true);
>>> this.pComponent.setOutputMarkupId(true)
>>> this.pComponent.setVisible(false); // no javascript is added
>>> //this.pComponent.setVisible(true); // javascript is added
>>> form.add(this.pComponent);
>>> ...
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: FXValidationAjaxHandler - Javascript not added if component is
set visible(false) in page constructor
Posted by Igor Vaynberg <ig...@gmail.com>.
i meant add the javascript to a container that is visible.
components that are not visible do not render their javascript, it
wouldnt make any sense for them to do otherwise.
-igor
On Wed, Sep 23, 2009 at 5:16 PM, Giambalvo, Christian
<Ch...@excelsisnet.com> wrote:
> i'm sorry, but doesn't work.
>
> i attached a simple project.
> i added the needed components to a webmarkupcontainer.
> instead of panels this time i used requiredtextfields to keep it as simple
> as possible.
> one textfield is visible the other invisible.
>
> here is the generated markup:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <html xmlns="http://www.w3.org/1999/xhtml"
> xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
> <title>Wicket Demo</title>
> <link rel="stylesheet" type="text/css" href="/css/style.css"/>
> <script type="text/javascript"
> src="resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js"></script>
> <script type="text/javascript"
> src="resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js"></script>
> <script type="text/javascript"
> src="resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js"></script>
>
> <script type="text/javascript"
> id="wicket-ajax-debug-enable"><!--/*--><![CDATA[/*><!--*/
> wicketAjaxDebugEnable=true;
> /*-->]]>*/</script>
>
> <script type="text/javascript"
> id="org.wicketstuff.dojo.AbstractDefaultDojoBehavior/debug"><!--/*--><![CDATA[/*><!--*/
> var djConfig = {};
> djConfig.isDebug = true;
> djConfig.parseWidgets = false;
> djConfig.searchIds = []
>
> /*-->]]>*/</script>
>
> <script type="text/javascript"
> src="resources/org.wicketstuff.dojo.AbstractDefaultDojoBehavior/dojo-0.4/dojo.js"></script>
> <script type="text/javascript"
> src="resources/org.wicketstuff.dojo.AbstractRequireDojoBehavior/dojo-wicket/dojoWicket.js"></script>
> <script type="text/javascript"
> id="org.wicketstuff.dojo.AbstractDefaultDojoBehavior/namespaces/wicketstuff"><!--/*--><![CDATA[/*><!--*/
> dojo.registerModulePath("wicketstuff",
> "../../../resources/org.wicketstuff.dojo.AbstractDefaultDojoBehavior");
> /*-->]]>*/</script>
>
> <script type="text/javascript"
> id="org.wicketstuff.dojo.AbstractDefaultDojoBehavior/consoleDebug"><!--/*--><![CDATA[/*><!--*/
> dojo.require("dojo.debug.console");
> dojo.require("dojo.widget.Tree");
>
> /*-->]]>*/</script>
>
> <script type="text/javascript"
> id="org.wicketstuff.dojo.AbstractRequireDojoBehavior"><!--/*--><![CDATA[/*><!--*/
> dojo.require("dojo.lfx.*");
> dojo.require("dojo.gfx.*");
> dojo.require("dojo.html.*");
>
>
> /*-->]]>*/</script>
>
> <script type="text/javascript"
> id="txt11DojoParse"><!--/*--><![CDATA[/*><!--*/
> djConfig.searchIds.push("txt11");
> /*-->]]>*/</script>
>
> <script language='JavaScript' type='text/javascript'>
> var txt11_first = false;
> function txt11_validate(type) {
> with(dojo.byId('txt11').style){backgroundColor =
> '#FFF';} if (type=='valid'){
> dojo.lfx.html.highlight('txt11',
> dojo.gfx.color.hex2rgb('#98c27d'), 200).play(0)
> dojo.lfx.html.unhighlight('txt11',
> dojo.gfx.color.hex2rgb('#98c27d'), 200).play(200)
> }else{
> dojo.lfx.html.highlight('txt11',
> dojo.gfx.color.hex2rgb('#fc8682'), 200).play(0)
> ; dojo.lfx.html.unhighlight('txt11',
> dojo.gfx.color.hex2rgb('#fc8682'), 200).play(200)
> ; }
> }
> </script>
> </head>
> <body>
> <span wicket:id="container">
> <input id="txt11" onblur="javascript:var
> wcall=wicketAjaxGet('?wicket:interface=:0:container:txt1::IActivePageBehaviorListener:0:&wicket:ignoreIfNotActive=true&container:txt1='
> + this.value, function() { }, function() { });return !wcall;"
> name="container:txt1" widgetId="txt11" value="" type="text"
> wicket:id="txt1"/>
> <input id="txt22" style="display:none"></input>
> </span>
>
> </body>
> </html>
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
> Gesendet: Do 24.09.2009 00:06
> An: users@wicket.apache.org
> Betreff: Re: FXValidationAjaxHandler - Javascript not added if component is
> set visible(false) in page constructor
>
> put the two panels into a parent container that is always visible.
>
> -igor
>
> On Wed, Sep 23, 2009 at 1:37 PM, Giambalvo, Christian
> <Ch...@excelsisnet.com> wrote:
>> Hi,
>>
>> first thanks for reply.
>> Well, it's not possible to add it to a visible component.
>> Let me explain.
>> I have 2 custom panels and depending on the selection in a dropdownchoice
>> the corresponding panel gets visible or hidden. Because one of these panels
>> need to be invisible on page construction (so not both are showing up) i
>> need to set it invisible. If i then select it in the dropdownchoice i gets
>> visible.
>> And now the problem begins. Cause of the initial invisibility the needed
>> javascript code for validation of the panel fields isn't injected. How can i
>> workaround this?
>>
>> Thanks in advance
>> chris
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
>> Gesendet: Mi 23.09.2009 19:20
>> An: users@wicket.apache.org
>> Betreff: Re: FXValidationAjaxHandler - Javascript not added if component
>> is set visible(false) in page constructor
>>
>> javascript contributions do not show up for components that are not
>> visible, add it to a visible component instead.
>>
>> -igor
>>
>> On Wed, Sep 23, 2009 at 7:15 AM, Giambalvo, Christian
>> <Ch...@excelsisnet.com> wrote:
>>> Hi all,
>>>
>>> ich have a component (textfield) with an FXValidationAjaxHandler. If i
>>> set this component in pageconstructor to visible(false) then the needed
>>> javascript code for validation is not contributed to pageheader. if set
>>> to visible(true) all is fine.
>>> does anyone had the same problem and if so, is there a workaround
>>> available?
>>>
>>> greets chris
>>>
>>> snippet:
>>> ...
>>> pComponent.add(new FXValidationAjaxHandler(pFXJavascriptEvent));
>>> this.pComponent.setOutputMarkupPlaceholderTag(true);
>>> this.pComponent.setOutputMarkupId(true)
>>> this.pComponent.setVisible(false); // no javascript is added
>>> //this.pComponent.setVisible(true); // javascript is added
>>> form.add(this.pComponent);
>>> ...
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
AW: FXValidationAjaxHandler - Javascript not added if component is set visible(false) in page constructor
Posted by "Giambalvo, Christian" <Ch...@excelsisnet.com>.
i'm sorry, but doesn't work.
i attached a simple project.
i added the needed components to a webmarkupcontainer.
instead of panels this time i used requiredtextfields to keep it as simple as possible.
one textfield is visible the other invisible.
here is the generated markup:
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Wicket Demo</title>
<link rel="stylesheet" type="text/css" href="/css/style.css"/>
<script type="text/javascript" src="resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js"></script>
<script type="text/javascript" src="resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js"></script>
<script type="text/javascript" src="resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js"></script>
<script type="text/javascript" id="wicket-ajax-debug-enable"><!--/*--><![CDATA[/*><!--*/
wicketAjaxDebugEnable=true;
/*-->]]>*/</script>
<script type="text/javascript" id="org.wicketstuff.dojo.AbstractDefaultDojoBehavior/debug"><!--/*--><![CDATA[/*><!--*/
var djConfig = {};
djConfig.isDebug = true;
djConfig.parseWidgets = false;
djConfig.searchIds = []
/*-->]]>*/</script>
<script type="text/javascript" src="resources/org.wicketstuff.dojo.AbstractDefaultDojoBehavior/dojo-0.4/dojo.js"></script>
<script type="text/javascript" src="resources/org.wicketstuff.dojo.AbstractRequireDojoBehavior/dojo-wicket/dojoWicket.js"></script>
<script type="text/javascript" id="org.wicketstuff.dojo.AbstractDefaultDojoBehavior/namespaces/wicketstuff"><!--/*--><![CDATA[/*><!--*/
dojo.registerModulePath("wicketstuff", "../../../resources/org.wicketstuff.dojo.AbstractDefaultDojoBehavior");
/*-->]]>*/</script>
<script type="text/javascript" id="org.wicketstuff.dojo.AbstractDefaultDojoBehavior/consoleDebug"><!--/*--><![CDATA[/*><!--*/
dojo.require("dojo.debug.console");
dojo.require("dojo.widget.Tree");
/*-->]]>*/</script>
<script type="text/javascript" id="org.wicketstuff.dojo.AbstractRequireDojoBehavior"><!--/*--><![CDATA[/*><!--*/
dojo.require("dojo.lfx.*");
dojo.require("dojo.gfx.*");
dojo.require("dojo.html.*");
/*-->]]>*/</script>
<script type="text/javascript" id="txt11DojoParse"><!--/*--><![CDATA[/*><!--*/
djConfig.searchIds.push("txt11");
/*-->]]>*/</script>
<script language='JavaScript' type='text/javascript'>
var txt11_first = false;
function txt11_validate(type) {
with(dojo.byId('txt11').style){backgroundColor = '#FFF';} if (type=='valid'){
dojo.lfx.html.highlight('txt11', dojo.gfx.color.hex2rgb('#98c27d'), 200).play(0)
dojo.lfx.html.unhighlight('txt11', dojo.gfx.color.hex2rgb('#98c27d'), 200).play(200)
}else{
dojo.lfx.html.highlight('txt11', dojo.gfx.color.hex2rgb('#fc8682'), 200).play(0)
; dojo.lfx.html.unhighlight('txt11', dojo.gfx.color.hex2rgb('#fc8682'), 200).play(200)
; }
}
</script>
</head>
<body>
<span wicket:id="container">
<input id="txt11" onblur="javascript:var wcall=wicketAjaxGet('?wicket:interface=:0:container:txt1::IActivePageBehaviorListener:0:&wicket:ignoreIfNotActive=true&container:txt1=' + this.value, function() { }, function() { });return !wcall;" name="container:txt1" widgetId="txt11" value="" type="text" wicket:id="txt1"/>
<input id="txt22" style="display:none"></input>
</span>
</body>
</html>
-----Urspr�ngliche Nachricht-----
Von: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
Gesendet: Do 24.09.2009 00:06
An: users@wicket.apache.org
Betreff: Re: FXValidationAjaxHandler - Javascript not added if component is set visible(false) in page constructor
put the two panels into a parent container that is always visible.
-igor
On Wed, Sep 23, 2009 at 1:37 PM, Giambalvo, Christian
<Ch...@excelsisnet.com> wrote:
> Hi,
>
> first thanks for reply.
> Well, it's not possible to add it to a visible component.
> Let me explain.
> I have 2 custom panels and depending on the selection in a dropdownchoice the corresponding panel gets visible or hidden. Because one of these panels need to be invisible on page construction (so not both are showing up) i need to set it invisible. If i then select it in the dropdownchoice i gets visible.
> And now the problem begins. Cause of the initial invisibility the needed javascript code for validation of the panel fields isn't injected. How can i workaround this?
>
> Thanks in advance
> chris
>
>
> -----Urspr�ngliche Nachricht-----
> Von: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
> Gesendet: Mi 23.09.2009 19:20
> An: users@wicket.apache.org
> Betreff: Re: FXValidationAjaxHandler - Javascript not added if component is set visible(false) in page constructor
>
> javascript contributions do not show up for components that are not
> visible, add it to a visible component instead.
>
> -igor
>
> On Wed, Sep 23, 2009 at 7:15 AM, Giambalvo, Christian
> <Ch...@excelsisnet.com> wrote:
>> Hi all,
>>
>> ich have a component (textfield) with an FXValidationAjaxHandler. If i
>> set this component in pageconstructor to visible(false) then the needed
>> javascript code for validation is not contributed to pageheader. if set
>> to visible(true) all is fine.
>> does anyone had the same problem and if so, is there a workaround
>> available?
>>
>> greets chris
>>
>> snippet:
>> ...
>> pComponent.add(new FXValidationAjaxHandler(pFXJavascriptEvent));
>> this.pComponent.setOutputMarkupPlaceholderTag(true);
>> this.pComponent.setOutputMarkupId(true)
>> this.pComponent.setVisible(false); // no javascript is added
>> //this.pComponent.setVisible(true); // javascript is added
>> form.add(this.pComponent);
>> ...
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: FXValidationAjaxHandler - Javascript not added if component is
set visible(false) in page constructor
Posted by Igor Vaynberg <ig...@gmail.com>.
put the two panels into a parent container that is always visible.
-igor
On Wed, Sep 23, 2009 at 1:37 PM, Giambalvo, Christian
<Ch...@excelsisnet.com> wrote:
> Hi,
>
> first thanks for reply.
> Well, it's not possible to add it to a visible component.
> Let me explain.
> I have 2 custom panels and depending on the selection in a dropdownchoice the corresponding panel gets visible or hidden. Because one of these panels need to be invisible on page construction (so not both are showing up) i need to set it invisible. If i then select it in the dropdownchoice i gets visible.
> And now the problem begins. Cause of the initial invisibility the needed javascript code for validation of the panel fields isn't injected. How can i workaround this?
>
> Thanks in advance
> chris
>
>
> -----Ursprüngliche Nachricht-----
> Von: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
> Gesendet: Mi 23.09.2009 19:20
> An: users@wicket.apache.org
> Betreff: Re: FXValidationAjaxHandler - Javascript not added if component is set visible(false) in page constructor
>
> javascript contributions do not show up for components that are not
> visible, add it to a visible component instead.
>
> -igor
>
> On Wed, Sep 23, 2009 at 7:15 AM, Giambalvo, Christian
> <Ch...@excelsisnet.com> wrote:
>> Hi all,
>>
>> ich have a component (textfield) with an FXValidationAjaxHandler. If i
>> set this component in pageconstructor to visible(false) then the needed
>> javascript code for validation is not contributed to pageheader. if set
>> to visible(true) all is fine.
>> does anyone had the same problem and if so, is there a workaround
>> available?
>>
>> greets chris
>>
>> snippet:
>> ...
>> pComponent.add(new FXValidationAjaxHandler(pFXJavascriptEvent));
>> this.pComponent.setOutputMarkupPlaceholderTag(true);
>> this.pComponent.setOutputMarkupId(true)
>> this.pComponent.setVisible(false); // no javascript is added
>> //this.pComponent.setVisible(true); // javascript is added
>> form.add(this.pComponent);
>> ...
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
AW: FXValidationAjaxHandler - Javascript not added if component is set visible(false) in page constructor
Posted by "Giambalvo, Christian" <Ch...@excelsisnet.com>.
Hi,
first thanks for reply.
Well, it's not possible to add it to a visible component.
Let me explain.
I have 2 custom panels and depending on the selection in a dropdownchoice the corresponding panel gets visible or hidden. Because one of these panels need to be invisible on page construction (so not both are showing up) i need to set it invisible. If i then select it in the dropdownchoice i gets visible.
And now the problem begins. Cause of the initial invisibility the needed javascript code for validation of the panel fields isn't injected. How can i workaround this?
Thanks in advance
chris
-----Ursprüngliche Nachricht-----
Von: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
Gesendet: Mi 23.09.2009 19:20
An: users@wicket.apache.org
Betreff: Re: FXValidationAjaxHandler - Javascript not added if component is set visible(false) in page constructor
javascript contributions do not show up for components that are not
visible, add it to a visible component instead.
-igor
On Wed, Sep 23, 2009 at 7:15 AM, Giambalvo, Christian
<Ch...@excelsisnet.com> wrote:
> Hi all,
>
> ich have a component (textfield) with an FXValidationAjaxHandler. If i
> set this component in pageconstructor to visible(false) then the needed
> javascript code for validation is not contributed to pageheader. if set
> to visible(true) all is fine.
> does anyone had the same problem and if so, is there a workaround
> available?
>
> greets chris
>
> snippet:
> ...
> pComponent.add(new FXValidationAjaxHandler(pFXJavascriptEvent));
> this.pComponent.setOutputMarkupPlaceholderTag(true);
> this.pComponent.setOutputMarkupId(true)
> this.pComponent.setVisible(false); // no javascript is added
> //this.pComponent.setVisible(true); // javascript is added
> form.add(this.pComponent);
> ...
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: FXValidationAjaxHandler - Javascript not added if component is
set visible(false) in page constructor
Posted by Igor Vaynberg <ig...@gmail.com>.
javascript contributions do not show up for components that are not
visible, add it to a visible component instead.
-igor
On Wed, Sep 23, 2009 at 7:15 AM, Giambalvo, Christian
<Ch...@excelsisnet.com> wrote:
> Hi all,
>
> ich have a component (textfield) with an FXValidationAjaxHandler. If i
> set this component in pageconstructor to visible(false) then the needed
> javascript code for validation is not contributed to pageheader. if set
> to visible(true) all is fine.
> does anyone had the same problem and if so, is there a workaround
> available?
>
> greets chris
>
> snippet:
> ...
> pComponent.add(new FXValidationAjaxHandler(pFXJavascriptEvent));
> this.pComponent.setOutputMarkupPlaceholderTag(true);
> this.pComponent.setOutputMarkupId(true)
> this.pComponent.setVisible(false); // no javascript is added
> //this.pComponent.setVisible(true); // javascript is added
> form.add(this.pComponent);
> ...
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
FXValidationAjaxHandler - Javascript not added if component is set visible(false) in page constructor
Posted by "Giambalvo, Christian" <Ch...@excelsisnet.com>.
Hi all,
ich have a component (textfield) with an FXValidationAjaxHandler. If i
set this component in pageconstructor to visible(false) then the needed
javascript code for validation is not contributed to pageheader. if set
to visible(true) all is fine.
does anyone had the same problem and if so, is there a workaround
available?
greets chris
snippet:
...
pComponent.add(new FXValidationAjaxHandler(pFXJavascriptEvent));
this.pComponent.setOutputMarkupPlaceholderTag(true);
this.pComponent.setOutputMarkupId(true)
this.pComponent.setVisible(false); // no javascript is added
//this.pComponent.setVisible(true); // javascript is added
form.add(this.pComponent);
...
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
AW: Date validation in a form
Posted by "Giambalvo, Christian" <Ch...@excelsisnet.com>.
What about org.apache.wicket.validation.validator.PatternValidator
Mit freundlichen Grüßen
Christian Giambalvo
--
Fachinformatiker für Anwendungsentwicklung
EXCELSIS Informationssysteme GmbH
Wilhelmsplatz 8 - 70182 Stuttgart
Mobile +49 176 196 32 406
Office +49 711 6 20 30 406
christian.giambalvo@excelsisnet.com
www.excelsisnet.com
Sitz Stuttgart
Amtsgericht Stuttgart, HRB 21104
Geschäftsführer: Christian Sauter, Dr. Nils Herda, Frank Wolf
-----Ursprüngliche Nachricht-----
Von: Charles Moulliard [mailto:cmoulliard@gmail.com]
Gesendet: Donnerstag, 24. September 2009 10:10
An: users@wicket.apache.org
Betreff: Date validation in a form
I would like to know How I can validate the string date inputted by a
user in a textfield of my form ?
e.g : The SimpleDateformat to be used to create a java Date is : dd/MM/yyyy
So I would like to check that the user has well introduced its date
using this format
Regards,
Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer
*****************************
blog : http://cmoulliard.blogspot.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Date validation in a form
Posted by Per Lundholm <pe...@gmail.com>.
Hi!
Don't forget to setLenient false.
Hope snippet below is enough.
/Per
public final class LocalDateFormatValidator extends StringValidator {
private static final long serialVersionUID = 1L;
private final SimpleDateFormat dateFormat;
public LocalDateFormatValidator(Locale locale) {
this.dateFormat = (SimpleDateFormat) new
DateConverter().getDateFormat(locale);
this.dateFormat.setLenient(false);
}
(...)
@Override
protected void onValidate(IValidatable<String> validatable) {
String dateString = validatable.getValue();
try {
dateFormat.parse(dateString);
} catch (ParseException e) {
error(validatable);
}
}
}
On Thu, Sep 24, 2009 at 10:10 AM, Charles Moulliard <cm...@gmail.com>wrote:
> I would like to know How I can validate the string date inputted by a
> user in a textfield of my form ?
>
> e.g : The SimpleDateformat to be used to create a java Date is : dd/MM/yyyy
> So I would like to check that the user has well introduced its date
> using this format
>
> Regards,
>
> Charles Moulliard
> Senior Enterprise Architect
> Apache Camel Committer
>
> *****************************
> blog : http://cmoulliard.blogspot.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Date validation in a form
Posted by Charles Moulliard <cm...@gmail.com>.
I would like to know How I can validate the string date inputted by a
user in a textfield of my form ?
e.g : The SimpleDateformat to be used to create a java Date is : dd/MM/yyyy
So I would like to check that the user has well introduced its date
using this format
Regards,
Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer
*****************************
blog : http://cmoulliard.blogspot.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org