http://woogle.billen.dk/search/q/listview%20ajax
sigh
-igor
On 1/3/07, Carfield Yim <[EMAIL PROTECTED]> wrote:
My gmail crop my message but I can see it at sourceforge archive... I
don't know why. So I just resend my message again in case another
people only see an empty message
I have refer to
http://www.wicket-library.com/wicket-examples/ajax?wicket:bookmarkablePage=:wicket.examples.ajax.builtin.FormPage
and
http://www.wicket-library.com/wicket-examples/ajax?wicket:bookmarkablePage=:wicket.examples.ajax.builtin.ClockPage
But I cannot make the ModalWIndow updatable, Basically it is a form
contain a listview which will update after the user make some search, I
added an AjaxSelfUpdatingTimerBehavior to that listview and try to make
it update after the form submit, but it don't work, would you let me
know what am I doing wrong? BTW, I have validate that
AjaxSubmitButton.onsubmit is executed
public NewAccount(String id) {
super(id);
WicketUtil.standardHeader(this);
add(new NewAccountForm("form"));
add(new FeedbackPanel("feedback"));
add(userListView = new ListView("users", userList) {
private static final long serialVersionUID = 1L;
public void populateItem(final ListItem listItem) {
final User user = (User) listItem.getModelObject();
listItem.add(new Link("href") {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
try {
final Account account = new Account();
account.setAccountID(WicketUtil.getAccountId());
WicketUtil.addAccountForUser(user, account);
redirectToInterceptPage(new Edit(account));
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
}.add(new Label("label", user.getUsername())));
}
});
userListView.add(new
AjaxSelfUpdatingTimerBehavior(Duration.seconds(1)));
}
public final class NewAccountForm extends Form {
private static final long serialVersionUID = 1L;
private String keyword;
public String getKeyword() {
return keyword;
}
public String getKeywordWildcard() {
return keyword == null ? "%" : "%" + keyword.toLowerCase() +
"%";
}
public void setKeyword(String keyword) {
this.keyword = keyword;
}
public NewAccountForm(final String id) {
super(id);
final TextField username;
add(username = new RequiredTextField("keyword", new
PropertyModel(this, "keyword")));
add(new AjaxSubmitButton("ajax-submit-button", this) {
private static final long serialVersionUID = 1L;
protected void onSubmit(AjaxRequestTarget target, Form
form) {
try {
final boolean isNew =
Boolean.parseBoolean(getRequest().getParameter("isnew"));
if (isNew) {
if(UsernameValidator.userNameDuplication(username, null))
NewAccount.this.error("user with same
username already exist");
else {
final User user = new User();
user.setUsername(getKeyword());
final Account account = new Account();
account.setAccountID(WicketUtil.getAccountId());
if
(WicketUtil.addCustomer(NewAccount.this, user, account, true))
redirectToInterceptPage(new
Edit(account));
}
} else {
userList.clear();
userList.addAll(Application.sqlMap.queryForList("searchUserByNameOrEmail",
getKeywordWildcard()));
if (userList.size() > 0) {
NewAccount.this.info("Just click at the
username to add new account for that user");
}
userListView.modelChanged();
target.addComponent(userListView);
}
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
});
}
}
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user