Re: behaviour and busy indicator

2012-04-19 Thread jasp
I just cant believe it... so easy yet I didnt firgure it out myself. Thank
you very much! :)

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/behaviour-and-busy-indicator-tp4568683p4570104.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: behaviour and busy indicator

2012-04-19 Thread Martin Grigorov
Hi,

On Wed, Apr 18, 2012 at 9:58 PM, jasp  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 nickField = new RequiredTextField(
> "nick", new PropertyModel( 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:
>
> 
> 
>
> 
>
> 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: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>



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

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



behaviour and busy indicator

2012-04-18 Thread jasp
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 nickField = new RequiredTextField(
"nick", new PropertyModel( this, "nickValue" ) );
formContainer.add( nickField );
indicator.bind(nickField);
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:






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: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org