We don't (seem to) have a component for this currently. However,
implementing one yourself is pretty straightforward. Take a look at
AjaxCheckBox:
/**
* Construct.
*
* @param id
* @param model
*/
public AjaxCheckBox(final String id, final IModel model)
{
super(id, model);
setOutputMarkupId(true);
add(new AjaxFormComponentUpdatingBehavior("onchange")
{
private static final long serialVersionUID = 1L;
protected void onUpdate(AjaxRequestTarget target)
{
AjaxCheckBox.this.onUpdate(target);
}
});
}
Adding that AjaxFormComponentUpdatingBehavior is really all there is
to it. You should be able to just do something like:
TextField f = new TextField("field", model);
f.add(new AjaxFormComponentUpdatingBehavior("onblur")
{
protected void onUpdate(AjaxRequestTarget target)
{
log.info("field updated");
}
}));
Eelco
On 3/30/06, Stefan Lindner <[EMAIL PROTECTED]> wrote:
> Thank you all for your hints,
>
> an AjaxTabbedPanel together with an AjaxCheckBox does the trick. Works
> really fine!
> BUT: Now I need a text input field with the same functionality.
> As I can't find an AjaxTextField I tried an AjaxEditableLabel. But this
> does not work.
>
> The HTML part
>
> <input wicket:id="freitext" id="freitext" type="text"/>
>
> And the Java part
>
> AjaxEditableLabel stringTextField = new
> AjaxEditableLabel("freitext", new PropertyModel(model, "freitext")) {
> protected void onUpdate(AjaxRequestTarget target) {
> System.out.println("onUpdate");
> }
> };
> add(stringTextField);
>
> Resuts in the HTML sequence
> <input type="text" wicket:id="freitext"
> id="seiteninhalt_tabs_panel_inputForm_freitext">
> <wicket:panel>
> <span wicket:id="label" onClick="var
> wicketAjaxCallMade=wicketAjaxGet('/Visiomedic/VisioPAD?wicket:interface=
> :1:seiteninhalt:tabs:panel:inputForm:freitext:label:-1:IUnversionedBehav
> iorListener&wicket:behaviorId=0');"
> id="seiteninhalt_tabs_panel_inputForm_freitext_label"></span>
> </wicket:panel>
> </input>
>
>
> Stefan Lindner
> ------------------------------------------------------------------------
> --
> Visionet GmbH, Am Weichselgarten 7, 91058 Erlangen
> Tel.: (09131)691-230, FAX: (09131)691-111
> E-Mail: mailto:[EMAIL PROTECTED], Internet:
> http://www.visionet.de
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live webcast
> and join the prime developer group breaking into this new coding territory!
> http://sel.as-us.falkag.net/sel?cmdlnk&kid0944&bid$1720&dat1642
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user