OpenLaszlo Dev Tip - Howto stop datepicker from being pushy
I've been meaning to post about how angry I was getting at the OpenLaszlo "date picker" component. The issue that was driving me up the wall is exactly what OpenLaszlo's documentation shows the date picker doing.
You see how the icon in the upper left is directly above the "April 20 2004"?

When you click that icon, the date picker appears. But look at what happened to the "April 20 2004" text. It pushes the text down the canvas...
Which is fine for this example, but it's not how I want the date picker to act in one of my forms.
I tried a couple of things to get around this, but they didn't work. (More on them in a second.)
.... Stay with me while I make this jump ....
I got curious if any blogs out there have mentioned Ataraxis Software. I hit Feedster and found that Chris Kohlhardt, a former employee of Laszlo Systems and founder of a new software startup had mentioned me in a blog post. I started looking around his site a little and I noticed this!
This guy wrote the date picker! Maybe he can help... So I shot off an email to him.
He wrote back, "You're a complete idiot."
Ok, I'm lieing. He didn't write that. But it caught your attention, didn't it?
Here is the email conversation - edited for time.
So here is the date picker code that will allow the date picker to float above the surrounding content. Tweak it for your app.
THANKS CHRIS!
You see how the icon in the upper left is directly above the "April 20 2004"?

When you click that icon, the date picker appears. But look at what happened to the "April 20 2004" text. It pushes the text down the canvas...
Which is fine for this example, but it's not how I want the date picker to act in one of my forms.I tried a couple of things to get around this, but they didn't work. (More on them in a second.)
.... Stay with me while I make this jump ....
I got curious if any blogs out there have mentioned Ataraxis Software. I hit Feedster and found that Chris Kohlhardt, a former employee of Laszlo Systems and founder of a new software startup had mentioned me in a blog post. I started looking around his site a little and I noticed this!
This guy wrote the date picker! Maybe he can help... So I shot off an email to him.He wrote back, "You're a complete idiot."
Ok, I'm lieing. He didn't write that. But it caught your attention, didn't it?
Here is the email conversation - edited for time.
Me: You have blog. You wrote date picker. Me need help. Date picker is pushy. Here is code. Me not want date picker to be pushy. He moves checkbox. Me try height and "bringToFront". Here is code. Still date picker is pushy.
Chris: ... the reason that bringToFront() isn't working for you is because bringToFront only works with siblings to a view. What you really want to do is call bringToFront on the view that contains the datepicker AND a sibling to the checkbox. (the view with width="100%")
Me: Oh.
So here is the date picker code that will allow the date picker to float above the surrounding content. Tweak it for your app.
THANKS CHRIS!


3 Comments:
Thanks for this post, I was struggling with the same issue myself...!
No problem man. Chris Kohlhardt seems like a pretty nice guy. Props to him for the help too!
The code you have put link is not accessible.
Post a Comment
<< Home