You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by jasp <ka...@gmail.com> on 2012/04/18 20:58:59 UTC
behaviour and busy indicator
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);
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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: behaviour and busy indicator
Posted by Martin Grigorov <mg...@apache.org>.
Hi,
On Wed, Apr 18, 2012 at 9:58 PM, jasp <ka...@gmail.com> 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: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: behaviour and busy indicator
Posted by jasp <ka...@gmail.com>.
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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org