you dont need to do anything. next request the dataprovider is polled again.
if the dataview really doesnt refresh make sure your dataprovider/orm layer
are not doing any caching.
-igor
On 1/17/07, Tim Squires <[EMAIL PROTECTED]> wrote:
Hi again,
I have a simple DataView where one of the columns contains a Link which
onClick modifies the data. What is the best way of telling the DataView
that the model has changed. I've tried a few things, see the comments
in the code....
Thanks for your help,
Tim
DataView dataView = new DataView("tasks",
new UserTaskDataProvider(user)) {
protected void populateItem(final Item item) {
final TaskInstance task = (TaskInstance)
item.getModelObject();
item.add(new Label("taskName",
task.getName()));
// add a link that, when clicked,
assigns the task back to
// the group
Link assignLink = new Link("assignLink")
{
@Override
public void onClick() {
ATMInstallsDao.getFromApplicationContext()
.assignTaskToGroup(task.getId(),
"InstallsTeam");
//-------------PLEASE
HELP WITH THIS BIT---------
// tell wicket that
we've changed the model so it
// updates the page
//tried.......
// modelChanged(); -
does nothing (the Link objects model??)
//
DataView.this.modelChanged(); - does not compile no DataView parent???
// This works but is not
really the most efficient!.....
getRequestCycle().setResponsePage(new UserTasksPage(userName));
//------------------------------------------------
}
};
assignLink.add(new
Label("assignLinkLabel",
"assign to group"));
item.add(assignLink);
}
};
________________________________________________________________________
The Information contained in this e-mail message is intended only for
the individuals named above. If you are not the intended recipient,
you should be aware that any dissemination, distribution, forwarding
or other duplication of this communication is strictly prohibited.
The views expressed in this e-mail are those of the individual
author and not necessarily those of LINK Interchange Network Ltd.
Prior to taking any action based upon this e-mail message you should
seek appropriate confirmation of its authenticity. If you have
received this e-mail in error, please notify the sender immediately.
________________________________________________________________________
-------------------------------------------------------------------------
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