You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Johan Compagner <jc...@gmail.com> on 2007/02/19 16:00:09 UTC
DatePicker (then new one in wicket-datetime)
i see this in that behavior:
public void onRendered(Component component) {
super.onRendered(component);
// Append the span and img icon right after the rendering of the
// component. Not as pretty as working with a panel etc, but works
// for behaviors and is more efficient
Response response = component.getResponse();
response
.write("\n<span> <div style=\"display:none;z-index:
99999;position:absolute;\" id=\"");
response.write(getCalendarMarkupId());
response
.write("\"></div><img style=\"cursor: pointer; border:
none;\" id=\"");
response.write(getIconId());
response.write("\" src=\"");
CharSequence iconUrl = getIconUrl();
response.write(Strings.escapeMarkup(iconUrl != null ? iconUrl
.toString() : ""));
response.write("\" /></span>");
}
but that doesnt work at my place, because everything is position in css.
this works for me: (as an example if the component had a width of 140px )
public void onRendered(Component component) {
super.onRendered(component);
// Append the span and img icon right after the rendering of the
// component. Not as pretty as working with a panel etc, but works
// for behaviors and is more efficient
Response response = component.getResponse();
response
.write("\n<span> <div style=\"display:none;z-index:
99999;position:absolute;\" id=\"");
response.write(getCalendarMarkupId());
response
.write("\"></div><img style=\"cursor: pointer; border:
none;position:absolute;left:140px;\" id=\"");
response.write(getIconId());
response.write("\" src=\"");
CharSequence iconUrl = getIconUrl();
response.write(Strings.escapeMarkup(iconUrl != null ? iconUrl
.toString() : ""));
response.write("\" /></span>");
}
ofcourse i can override the complete onRendered again and do that
implementation.
or we give a few more call backs like generateImgTag()??
Also the popup when i click on the img is to small. for example i miss the
arrow button to scroll forward in the months
Where is that specified?
johan
Re: DatePicker (then new one in wicket-datetime)
Posted by Eelco Hillenius <ee...@gmail.com>.
It looks like you can also use things like:
myCal.outerContainer.style.top=100px;
myCal.outerContainer.style.left=100px;
when initializing the calendar widget. Maybe you could investigate the
YUI widget a bit (and their mailing lists). See
http://developer.yahoo.com/yui/calendar/ and
http://tech.groups.yahoo.com/group/ydn-javascript/
Eelco
On 2/19/07, Johan Compagner <jc...@gmail.com> wrote:
> Filtered! So i couldn't see that nice picture :(
>
> How do you place the field itself? For servoy we use all CSS fixed
> positioning
> Then it doesn't work. I have to include that left:xxx else it will be
> completely in the front.
>
> johan
>
>
> On 2/19/07, Eelco Hillenius <ee...@gmail.com> wrote:
> >
> > On 2/19/07, Johan Compagner <jc...@gmail.com> wrote:
> > > that value is just something that works for my field because that field
> > was
> > > almost that big.
> > > But i don't want it to be after the field, but i want it to be over the
> > > field bu then completely to the right.
> > >
> > > But i think we just need to have a over ridable method yes. But what to
> > > extract?
> > > the complete img? or just the style?
> >
> > It's the div, not the image you're after here, correct? The image is
> > for the datepicker icon, so that would be a separate call.
> >
> > The default actually works great for me, as it always places the
> > calendar right under the text field I'm coupling it to, it's right
> > aligned to the right of the field (see attached image if that doesn't
> > get filtered by apache).
> >
> > Eelco
> >
>
Re: DatePicker (then new one in wicket-datetime)
Posted by Johan Compagner <jc...@gmail.com>.
I made a method getIconStyle()
and i dynamically set the right left value, that works great now.
But still the container that is displayed is to small when the datefield
(with the icon besides or inside it) is small
What it does is that the left corner of the popup begins at the beginning of
the date input field
and the right corner is just at the beginnen of the icon (that is in my
place just inside completely toe the right of the input field)
So if i make the input field big (quite big!) then it displays fine. to
small then it goes wrong.
johan
On 2/20/07, Frank Bille <fr...@gmail.com> wrote:
>
> I don't have absolute positioning, so the calendar works just fine :)
>
> Frank
>
>
> On 2/19/07, Eelco Hillenius <ee...@gmail.com> wrote:
> >
> > Frank, you are using this new datepicker... how do you use it?
> >
> > Eelco
> >
> >
> > On 2/19/07, Johan Compagner <jc...@gmail.com> wrote:
> > > Filtered! So i couldn't see that nice picture :(
> > >
> > > How do you place the field itself? For servoy we use all CSS fixed
> > > positioning
> > > Then it doesn't work. I have to include that left:xxx else it will be
> > > completely in the front.
> > >
> > > johan
> > >
> > >
> > > On 2/19/07, Eelco Hillenius <ee...@gmail.com> wrote:
> > > >
> > > > On 2/19/07, Johan Compagner <jc...@gmail.com> wrote:
> > > > > that value is just something that works for my field because that
> > field
> > > > was
> > > > > almost that big.
> > > > > But i don't want it to be after the field, but i want it to be
> over
> > the
> > > > > field bu then completely to the right.
> > > > >
> > > > > But i think we just need to have a over ridable method yes. But
> what
> > to
> > > > > extract?
> > > > > the complete img? or just the style?
> > > >
> > > > It's the div, not the image you're after here, correct? The image is
> > > > for the datepicker icon, so that would be a separate call.
> > > >
> > > > The default actually works great for me, as it always places the
> > > > calendar right under the text field I'm coupling it to, it's right
> > > > aligned to the right of the field (see attached image if that
> doesn't
> > > > get filtered by apache).
> > > >
> > > > Eelco
> > > >
> > >
> >
>
Re: DatePicker (then new one in wicket-datetime)
Posted by Frank Bille <fr...@gmail.com>.
I don't have absolute positioning, so the calendar works just fine :)
Frank
On 2/19/07, Eelco Hillenius <ee...@gmail.com> wrote:
>
> Frank, you are using this new datepicker... how do you use it?
>
> Eelco
>
>
> On 2/19/07, Johan Compagner <jc...@gmail.com> wrote:
> > Filtered! So i couldn't see that nice picture :(
> >
> > How do you place the field itself? For servoy we use all CSS fixed
> > positioning
> > Then it doesn't work. I have to include that left:xxx else it will be
> > completely in the front.
> >
> > johan
> >
> >
> > On 2/19/07, Eelco Hillenius <ee...@gmail.com> wrote:
> > >
> > > On 2/19/07, Johan Compagner <jc...@gmail.com> wrote:
> > > > that value is just something that works for my field because that
> field
> > > was
> > > > almost that big.
> > > > But i don't want it to be after the field, but i want it to be over
> the
> > > > field bu then completely to the right.
> > > >
> > > > But i think we just need to have a over ridable method yes. But what
> to
> > > > extract?
> > > > the complete img? or just the style?
> > >
> > > It's the div, not the image you're after here, correct? The image is
> > > for the datepicker icon, so that would be a separate call.
> > >
> > > The default actually works great for me, as it always places the
> > > calendar right under the text field I'm coupling it to, it's right
> > > aligned to the right of the field (see attached image if that doesn't
> > > get filtered by apache).
> > >
> > > Eelco
> > >
> >
>
Re: DatePicker (then new one in wicket-datetime)
Posted by Eelco Hillenius <ee...@gmail.com>.
Frank, you are using this new datepicker... how do you use it?
Eelco
On 2/19/07, Johan Compagner <jc...@gmail.com> wrote:
> Filtered! So i couldn't see that nice picture :(
>
> How do you place the field itself? For servoy we use all CSS fixed
> positioning
> Then it doesn't work. I have to include that left:xxx else it will be
> completely in the front.
>
> johan
>
>
> On 2/19/07, Eelco Hillenius <ee...@gmail.com> wrote:
> >
> > On 2/19/07, Johan Compagner <jc...@gmail.com> wrote:
> > > that value is just something that works for my field because that field
> > was
> > > almost that big.
> > > But i don't want it to be after the field, but i want it to be over the
> > > field bu then completely to the right.
> > >
> > > But i think we just need to have a over ridable method yes. But what to
> > > extract?
> > > the complete img? or just the style?
> >
> > It's the div, not the image you're after here, correct? The image is
> > for the datepicker icon, so that would be a separate call.
> >
> > The default actually works great for me, as it always places the
> > calendar right under the text field I'm coupling it to, it's right
> > aligned to the right of the field (see attached image if that doesn't
> > get filtered by apache).
> >
> > Eelco
> >
>
Re: DatePicker (then new one in wicket-datetime)
Posted by Johan Compagner <jc...@gmail.com>.
Filtered! So i couldn't see that nice picture :(
How do you place the field itself? For servoy we use all CSS fixed
positioning
Then it doesn't work. I have to include that left:xxx else it will be
completely in the front.
johan
On 2/19/07, Eelco Hillenius <ee...@gmail.com> wrote:
>
> On 2/19/07, Johan Compagner <jc...@gmail.com> wrote:
> > that value is just something that works for my field because that field
> was
> > almost that big.
> > But i don't want it to be after the field, but i want it to be over the
> > field bu then completely to the right.
> >
> > But i think we just need to have a over ridable method yes. But what to
> > extract?
> > the complete img? or just the style?
>
> It's the div, not the image you're after here, correct? The image is
> for the datepicker icon, so that would be a separate call.
>
> The default actually works great for me, as it always places the
> calendar right under the text field I'm coupling it to, it's right
> aligned to the right of the field (see attached image if that doesn't
> get filtered by apache).
>
> Eelco
>
Re: DatePicker (then new one in wicket-datetime)
Posted by Eelco Hillenius <ee...@gmail.com>.
On 2/19/07, Johan Compagner <jc...@gmail.com> wrote:
> that value is just something that works for my field because that field was
> almost that big.
> But i don't want it to be after the field, but i want it to be over the
> field bu then completely to the right.
>
> But i think we just need to have a over ridable method yes. But what to
> extract?
> the complete img? or just the style?
It's the div, not the image you're after here, correct? The image is
for the datepicker icon, so that would be a separate call.
The default actually works great for me, as it always places the
calendar right under the text field I'm coupling it to, it's right
aligned to the right of the field (see attached image if that doesn't
get filtered by apache).
Eelco
Re: DatePicker (then new one in wicket-datetime)
Posted by Johan Compagner <jc...@gmail.com>.
that value is just something that works for my field because that field was
almost that big.
But i don't want it to be after the field, but i want it to be over the
field bu then completely to the right.
But i think we just need to have a over ridable method yes. But what to
extract?
the complete img? or just the style?
johan
On 2/19/07, Eelco Hillenius <ee...@gmail.com> wrote:
>
> So this: "left:140px;" <--
>
> is the difference, correct?
>
> I guess the thing to do here is to append the div and maybe the image
> in a separate overridable methods.
>
> Eelco
>
>
> On 2/19/07, Johan Compagner <jc...@gmail.com> wrote:
> > i see this in that behavior:
> >
> > public void onRendered(Component component) {
> > super.onRendered(component);
> > // Append the span and img icon right after the rendering of the
> > // component. Not as pretty as working with a panel etc, but
> works
> > // for behaviors and is more efficient
> > Response response = component.getResponse();
> > response
> > .write("\n<span> <div style=\"display:none;z-index:
> > 99999;position:absolute;\" id=\"");
> > response.write(getCalendarMarkupId());
> > response
> > .write("\"></div><img style=\"cursor: pointer; border:
> > none;\" id=\"");
> > response.write(getIconId());
> > response.write("\" src=\"");
> > CharSequence iconUrl = getIconUrl();
> > response.write(Strings.escapeMarkup(iconUrl != null ? iconUrl
> > .toString() : ""));
> > response.write("\" /></span>");
> > }
> >
> > but that doesnt work at my place, because everything is position in css.
> > this works for me: (as an example if the component had a width of 140px
> )
> >
> > public void onRendered(Component component) {
> > super.onRendered(component);
> > // Append the span and img icon right after the rendering of the
> > // component. Not as pretty as working with a panel etc, but
> works
> > // for behaviors and is more efficient
> > Response response = component.getResponse();
> > response
> > .write("\n<span> <div style=\"display:none;z-index:
> > 99999;position:absolute;\" id=\"");
> > response.write(getCalendarMarkupId());
> > response
> > .write("\"></div><img style=\"cursor: pointer; border:
> > none;position:absolute;left:140px;\" id=\"");
> > response.write(getIconId());
> > response.write("\" src=\"");
> > CharSequence iconUrl = getIconUrl();
> > response.write(Strings.escapeMarkup(iconUrl != null ? iconUrl
> > .toString() : ""));
> > response.write("\" /></span>");
> > }
> >
> >
> > ofcourse i can override the complete onRendered again and do that
> > implementation.
> > or we give a few more call backs like generateImgTag()??
> >
> > Also the popup when i click on the img is to small. for example i miss
> the
> > arrow button to scroll forward in the months
> > Where is that specified?
> >
> > johan
> >
>
Re: DatePicker (then new one in wicket-datetime)
Posted by Eelco Hillenius <ee...@gmail.com>.
So this: "left:140px;" <--
is the difference, correct?
I guess the thing to do here is to append the div and maybe the image
in a separate overridable methods.
Eelco
On 2/19/07, Johan Compagner <jc...@gmail.com> wrote:
> i see this in that behavior:
>
> public void onRendered(Component component) {
> super.onRendered(component);
> // Append the span and img icon right after the rendering of the
> // component. Not as pretty as working with a panel etc, but works
> // for behaviors and is more efficient
> Response response = component.getResponse();
> response
> .write("\n<span> <div style=\"display:none;z-index:
> 99999;position:absolute;\" id=\"");
> response.write(getCalendarMarkupId());
> response
> .write("\"></div><img style=\"cursor: pointer; border:
> none;\" id=\"");
> response.write(getIconId());
> response.write("\" src=\"");
> CharSequence iconUrl = getIconUrl();
> response.write(Strings.escapeMarkup(iconUrl != null ? iconUrl
> .toString() : ""));
> response.write("\" /></span>");
> }
>
> but that doesnt work at my place, because everything is position in css.
> this works for me: (as an example if the component had a width of 140px )
>
> public void onRendered(Component component) {
> super.onRendered(component);
> // Append the span and img icon right after the rendering of the
> // component. Not as pretty as working with a panel etc, but works
> // for behaviors and is more efficient
> Response response = component.getResponse();
> response
> .write("\n<span> <div style=\"display:none;z-index:
> 99999;position:absolute;\" id=\"");
> response.write(getCalendarMarkupId());
> response
> .write("\"></div><img style=\"cursor: pointer; border:
> none;position:absolute;left:140px;\" id=\"");
> response.write(getIconId());
> response.write("\" src=\"");
> CharSequence iconUrl = getIconUrl();
> response.write(Strings.escapeMarkup(iconUrl != null ? iconUrl
> .toString() : ""));
> response.write("\" /></span>");
> }
>
>
> ofcourse i can override the complete onRendered again and do that
> implementation.
> or we give a few more call backs like generateImgTag()??
>
> Also the popup when i click on the img is to small. for example i miss the
> arrow button to scroll forward in the months
> Where is that specified?
>
> johan
>