mardi 25 juin 2013

Wicket PageParameters example

In Wicket 1.5 , you can use “PageParameters” class to store parameters values and pass it to another page. this is how you can do it :
first you should set your page parameters before redirection to be able then to receipt them in destination page

  @Override
  protected void onClick() {
 
   PageParameters pageParameters = new PageParameters();
   pageParameters.add("game", "Tombe Raider");
   setResponsePage(game.class, pageParameters);
 
  }

the next step is to capture these parameters into a method of destination page as follow :
String gameValue = pageParameters.get("game").toString();

that all :) !

Aucun commentaire:

Enregistrer un commentaire