Ali Zeynalov
Ali Zeynalov

Reputation: 3017

Send object or ArrayList to another page in Wicket

I'm quite new in Wicket. I want to know that how can I send object or an ArrayList to another page in Wicket. As I know, with PageParameters we can send only String values. In some forms I also found something about MyPage but it was not clear enough for me.So,Is there anyone can help me about how to send an ArrayList to another page in Wicket?

Upvotes: 0

Views: 1064

Answers (3)

iluwatar
iluwatar

Reputation: 1803

Wicket pages and components get their data from models. Models may be static or dynamic. You should read about it here. This may be the most important concept you need to learn about the framework.

Upvotes: 0

Pratik Rawlekar
Pratik Rawlekar

Reputation: 327

If possible, can you try to convert object or an arrayList to json using Jackson/gson and then pass that json string to another page where you can dejsonize the json string to get object back and use.

Upvotes: 0

martin-g
martin-g

Reputation: 17533

Define your page as:

public class AnotherPage extends WebPage {
   public AnotherPage(MyOwnClass myOwn) {
     // do something with myOwn
   }
}

and then within #onClick() or onSubmit() callback methods redirect to it with:

setResponsePage(new AnotherPage(yourSpecialObject));

Upvotes: 1

Related Questions