El lun, 13-04-2009 a las 03:37 -0500, Subramanian Murali escribió:
> Hi,
> I understand from the link
> http://cwiki.apache.org/WICKET/mobile-devices.html that we can have multiple
> versions of html for a page / component like below:
> 
> person.html
> person_mobile.html
> 
> Where / How do i implement which version of html should be chosen based on
> some condition?
see the source code of
http://wicketstuff.org/wicket13/hellobrowser/howdy/HelloBrowser/

this is the way to find out which is the user agent. depending on it you
could do:
Session.get().setStyle("mobile")

> 
> Moreover, if my mobile version of html doesn't display all the components
> defined in the page, How do i render the page?
MyPage.html (normal browser):
<html><body> 
<span wicket:id="label1"></span><span wicket:id="label2"></span> 
</body></html>

MyPage_mobile.html (mobile browser):
<html><body> 
<span wicket:id="label1"></span> 
</body></html>

MyPage.java -> constructor:

public MyPage(PageParameters pp) {

  add(new Label("label1", "We be shown on both browser types");

  if (!"mobile".equals(Session.get().getStyle()) {
    add(new Label("label2", "Only for normal browsers");
  }

}

> 
> Do we have options custom rendering mechanisms like we have rendering kits
> in JSF?
See above
> 
> Thanks in advance for the answers.
> 
> Thanks,
> Subbu.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to