Hi,

On Wed, Apr 18, 2012 at 9:58 PM, jasp <[email protected]> wrote:
> Hello, I'm trying get Ajax Indicator working for my form validating
> behaviour. Basically I have a thing that takes time to check on server.
> Meanwhile I'd like to show user a busy indicator.
>
> I tried to do following thing:
>
> *This is page class, with basic form input:*
>
> //...omitted some not revelant code
> AjaxIndicatorAppender indicator = new AjaxIndicatorAppender();
> final RequiredTextField<String> nickField = new RequiredTextField<String>(
> "nick", new PropertyModel<String>( this, "nickValue" ) );
> formContainer.add( nickField );
> indicator.bind(nickField);

replace the line above with:
nickField.add(indicator);

> nickField.add( new MyValidatingBehaviour( (Form) formContainer, "onkeyup",
> Duration.ONE_SECOND, indicator ) );
> //...
>
> *And this is my validating behaviour:*
>
> private class MyValidatingBehaviour extends AjaxFormValidatingBehavior
> implements IAjaxIndicatorAware
> {
>    AjaxIndicatorAppender indicator;
>
>    private MyValidatingBehaviour( Form<?> form, String event, final
> Duration throttleDelay, AjaxIndicatorAppender indicator )
>    {
>        super( form, event );
>        this.setThrottleDelay( throttleDelay );
>        this.indicator = indicator;
>    }
>
>    @Override
>    public String getAjaxIndicatorMarkupId()
>    {
>        return indicator.getMarkupId();
>    }
> }
>
> Of course there are some other validators than "required" one, I just
> ommited 'em here. The thing is, that I dont have any indicator sign
> anywhere. Docs says that it appeds "span", yet I couldnt find any in HTML.
>
> The HTML looks simple as this:
>
> <form wicket:id="form">
> <input wicket:id="nick" class="textInput" id="nick"/>
>
> </form>
>
> Any help whats wrong?
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/behaviour-and-busy-indicator-tp4568683p4568683.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to