@Override public final void onSubmit() { run(); BookmarkablePageLink<?> link = (BookmarkablePageLink<?>) get("viewLink"); link.setBody(new Model<String>(storyContext.getOutput())); link.getPageParameters().set("id", storyContext.getOutput()); } }
@Override public final void onSubmit() { run(); BookmarkablePageLink<?> link = (BookmarkablePageLink<?>) get("viewLink"); link.setBody(new Model<String>(storyContext.getOutput())); link.getPageParameters().set("id", storyContext.getOutput()); } }
/** * Constructs a menu item linking to the page. * * @param id * component identifier * @param label * the contents of the menu item * @param page * the page that is linked to using a bookmarkable link * @param parameters * the page parameters (optional) used with the link */ public TopNavbarMenuItem(String id, String label, Class<? extends WebPage> page, PageParameters parameters) { super(id); add(link = new BookmarkablePageLink<Void>("link", page, parameters)); link.setBody(Model.of(label)); }
@Override protected void populateItem(ListItem<String> item) { BookmarkablePageLink<String> link; if(item.getModelObject()==null || item.getModelObject().isEmpty()) { link = new BookmarkablePageLink<String>("link", getPageClass()); link.setBody(rootLabel); } else { crumbParams.set(item.getIndex()-1, item.getModelObject()); link = new BookmarkablePageLink<String>("link", getPageClass(), new PageParameters(crumbParams)); link.setBody(item.getModel()); } if(item.getIndex()==segments.size()-1) link.add(new AttributeModifier("class", "active")); item.add(link); } };
@Override protected void populateItem(ListItem<PropertyListMode> item) { String mode = item.getModelObject().name(); BookmarkablePageLink<Object> link = new BookmarkablePageLink<Object>("link", getPage().getClass(), new PageParameters(getPageParameters()).set("mode", mode)); ReviewParticipant participant = item.getModel().getObject().getParticipant(); if(participant!=null) link.setBody(nls(participant.getClass(),participant.getName())); else link.setBody(new StringResourceModel(item.getModelObject().name(),item,null)); item.add(link); if (item.getModelObject().equals(currentMode)) item.add(new AttributeModifier("class", "active")); } };
@Override protected void populateItem(ListItem<PropertyListMode> item) { String mode = item.getModelObject().name().toLowerCase(); String anchor = URLUtil.escapeToIdAttribute(mainModel.getObject().getKey()); PageParameters pageParams = new PageParameters(getPageParameters()).clearNamed().set("mode", mode); BookmarkablePageLink<Object> link = new AnchorBookmarkablePageLink<Object>("link", getPage().getClass(), pageParams, anchor); ReviewParticipant participant = item.getModel().getObject().getParticipant(); if(participant!=null) link.setBody(nls(participant.getClass(),participant.getName())); else link.setBody(new StringResourceModel(item.getModelObject().name(),item,null)); item.add(link); link.add(new AttributeModifier("onclick", "return confirmAction()")); if (item.getModelObject().equals(currentMode)) item.add(new AttributeModifier("class", "active")); } };
@Override protected void populateItem(ListItem<PropertyListMode> item) { String mode = item.getModelObject().name().toLowerCase(); BookmarkablePageLink<Object> link = new BookmarkablePageLink<Object>("link", getPage().getClass(), new PageParameters(getPageParameters()).set("mode", mode)); link.setBody(Model.of("Show "+ mode)); item.add(link); if (item.getModelObject() == currentMode) item.add(new AttributeModifier("class", "active")); } };
public BootstrapSignInPanel(String id, boolean includeRememberMe) { super(id, includeRememberMe); WebMarkupContainer registerContainer = new WebMarkupContainer("register.container"); BookmarkablePageLink<Object> link = new BookmarkablePageLink<Object>("register.link", RegisterPage.class); link.setBody(new StringResourceModel("register.link.label",this,null)); registerContainer.add(link); registerContainer.setVisibilityAllowed(canRegister()); getForm().add(registerContainer); }
public SchemaPageHeader(String id, IModel<OClass> oClassModel) { super(id, oClassModel); add(new BookmarkablePageLink<Object>("schema", SchemaPage.class) .setBody(new ResourceModel("menu.list.schema"))); add(new ListView<OClass>("classes", classPathModel) { @Override protected void populateItem(ListItem<OClass> item) { item.add(new OClassPageLink("link", item.getModel()).setClassNameAsBody(false)); } }); childRepeatingView = new RepeatingView("child"); add(childRepeatingView); add(UpdateOnActionPerformedEventBehavior.INSTANCE_ALWAYS_FOR_CHANGING); add(new DefaultPageHeaderMenu("menu")); }
userLink.setBody(Model.of(username)); add(userLink);