On 8/23/06, Mats Norén <[EMAIL PROTECTED]> wrote:
> Hi,
> I've got a panel for adding dates with an add link, when the link is
> clicked I replace it with a small form with a single TextField
> (<input type="text"..>). What I would like to do is to set focus on
> the textfield when I switch panels. Is there an easy solution for
> this?
> I guess I could add an onLoadEvent but that would imply that my panel
> would add an onLoad-script to the page, which seems complicated.

Maybe it seems complicated, but to me that looks like the nicest
solution. You could have that select JavaScript right after the
component as well of course. But a body onload handler combined with
the component's markup id (don't forget setOutputMarkupId(true)) looks
nice enough imo.

Alternatively, as you are using a link, you might want to take a look
at anchors. Look at Link#get/setAnchor and maybe appendAnchor. I think
link.setAnchor(textfield) should work.

Eelco

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to