On Thu, 9 Aug 2007 17:18:37 +0200
Federico Fanton <[EMAIL PROTECTED]> wrote:

> In 1.3 DatePicker was replaced with DateField, they are completely different 
> components.. I will try with your suggestion ASAP though, thanks again :)

I tried with

DateField field = ...
field.add(new AjaxFormComponentUpdatingBehavior("onchange"){
    protected void onUpdate(AjaxRequestTarget target) {
        // do stuff
    }
});

The original relevant HTML is

<span wicket:id="endDate"/>

while the resulting HTML is

<span wicket:id="endDate" name="endDate" onchange="var 
wcall=wicketAjaxPost('?wicket:interface=:10:frmSearch:endDate::IBehaviorListener:0:',
 wicketSerialize(Wicket.$('endDate7')), function() { }.bind(this), function() { 
}.bind(this));" id="endDate7">
<wicket:panel>
<span style="white-space: nowrap;">
    <input value="" type="text" wicket:id="date" size="8" name="endDate:date" 
id="date2"/>
    <span>&nbsp;<div style="display:none;z-index: 99999;position:absolute;" 
id="date2Dp"></div>
        <img style="cursor: pointer; border: none;" id="date2Icon" 
src="resources/org.apache.wicket.extensions.yui.calendar.DatePicker/icon1.gif" 
/></span>
        <input type="hidden"/>
    </span>
</wicket:panel>
</span>

So, the "onchange" is bound to the span element.. Maybe I should use a 
different markup in my HTML? I'd like the event to fire when I select a date 
from the popup calendar..
Many thanks again for your attention!


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to