Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ListSites extends MyBasePage {
- private static final long serialVersionUID = -4911668101120395550L;
- public ListSites() {
- //List containing a number of items
- add(new ListView<MyInfo>("sitelist", MyWebApplication.get().getListSitesHelper()
- .getMySitesInfo()) {
- private static final long serialVersionUID = 1L;
- @Override
- protected void populateItem(ListItem<MyInfo> item) {
- item.setOutputMarkupPlaceholderTag(true);
- //dummy text box
- final Label dummy = new Label("dummy", "Dummy: "+item.getModelObject().getSiteName());
- dummy.setOutputMarkupPlaceholderTag(true);
- dummy.setVisible(false);
- final MyInfo siteInfo = item.getModelObject();
- item.add(new Label("locationName", siteInfo.getLocationName()));
- item.add(new Label("siteName", siteInfo.getSiteName()));
- // setting up labels for showrawinfo
- final Model<String> modelRawInfo = new Model<String>();
- modelRawInfo.setObject("Detailed raw xml Info >>");
- final Label lblRawInfo = new Label("rawinfolabel", modelRawInfo);
- lblRawInfo.setOutputMarkupPlaceholderTag(true);
- final Label lblHideInfo = new Label("hidelblinfo", "hideraw");
- AjaxLink infoLink = new AjaxLink("showrawinfo", modelRawInfo) {
- boolean toogle = false;
- public void onClick(AjaxRequestTarget target) {
- dummy.setVisible(true);
- target.add(dummy);
- }
- };
- modelRawInfo.setObject("Hide Info");
- AjaxLink hideLink = new AjaxLink("hiderawinfo",modelRawInfo) {
- public void onClick(AjaxRequestTarget target) {
- dummy.setVisible(false);
- target.add(dummy);
- }
- };
- item.add(dummy);
- item.add(infoLink);
- item.add(hideLink);
- }
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement