You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by mraible <ma...@raibledesigns.com> on 2007/11/27 09:56:42 UTC

DateField renders twice in 1.3.0-rc1

For some reason, when using the new extensions.yui.calendar.DateField, I end
up with two text fields on my page. I'm sure it's something I'm doing wrong,
but I can't see the solution at 2 a.m. (and I haven't even been drinking!).
;-)

Java:

add(new DateField("birthday"), new ResourceModel("user.birthday"));

HTML:

<tr>
    <th><wicket:message key="user.birthday">Birthday</wicket:message>:</th>
    <td>
        <input type="text" wicket:id="birthday" class="text small"
size="11"/>
        [birthday feedback]    
    </td>
</tr>

The rendered markup has two input fields. Any ideas how to fix?

<tr>
    <th>Birthday:</th>
    <td>
        <input type="text" class="text small" size="11" name="birthday">
  
    <input value="11/13/07" type="text" size="8" name="birthday:date"
id="date3"/>
&nbsp;
resources/org.apache.wicket.extensions.yui.calendar.DatePicker/icon1.gif 
  
</input>
        
  
    
    </td>
</tr>

I've attached a screenshot of what it looks like.

Thanks,

Matt

http://www.nabble.com/file/p13967061/twodatefields.png 
-- 
View this message in context: http://www.nabble.com/DateField-renders-twice-in-1.3.0-rc1-tf4880492.html#a13967061
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: DateField renders twice in 1.3.0-rc1

Posted by Eelco Hillenius <ee...@gmail.com>.
> a) it should check that it is attached to an input tag
> b) it should call setrenderbodyonly(true) on itself
> c) it should carry over any attributes from the panel tag to the inner input tag

It could do that magic if it is attached to a text field, but leave
things as they are if it is attached to another tag. Won't break the
API and lets people use whatever they prefer.

Then there is a decision to be made what to do with the text field
that is produced (possibly overriden) by newDateTextField. Should the
markup win and override any attributes defined on that? It is easier
for people to just use a regular text field and couple a DatePicker
separately.

Eelco

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: DateField renders twice in 1.3.0-rc1

Posted by Gerolf Seitz <ge...@gmail.com>.
On Nov 27, 2007 8:37 PM, Johan Compagner <jc...@gmail.com> wrote:

> >
> > lol, sometimes the solution is just too damn obvious ;)
> >
> >  Gerolf
> >
> >
> >
> thats called wicket.
>

yeah, obivously ;)

Re: DateField renders twice in 1.3.0-rc1

Posted by Johan Compagner <jc...@gmail.com>.
>
> lol, sometimes the solution is just too damn obvious ;)
>
>  Gerolf
>
>
>
thats called wicket.

Re: DateField renders twice in 1.3.0-rc1

Posted by Gerolf Seitz <ge...@gmail.com>.
>
> looking at markup like this
>
> <label for="foo">date:</label><div wicket:id="date" id="foo"/>
>
> rather then
>
> <label for="foo">date:</label><input type="text" wicket:id="date"
> id="foo"/>
>
> sucks. it is pretty unintuitive.


i agree. i will enhance the javadoc for DateField for now. i guess we just
have to live with it...


> ok, let me correct you :) simply add an attribute modifier to the
> created text field which adds all the necessary attributes
>

lol, sometimes the solution is just too damn obvious ;)

  Gerolf


>
> -igor
>
> >
> >   Gerolf
> >
> >
> >
> > > just my two cents
> >
> >
> > > all of these changes can be implemented now as well, since they do not
> > > break api
> > >
> > > well maybe at this point we should make (a) log a warning rather then
> > > error out and leave a todo for 1.4 to switch to error
> > >
> > > -igor
> > >
> > >
> > > On Nov 27, 2007 1:31 AM, Gerolf Seitz <gerolf.seitz@gmail.com > wrote:
> > > > i will add a big fat notice to the class's javadoc.
> > > > it wouldn't hurt either to add more examples to wicket-examples...
> > > >
> > > > will do so later this day...
> > > >
> > > >   Gerolf
> > > >
> > > >
> > > > On Nov 27, 2007 10:27 AM, Jason Anderson <jl...@gmail.com> wrote:
> > > >
> > > > > I had the same problem the first time i tried using the component,
> so
> > > > > I would have to agree that some sort of warning would be handy
> > > > >
> > > > > On Nov 27, 2007 1:14 AM, Gerolf Seitz <gerolf.seitz@gmail.com >
> wrote:
> > > > > > hi matt,
> > > > > >
> > > > > > DateField is derived from FormComponentPanel and thus the markup
> > > should
> > > > > look
> > > > > > something like this:
> > > > > >
> > > > > > <div wicket:id="dateField" class="text small"></div>
> > > > > >
> > > > > > maybe we should check that the associated tag is not an input
> tag,
> > > as
> > > > > this
> > > > > > is a rather common pitfall,
> > > > > > or rename DateField to DateFieldPanel, but it's most probably
> too
> > > late
> > > > > for
> > > > > > that.
> > > > > >
> > > > > > Eelco, wdyt?
> > > > > >
> > > > > >   Gerolf
> > > > > >
> > > > > >
> > > > > > On Nov 27, 2007 10:08 AM, mraible < matt@raibledesigns.com>
> wrote:
> > > > > >
> > > > > > >
> > > > > > > Changing the HTML from:
> > > > > > >
> > > > > > > <input type="text" wicket:id="birthday" class="text small"
> > > size="11"/>
> > > > > > >
> > > > > > > To:
> > > > > > >
> > > > > > > <div wicket:id="birthday"/>
> > > > > > >
> > > > > > > Solved my problem.
> > > > > > >
> > > > > > > Unfortunately, there doesn't seem to be a way (from markup) to
> add
> > > my
> > > > > > > class
> > > > > > > classes (text small) to the input field rendered by this
> > > component.
> > > > > > >
> > > > > > > Matt
> > > > > > >
> > > > > > >
> > > > > > > mraible wrote:
> > > > > > > >
> > > > > > > > For some reason, when using the new
> > > > > extensions.yui.calendar.DateField, I
> > > > > > > > end up with two text fields on my page. I'm sure it's
> something
> > > I'm
> > > > > > > doing
> > > > > > > > wrong, but I can't see the solution at 2 a.m. (and I haven't
> > > even
> > > > > been
> > > > > > > > drinking!). ;-)
> > > > > > > >
> > > > > > > > Java:
> > > > > > > >
> > > > > > > > add(new DateField("birthday"), new ResourceModel("
> user.birthday
> > > "));
> > > > > > > >
> > > > > > > > HTML:
> > > > > > > >
> > > > > > > > <tr>
> > > > > > > >     <th><wicket:message
> > > > > > > > key=" user.birthday">Birthday</wicket:message>:</th>
> > > > > > > >     <td>
> > > > > > > >         <input type="text" wicket:id="birthday" class="text
> > > small"
> > > > > > > > size="11"/>
> > > > > > > >         [birthday feedback]
> > > > > > > >     </td>
> > > > > > > > </tr>
> > > > > > > >
> > > > > > > > The rendered markup has two input fields. Any ideas how to
> fix?
> > > > > > > >
> > > > > > > > <tr>
> > > > > > > >     <th>Birthday:</th>
> > > > > > > >     <td>
> > > > > > > >         <input type="text" class="text small" size="11"
> > > > > name="birthday">
> > > > > > > >
> > > > > > > >     <input value="11/13/07" type="text" size="8"
> > > > > name="birthday:date"
> > > > > > > > id="date3"/>
> > > > > > > > &nbsp;
> > > > > > > >
> > > > >
> > >
> resources/org.apache.wicket.extensions.yui.calendar.DatePicker/icon1.gif
> > > > > > > >
> > > > > > > > </input>
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >     </td>
> > > > > > > > </tr>
> > > > > > > >
> > > > > > > > I've attached a screenshot of what it looks like.
> > > > > > > >
> > > > > > > > Thanks,
> > > > > > > >
> > > > > > > > Matt
> > > > > > > >
> > > > > > > >   http://www.nabble.com/file/p13967061/twodatefields.png
> > > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > View this message in context:
> > > > > > >
> > > > >
> > >
> http://www.nabble.com/DateField-renders-twice-in-1.3.0-rc1-tf4880492.html#a13967084
> > > > > > > Sent from the Wicket - User mailing list archive at Nabble.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
> > > > >
> > > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > 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: DateField renders twice in 1.3.0-rc1

Posted by Igor Vaynberg <ig...@gmail.com>.
On Nov 27, 2007 11:24 AM, Gerolf Seitz <ge...@gmail.com> wrote:
> >
> > a) it should check that it is attached to an input tag
> > b) it should call setrenderbodyonly(true) on itself
>
>
> this silently breaks the "api" (rather the usage), because you couldn't add
> it to an AjaxRequestTarget anymore

hmm, yeah that sucks a bit. we can mutate the tag and strip all
attributes, but then there is no good default to mutate it to as it
will most likely always mess with user's css. i guess the design of
this stinks a bit...

looking at markup like this

<label for="foo">date:</label><div wicket:id="date" id="foo"/>

rather then

<label for="foo">date:</label><input type="text" wicket:id="date" id="foo"/>

sucks. it is pretty unintuitive.

> > c) it should carry over any attributes from the panel tag to the inner
> > input tag
> >
>
> correct me if i'm wrong: this is not possible since the the actual
> DateTextField (and thus the inner input tag) is provided via a factory
> method,
> so we cannot make sure that users override the onComponentTag method to put
> attributes from the DateField's tag to the DateTextField's tag.
> not even considering the static factory methods on DateTextField...

ok, let me correct you :) simply add an attribute modifier to the
created text field which adds all the necessary attributes

-igor

>
>   Gerolf
>
>
>
> > just my two cents
>
>
> > all of these changes can be implemented now as well, since they do not
> > break api
> >
> > well maybe at this point we should make (a) log a warning rather then
> > error out and leave a todo for 1.4 to switch to error
> >
> > -igor
> >
> >
> > On Nov 27, 2007 1:31 AM, Gerolf Seitz <gerolf.seitz@gmail.com > wrote:
> > > i will add a big fat notice to the class's javadoc.
> > > it wouldn't hurt either to add more examples to wicket-examples...
> > >
> > > will do so later this day...
> > >
> > >   Gerolf
> > >
> > >
> > > On Nov 27, 2007 10:27 AM, Jason Anderson <jl...@gmail.com> wrote:
> > >
> > > > I had the same problem the first time i tried using the component, so
> > > > I would have to agree that some sort of warning would be handy
> > > >
> > > > On Nov 27, 2007 1:14 AM, Gerolf Seitz <gerolf.seitz@gmail.com > wrote:
> > > > > hi matt,
> > > > >
> > > > > DateField is derived from FormComponentPanel and thus the markup
> > should
> > > > look
> > > > > something like this:
> > > > >
> > > > > <div wicket:id="dateField" class="text small"></div>
> > > > >
> > > > > maybe we should check that the associated tag is not an input tag,
> > as
> > > > this
> > > > > is a rather common pitfall,
> > > > > or rename DateField to DateFieldPanel, but it's most probably too
> > late
> > > > for
> > > > > that.
> > > > >
> > > > > Eelco, wdyt?
> > > > >
> > > > >   Gerolf
> > > > >
> > > > >
> > > > > On Nov 27, 2007 10:08 AM, mraible < matt@raibledesigns.com> wrote:
> > > > >
> > > > > >
> > > > > > Changing the HTML from:
> > > > > >
> > > > > > <input type="text" wicket:id="birthday" class="text small"
> > size="11"/>
> > > > > >
> > > > > > To:
> > > > > >
> > > > > > <div wicket:id="birthday"/>
> > > > > >
> > > > > > Solved my problem.
> > > > > >
> > > > > > Unfortunately, there doesn't seem to be a way (from markup) to add
> > my
> > > > > > class
> > > > > > classes (text small) to the input field rendered by this
> > component.
> > > > > >
> > > > > > Matt
> > > > > >
> > > > > >
> > > > > > mraible wrote:
> > > > > > >
> > > > > > > For some reason, when using the new
> > > > extensions.yui.calendar.DateField, I
> > > > > > > end up with two text fields on my page. I'm sure it's something
> > I'm
> > > > > > doing
> > > > > > > wrong, but I can't see the solution at 2 a.m. (and I haven't
> > even
> > > > been
> > > > > > > drinking!). ;-)
> > > > > > >
> > > > > > > Java:
> > > > > > >
> > > > > > > add(new DateField("birthday"), new ResourceModel(" user.birthday
> > "));
> > > > > > >
> > > > > > > HTML:
> > > > > > >
> > > > > > > <tr>
> > > > > > >     <th><wicket:message
> > > > > > > key=" user.birthday">Birthday</wicket:message>:</th>
> > > > > > >     <td>
> > > > > > >         <input type="text" wicket:id="birthday" class="text
> > small"
> > > > > > > size="11"/>
> > > > > > >         [birthday feedback]
> > > > > > >     </td>
> > > > > > > </tr>
> > > > > > >
> > > > > > > The rendered markup has two input fields. Any ideas how to fix?
> > > > > > >
> > > > > > > <tr>
> > > > > > >     <th>Birthday:</th>
> > > > > > >     <td>
> > > > > > >         <input type="text" class="text small" size="11"
> > > > name="birthday">
> > > > > > >
> > > > > > >     <input value="11/13/07" type="text" size="8"
> > > > name="birthday:date"
> > > > > > > id="date3"/>
> > > > > > > &nbsp;
> > > > > > >
> > > >
> > resources/org.apache.wicket.extensions.yui.calendar.DatePicker/icon1.gif
> > > > > > >
> > > > > > > </input>
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >     </td>
> > > > > > > </tr>
> > > > > > >
> > > > > > > I've attached a screenshot of what it looks like.
> > > > > > >
> > > > > > > Thanks,
> > > > > > >
> > > > > > > Matt
> > > > > > >
> > > > > > >   http://www.nabble.com/file/p13967061/twodatefields.png
> > > > > > >
> > > > > >
> > > > > > --
> > > > > > View this message in context:
> > > > > >
> > > >
> > http://www.nabble.com/DateField-renders-twice-in-1.3.0-rc1-tf4880492.html#a13967084
> > > > > > Sent from the Wicket - User mailing list archive at Nabble.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
> > > >
> > > >
> > >
> >
> > ---------------------------------------------------------------------
> > 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: DateField renders twice in 1.3.0-rc1

Posted by Gerolf Seitz <ge...@gmail.com>.
>
> a) it should check that it is attached to an input tag
> b) it should call setrenderbodyonly(true) on itself


this silently breaks the "api" (rather the usage), because you couldn't add
it to an AjaxRequestTarget anymore


>
> c) it should carry over any attributes from the panel tag to the inner
> input tag
>

correct me if i'm wrong: this is not possible since the the actual
DateTextField (and thus the inner input tag) is provided via a factory
method,
so we cannot make sure that users override the onComponentTag method to put
attributes from the DateField's tag to the DateTextField's tag.
not even considering the static factory methods on DateTextField...

  Gerolf


> just my two cents


> all of these changes can be implemented now as well, since they do not
> break api
>
> well maybe at this point we should make (a) log a warning rather then
> error out and leave a todo for 1.4 to switch to error
>
> -igor
>
>
> On Nov 27, 2007 1:31 AM, Gerolf Seitz <gerolf.seitz@gmail.com > wrote:
> > i will add a big fat notice to the class's javadoc.
> > it wouldn't hurt either to add more examples to wicket-examples...
> >
> > will do so later this day...
> >
> >   Gerolf
> >
> >
> > On Nov 27, 2007 10:27 AM, Jason Anderson <jl...@gmail.com> wrote:
> >
> > > I had the same problem the first time i tried using the component, so
> > > I would have to agree that some sort of warning would be handy
> > >
> > > On Nov 27, 2007 1:14 AM, Gerolf Seitz <gerolf.seitz@gmail.com > wrote:
> > > > hi matt,
> > > >
> > > > DateField is derived from FormComponentPanel and thus the markup
> should
> > > look
> > > > something like this:
> > > >
> > > > <div wicket:id="dateField" class="text small"></div>
> > > >
> > > > maybe we should check that the associated tag is not an input tag,
> as
> > > this
> > > > is a rather common pitfall,
> > > > or rename DateField to DateFieldPanel, but it's most probably too
> late
> > > for
> > > > that.
> > > >
> > > > Eelco, wdyt?
> > > >
> > > >   Gerolf
> > > >
> > > >
> > > > On Nov 27, 2007 10:08 AM, mraible < matt@raibledesigns.com> wrote:
> > > >
> > > > >
> > > > > Changing the HTML from:
> > > > >
> > > > > <input type="text" wicket:id="birthday" class="text small"
> size="11"/>
> > > > >
> > > > > To:
> > > > >
> > > > > <div wicket:id="birthday"/>
> > > > >
> > > > > Solved my problem.
> > > > >
> > > > > Unfortunately, there doesn't seem to be a way (from markup) to add
> my
> > > > > class
> > > > > classes (text small) to the input field rendered by this
> component.
> > > > >
> > > > > Matt
> > > > >
> > > > >
> > > > > mraible wrote:
> > > > > >
> > > > > > For some reason, when using the new
> > > extensions.yui.calendar.DateField, I
> > > > > > end up with two text fields on my page. I'm sure it's something
> I'm
> > > > > doing
> > > > > > wrong, but I can't see the solution at 2 a.m. (and I haven't
> even
> > > been
> > > > > > drinking!). ;-)
> > > > > >
> > > > > > Java:
> > > > > >
> > > > > > add(new DateField("birthday"), new ResourceModel(" user.birthday
> "));
> > > > > >
> > > > > > HTML:
> > > > > >
> > > > > > <tr>
> > > > > >     <th><wicket:message
> > > > > > key=" user.birthday">Birthday</wicket:message>:</th>
> > > > > >     <td>
> > > > > >         <input type="text" wicket:id="birthday" class="text
> small"
> > > > > > size="11"/>
> > > > > >         [birthday feedback]
> > > > > >     </td>
> > > > > > </tr>
> > > > > >
> > > > > > The rendered markup has two input fields. Any ideas how to fix?
> > > > > >
> > > > > > <tr>
> > > > > >     <th>Birthday:</th>
> > > > > >     <td>
> > > > > >         <input type="text" class="text small" size="11"
> > > name="birthday">
> > > > > >
> > > > > >     <input value="11/13/07" type="text" size="8"
> > > name="birthday:date"
> > > > > > id="date3"/>
> > > > > > &nbsp;
> > > > > >
> > >
> resources/org.apache.wicket.extensions.yui.calendar.DatePicker/icon1.gif
> > > > > >
> > > > > > </input>
> > > > > >
> > > > > >
> > > > > >
> > > > > >     </td>
> > > > > > </tr>
> > > > > >
> > > > > > I've attached a screenshot of what it looks like.
> > > > > >
> > > > > > Thanks,
> > > > > >
> > > > > > Matt
> > > > > >
> > > > > >   http://www.nabble.com/file/p13967061/twodatefields.png
> > > > > >
> > > > >
> > > > > --
> > > > > View this message in context:
> > > > >
> > >
> http://www.nabble.com/DateField-renders-twice-in-1.3.0-rc1-tf4880492.html#a13967084
> > > > > Sent from the Wicket - User mailing list archive at Nabble.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
> > >
> > >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: DateField renders twice in 1.3.0-rc1

Posted by Igor Vaynberg <ig...@gmail.com>.
here is what this should be doing:

a) it should check that it is attached to an input tag
b) it should call setrenderbodyonly(true) on itself
c) it should carry over any attributes from the panel tag to the inner input tag

just my two cents

all of these changes can be implemented now as well, since they do not break api

well maybe at this point we should make (a) log a warning rather then
error out and leave a todo for 1.4 to switch to error

-igor


On Nov 27, 2007 1:31 AM, Gerolf Seitz <ge...@gmail.com> wrote:
> i will add a big fat notice to the class's javadoc.
> it wouldn't hurt either to add more examples to wicket-examples...
>
> will do so later this day...
>
>   Gerolf
>
>
> On Nov 27, 2007 10:27 AM, Jason Anderson <jl...@gmail.com> wrote:
>
> > I had the same problem the first time i tried using the component, so
> > I would have to agree that some sort of warning would be handy
> >
> > On Nov 27, 2007 1:14 AM, Gerolf Seitz <ge...@gmail.com> wrote:
> > > hi matt,
> > >
> > > DateField is derived from FormComponentPanel and thus the markup should
> > look
> > > something like this:
> > >
> > > <div wicket:id="dateField" class="text small"></div>
> > >
> > > maybe we should check that the associated tag is not an input tag, as
> > this
> > > is a rather common pitfall,
> > > or rename DateField to DateFieldPanel, but it's most probably too late
> > for
> > > that.
> > >
> > > Eelco, wdyt?
> > >
> > >   Gerolf
> > >
> > >
> > > On Nov 27, 2007 10:08 AM, mraible <ma...@raibledesigns.com> wrote:
> > >
> > > >
> > > > Changing the HTML from:
> > > >
> > > > <input type="text" wicket:id="birthday" class="text small" size="11"/>
> > > >
> > > > To:
> > > >
> > > > <div wicket:id="birthday"/>
> > > >
> > > > Solved my problem.
> > > >
> > > > Unfortunately, there doesn't seem to be a way (from markup) to add my
> > > > class
> > > > classes (text small) to the input field rendered by this component.
> > > >
> > > > Matt
> > > >
> > > >
> > > > mraible wrote:
> > > > >
> > > > > For some reason, when using the new
> > extensions.yui.calendar.DateField, I
> > > > > end up with two text fields on my page. I'm sure it's something I'm
> > > > doing
> > > > > wrong, but I can't see the solution at 2 a.m. (and I haven't even
> > been
> > > > > drinking!). ;-)
> > > > >
> > > > > Java:
> > > > >
> > > > > add(new DateField("birthday"), new ResourceModel("user.birthday"));
> > > > >
> > > > > HTML:
> > > > >
> > > > > <tr>
> > > > >     <th><wicket:message
> > > > > key="user.birthday">Birthday</wicket:message>:</th>
> > > > >     <td>
> > > > >         <input type="text" wicket:id="birthday" class="text small"
> > > > > size="11"/>
> > > > >         [birthday feedback]
> > > > >     </td>
> > > > > </tr>
> > > > >
> > > > > The rendered markup has two input fields. Any ideas how to fix?
> > > > >
> > > > > <tr>
> > > > >     <th>Birthday:</th>
> > > > >     <td>
> > > > >         <input type="text" class="text small" size="11"
> > name="birthday">
> > > > >
> > > > >     <input value="11/13/07" type="text" size="8"
> > name="birthday:date"
> > > > > id="date3"/>
> > > > > &nbsp;
> > > > >
> > resources/org.apache.wicket.extensions.yui.calendar.DatePicker/icon1.gif
> > > > >
> > > > > </input>
> > > > >
> > > > >
> > > > >
> > > > >     </td>
> > > > > </tr>
> > > > >
> > > > > I've attached a screenshot of what it looks like.
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Matt
> > > > >
> > > > >  http://www.nabble.com/file/p13967061/twodatefields.png
> > > > >
> > > >
> > > > --
> > > > View this message in context:
> > > >
> > http://www.nabble.com/DateField-renders-twice-in-1.3.0-rc1-tf4880492.html#a13967084
> > > > Sent from the Wicket - User mailing list archive at Nabble.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
> >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: DateField renders twice in 1.3.0-rc1

Posted by Gerolf Seitz <ge...@gmail.com>.
i will add a big fat notice to the class's javadoc.
it wouldn't hurt either to add more examples to wicket-examples...

will do so later this day...

  Gerolf

On Nov 27, 2007 10:27 AM, Jason Anderson <jl...@gmail.com> wrote:

> I had the same problem the first time i tried using the component, so
> I would have to agree that some sort of warning would be handy
>
> On Nov 27, 2007 1:14 AM, Gerolf Seitz <ge...@gmail.com> wrote:
> > hi matt,
> >
> > DateField is derived from FormComponentPanel and thus the markup should
> look
> > something like this:
> >
> > <div wicket:id="dateField" class="text small"></div>
> >
> > maybe we should check that the associated tag is not an input tag, as
> this
> > is a rather common pitfall,
> > or rename DateField to DateFieldPanel, but it's most probably too late
> for
> > that.
> >
> > Eelco, wdyt?
> >
> >   Gerolf
> >
> >
> > On Nov 27, 2007 10:08 AM, mraible <ma...@raibledesigns.com> wrote:
> >
> > >
> > > Changing the HTML from:
> > >
> > > <input type="text" wicket:id="birthday" class="text small" size="11"/>
> > >
> > > To:
> > >
> > > <div wicket:id="birthday"/>
> > >
> > > Solved my problem.
> > >
> > > Unfortunately, there doesn't seem to be a way (from markup) to add my
> > > class
> > > classes (text small) to the input field rendered by this component.
> > >
> > > Matt
> > >
> > >
> > > mraible wrote:
> > > >
> > > > For some reason, when using the new
> extensions.yui.calendar.DateField, I
> > > > end up with two text fields on my page. I'm sure it's something I'm
> > > doing
> > > > wrong, but I can't see the solution at 2 a.m. (and I haven't even
> been
> > > > drinking!). ;-)
> > > >
> > > > Java:
> > > >
> > > > add(new DateField("birthday"), new ResourceModel("user.birthday"));
> > > >
> > > > HTML:
> > > >
> > > > <tr>
> > > >     <th><wicket:message
> > > > key="user.birthday">Birthday</wicket:message>:</th>
> > > >     <td>
> > > >         <input type="text" wicket:id="birthday" class="text small"
> > > > size="11"/>
> > > >         [birthday feedback]
> > > >     </td>
> > > > </tr>
> > > >
> > > > The rendered markup has two input fields. Any ideas how to fix?
> > > >
> > > > <tr>
> > > >     <th>Birthday:</th>
> > > >     <td>
> > > >         <input type="text" class="text small" size="11"
> name="birthday">
> > > >
> > > >     <input value="11/13/07" type="text" size="8"
> name="birthday:date"
> > > > id="date3"/>
> > > > &nbsp;
> > > >
> resources/org.apache.wicket.extensions.yui.calendar.DatePicker/icon1.gif
> > > >
> > > > </input>
> > > >
> > > >
> > > >
> > > >     </td>
> > > > </tr>
> > > >
> > > > I've attached a screenshot of what it looks like.
> > > >
> > > > Thanks,
> > > >
> > > > Matt
> > > >
> > > >  http://www.nabble.com/file/p13967061/twodatefields.png
> > > >
> > >
> > > --
> > > View this message in context:
> > >
> http://www.nabble.com/DateField-renders-twice-in-1.3.0-rc1-tf4880492.html#a13967084
> > > Sent from the Wicket - User mailing list archive at Nabble.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: DateField renders twice in 1.3.0-rc1

Posted by Jason Anderson <jl...@gmail.com>.
I had the same problem the first time i tried using the component, so
I would have to agree that some sort of warning would be handy

On Nov 27, 2007 1:14 AM, Gerolf Seitz <ge...@gmail.com> wrote:
> hi matt,
>
> DateField is derived from FormComponentPanel and thus the markup should look
> something like this:
>
> <div wicket:id="dateField" class="text small"></div>
>
> maybe we should check that the associated tag is not an input tag, as this
> is a rather common pitfall,
> or rename DateField to DateFieldPanel, but it's most probably too late for
> that.
>
> Eelco, wdyt?
>
>   Gerolf
>
>
> On Nov 27, 2007 10:08 AM, mraible <ma...@raibledesigns.com> wrote:
>
> >
> > Changing the HTML from:
> >
> > <input type="text" wicket:id="birthday" class="text small" size="11"/>
> >
> > To:
> >
> > <div wicket:id="birthday"/>
> >
> > Solved my problem.
> >
> > Unfortunately, there doesn't seem to be a way (from markup) to add my
> > class
> > classes (text small) to the input field rendered by this component.
> >
> > Matt
> >
> >
> > mraible wrote:
> > >
> > > For some reason, when using the new extensions.yui.calendar.DateField, I
> > > end up with two text fields on my page. I'm sure it's something I'm
> > doing
> > > wrong, but I can't see the solution at 2 a.m. (and I haven't even been
> > > drinking!). ;-)
> > >
> > > Java:
> > >
> > > add(new DateField("birthday"), new ResourceModel("user.birthday"));
> > >
> > > HTML:
> > >
> > > <tr>
> > >     <th><wicket:message
> > > key="user.birthday">Birthday</wicket:message>:</th>
> > >     <td>
> > >         <input type="text" wicket:id="birthday" class="text small"
> > > size="11"/>
> > >         [birthday feedback]
> > >     </td>
> > > </tr>
> > >
> > > The rendered markup has two input fields. Any ideas how to fix?
> > >
> > > <tr>
> > >     <th>Birthday:</th>
> > >     <td>
> > >         <input type="text" class="text small" size="11" name="birthday">
> > >
> > >     <input value="11/13/07" type="text" size="8" name="birthday:date"
> > > id="date3"/>
> > > &nbsp;
> > > resources/org.apache.wicket.extensions.yui.calendar.DatePicker/icon1.gif
> > >
> > > </input>
> > >
> > >
> > >
> > >     </td>
> > > </tr>
> > >
> > > I've attached a screenshot of what it looks like.
> > >
> > > Thanks,
> > >
> > > Matt
> > >
> > >  http://www.nabble.com/file/p13967061/twodatefields.png
> > >
> >
> > --
> > View this message in context:
> > http://www.nabble.com/DateField-renders-twice-in-1.3.0-rc1-tf4880492.html#a13967084
> > Sent from the Wicket - User mailing list archive at Nabble.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: DateField renders twice in 1.3.0-rc1

Posted by Gerolf Seitz <ge...@gmail.com>.
hi matt,

DateField is derived from FormComponentPanel and thus the markup should look
something like this:

<div wicket:id="dateField" class="text small"></div>

maybe we should check that the associated tag is not an input tag, as this
is a rather common pitfall,
or rename DateField to DateFieldPanel, but it's most probably too late for
that.

Eelco, wdyt?

  Gerolf

On Nov 27, 2007 10:08 AM, mraible <ma...@raibledesigns.com> wrote:

>
> Changing the HTML from:
>
> <input type="text" wicket:id="birthday" class="text small" size="11"/>
>
> To:
>
> <div wicket:id="birthday"/>
>
> Solved my problem.
>
> Unfortunately, there doesn't seem to be a way (from markup) to add my
> class
> classes (text small) to the input field rendered by this component.
>
> Matt
>
>
> mraible wrote:
> >
> > For some reason, when using the new extensions.yui.calendar.DateField, I
> > end up with two text fields on my page. I'm sure it's something I'm
> doing
> > wrong, but I can't see the solution at 2 a.m. (and I haven't even been
> > drinking!). ;-)
> >
> > Java:
> >
> > add(new DateField("birthday"), new ResourceModel("user.birthday"));
> >
> > HTML:
> >
> > <tr>
> >     <th><wicket:message
> > key="user.birthday">Birthday</wicket:message>:</th>
> >     <td>
> >         <input type="text" wicket:id="birthday" class="text small"
> > size="11"/>
> >         [birthday feedback]
> >     </td>
> > </tr>
> >
> > The rendered markup has two input fields. Any ideas how to fix?
> >
> > <tr>
> >     <th>Birthday:</th>
> >     <td>
> >         <input type="text" class="text small" size="11" name="birthday">
> >
> >     <input value="11/13/07" type="text" size="8" name="birthday:date"
> > id="date3"/>
> > &nbsp;
> > resources/org.apache.wicket.extensions.yui.calendar.DatePicker/icon1.gif
> >
> > </input>
> >
> >
> >
> >     </td>
> > </tr>
> >
> > I've attached a screenshot of what it looks like.
> >
> > Thanks,
> >
> > Matt
> >
> >  http://www.nabble.com/file/p13967061/twodatefields.png
> >
>
> --
> View this message in context:
> http://www.nabble.com/DateField-renders-twice-in-1.3.0-rc1-tf4880492.html#a13967084
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: DateField renders twice in 1.3.0-rc1

Posted by mraible <ma...@raibledesigns.com>.
Changing the HTML from:

<input type="text" wicket:id="birthday" class="text small" size="11"/>

To:

<div wicket:id="birthday"/>

Solved my problem.

Unfortunately, there doesn't seem to be a way (from markup) to add my class
classes (text small) to the input field rendered by this component.

Matt


mraible wrote:
> 
> For some reason, when using the new extensions.yui.calendar.DateField, I
> end up with two text fields on my page. I'm sure it's something I'm doing
> wrong, but I can't see the solution at 2 a.m. (and I haven't even been
> drinking!). ;-)
> 
> Java:
> 
> add(new DateField("birthday"), new ResourceModel("user.birthday"));
> 
> HTML:
> 
> <tr>
>     <th><wicket:message
> key="user.birthday">Birthday</wicket:message>:</th>
>     <td>
>         <input type="text" wicket:id="birthday" class="text small"
> size="11"/>
>         [birthday feedback]    
>     </td>
> </tr>
> 
> The rendered markup has two input fields. Any ideas how to fix?
> 
> <tr>
>     <th>Birthday:</th>
>     <td>
>         <input type="text" class="text small" size="11" name="birthday">
>   
>     <input value="11/13/07" type="text" size="8" name="birthday:date"
> id="date3"/>
> &nbsp;
> resources/org.apache.wicket.extensions.yui.calendar.DatePicker/icon1.gif 
>   
> </input>
>         
>   
>     
>     </td>
> </tr>
> 
> I've attached a screenshot of what it looks like.
> 
> Thanks,
> 
> Matt
> 
>  http://www.nabble.com/file/p13967061/twodatefields.png 
> 

-- 
View this message in context: http://www.nabble.com/DateField-renders-twice-in-1.3.0-rc1-tf4880492.html#a13967084
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org