> You can use CSS to control the positon of the busy indicating image. To place
> it
> right from the button use
This seems like tweaking...
> IAjaxIndicatorAware simply takes the html id of the element you want
> to show/hide; it can be placed anywhere in html...
This is more of what I am looking for, but with IAjaxIndicatorAware I
havent succeeded in making the indicator appear. I posted earlier the
code I have, but it didn't do the job. I will repeat it here if
someone can see immediately what is wrong in it:
public class Login extends WebPage {
// ... default constructor contents:
final Form loginForm = new Form(LOGIN_FORM, new Model());
final AjaxIndicatorContainer indicatorContainer = new
AjaxIndicatorContainer();
indicatorContainer.setOutputMarkupId(true);
loginForm.add(indicatorContainer);
final SubmitLink loginButton = new SubmitLink(LOGIN_BUTTON, new Model()) {
/**
* @see org.apache.wicket.markup.html.form.SubmitLink#onSubmit()
*/
@Override
public void onSubmit() {
super.onSubmit();
Thread.sleep(5000); // Simulate form processing
}
};
abstract class AjaxFormSubmitIndicator extends
AjaxFormSubmitBehavior implements IAjaxIndicatorAware {
/**
* Constructor for TODO
*
*/
public AjaxFormSubmitIndicator() {
super("onchange"); // I have tried "onchange" and "onclick"
}
}
loginButton.add(new AjaxFormSubmitIndicator() {
@Override
protected void onError(AjaxRequestTarget arg0) {
// TODO Auto-generated method stub
}
@Override
protected void onSubmit(AjaxRequestTarget arg0) {
loginButton.onSubmit();
}
public String getAjaxIndicatorMarkupId() {
return indicatorContainer.getMarkupId();
}
});
loginForm.add(loginButton);
// ... etc..
add(new FeedbackPanel("feedback"));
add(loginForm);
}
public class AjaxIndicatorContainer extends WebMarkupContainer {
/**
*
*/
private static final long serialVersionUID = 5573778050703849297L;
/**
*
*/
public static final String INDICATOR_MARKUP_ID = "ajaxIndicator";
/**
* Constructor for TODO
*/
public AjaxIndicatorContainer() {
super(INDICATOR_MARKUP_ID);
}
/**
* @see
org.apache.wicket.Component#onComponentTag(org.apache.wicket.markup.ComponentTag)
*/
@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
tag.put("src",urlFor(AbstractDefaultAjaxBehavior.INDICATOR));
}
<body>
<wicket:extend>
<h1>Login</h1>
<span wicket:id="feedback">Feedback messages will be here.</span>
<form wicket:id="loginForm">
<table border="0" cellspacing="0" cellpadding="2" align="center">
<tr><td NOWRAP width="80" align="right">
Username:
</td>
<td><input type="text" wicket:id="userId"></td></tr>
<tr><td NOWRAP align="right">
Password: </td><td><input type="password" wicket:id="password"></td></tr>
<tr><td align="right"><img src="#" border="0"
wicket:id="ajaxIndicator" style="display:none"/></td><td NOWRAP>
<input type="submit" value="Sign in" wicket:id="loginButton">
</td></tr>
</table>
</form>
</wicket:extend>
</body>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]