Example usage for org.apache.wicket.markup.html.basic MultiLineLabel setOutputMarkupId

List of usage examples for org.apache.wicket.markup.html.basic MultiLineLabel setOutputMarkupId

Introduction

In this page you can find the example usage for org.apache.wicket.markup.html.basic MultiLineLabel setOutputMarkupId.

Prototype

public final Component setOutputMarkupId(final boolean output) 

Source Link

Document

Sets whether or not component will output id attribute into the markup.

Usage

From source file:com.evolveum.midpoint.web.page.login.PageSelfRegistration.java

License:Apache License

private void addMultilineLable(String id, String messageKey, WebMarkupContainer mainForm) {
    MultiLineLabel welcome = new MultiLineLabel(id, createStringResource(messageKey));
    welcome.setOutputMarkupId(true);
    //      welcome.add(new VisibleEnableBehaviour() {
    //         private static final long serialVersionUID = 1L;
    ////from w  w w  .j  av  a  2  s  .co  m
    //         @Override
    //         public boolean isVisible() {
    //            return !submited;
    //         }
    //      });
    mainForm.add(welcome);

}

From source file:de.alpharogroup.wicket.components.factory.ComponentFactory.java

License:Apache License

/**
 * Factory method for create a new {@link MultiLineLabel}.
 *
 * @param <T>//from w  w w.ja v a 2  s  .  co m
 *            the generic type of the model
 * @param id
 *            the id
 * @param model
 *            the {@link IModel} of the {@link MultiLineLabel}.
 * @return the new {@link MultiLineLabel}.
 */
public static <T> MultiLineLabel newMultiLineLabel(final String id, final IModel<T> model) {
    final MultiLineLabel multiLineLabel = new MultiLineLabel(id, model);
    multiLineLabel.setOutputMarkupId(true);
    return multiLineLabel;
}

From source file:org.apache.jetspeed.portlets.rpad.RemotePortletAppDeployer.java

License:Apache License

@SuppressWarnings("unchecked")
public RemotePortletAppDeployer() {
    deployer = new JetspeedPortletDeployer();
    Form form = new Form("form");
    repositories = getRepositoryManager().getRepositories();
    form.add(new DropDownChoice("repositorySelection", new PropertyModel(this, "selectedRepository"),
            repositories, new ChoiceRenderer("name", "name")));

    Button selectButton = new Button("selectButton") {

        private static final long serialVersionUID = 1L;

        public void onSubmit() {

        }/*from  ww w .j  ava  2 s. co m*/
    };

    form.add(selectButton);
    add(form);

    IModel getRepo = new LoadableDetachableModel() {

        protected Object load() {
            return getRepo();
        }
    };

    final PageableListView listview = new PageableListView("repositories", getRepo, 10) {

        private static final long serialVersionUID = 1L;

        // This method is called for each 'entry' in the list.
        @Override
        protected void populateItem(final ListItem item) {
            final PortletApplication application = (PortletApplication) item.getModelObject();
            item.add(new Label("groupId", application.getGroupId()));
            item.add(new Label("artifactId", application.getArtifactId()));
            item.add(new Label("name", application.getName()));
            item.add(new Label("version", application.getVersion()));
            item.add(new Label("type", application.getPackaging()));
            Link actionLink = new Link("action", item.getModel()) {

                public void onClick() {
                    PortletApplication portletApplication = (PortletApplication) getModelObject();
                    deployer.deploy(portletApplication, getServiceLocator().getDeploymentManager());
                }
            };
            actionLink.setVisibilityAllowed(true);
            actionLink.setOutputMarkupId(true);
            if (deployer.getStatus() == PortletDeployer.DEPLOYING) {
                actionLink.setVisible(false);
            }
            item.add(actionLink);
        }
    };
    listview.setOutputMarkupId(true);
    final WebMarkupContainer tableGroup = new WebMarkupContainer("tableGroup");
    tableGroup.setOutputMarkupId(true);
    //tableGroup.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(5)));
    tableGroup.add(new PagingNavigator("navigator", listview));
    tableGroup.add(listview);
    final MultiLineLabel statusLabel = new MultiLineLabel("status", new PropertyModel(this, "message"));
    statusLabel.setOutputMarkupId(true);
    final Label tickerLabel = new Label("ticker", new PropertyModel(this, "ticker"));
    tickerLabel.setOutputMarkupId(true);
    add(new AbstractAjaxTimerBehavior(Duration.seconds(3)) {
        protected void onTimer(AjaxRequestTarget target) {
            setMessage(deployer.getMessage());
            target.addComponent(tickerLabel);
            target.addComponent(statusLabel);
            target.addComponent(tableGroup);
        }
    });
    add(statusLabel);
    add(tickerLabel);
    add(tableGroup);

}

From source file:org.brixcms.demo.web.tile.ajax.AjaxDemoPanel.java

License:Apache License

public AjaxDemoPanel(String id) {
    super(id);/*w ww  .  ja  va2  s  .c o  m*/

    Form<Void> form = new Form<>("form");
    add(form);

    final IModel<String> model = new IModel<String>() {
        private String value = null;

        @Override
        public String getObject() {
            return value;
        }

        @Override
        public void setObject(String object) {
            value = object;

            values.append("\n");
            values.append(value);
        }

        @Override
        public void detach() {
        }
    };

    final AutoCompleteTextField<String> field = new AutoCompleteTextField<String>("ac", model) {
        @Override
        protected Iterator<String> getChoices(String input) {
            if (Strings.isEmpty(input)) {
                List<String> emptyList = Collections.emptyList();
                return emptyList.iterator();
            }

            List<String> choices = new ArrayList<>(10);

            Locale[] locales = Locale.getAvailableLocales();

            for (final Locale locale : locales) {
                final String country = locale.getDisplayCountry();

                if (country.toUpperCase().startsWith(input.toUpperCase())) {
                    choices.add(country);
                    if (choices.size() == 10) {
                        break;
                    }
                }
            }

            return choices.iterator();
        }
    };
    form.add(field);

    final MultiLineLabel label = new MultiLineLabel("history", new PropertyModel<String>(this, "values"));
    label.setOutputMarkupId(true);
    form.add(label);

    field.add(new AjaxFormSubmitBehavior(form, "change") {
        @Override
        protected void onSubmit(AjaxRequestTarget target) {
            target.add(label);
        }

        @Override
        protected void onError(AjaxRequestTarget target) {
        }
    });
}

From source file:org.hippoecm.frontend.plugins.console.menu.workflow.WorkflowDialog.java

License:Apache License

public WorkflowDialog(WorkflowPlugin plugin) {
    this.plugin = plugin;

    final IModel<Node> nodeModel = (IModel<Node>) plugin.getDefaultModel();

    final MultiLineLabel dump = new MultiLineLabel("dump", "");
    dump.setOutputMarkupId(true);
    add(dump);/*w w w  . java  2  s .c o m*/

    try {
        Node subject = nodeModel.getObject();
        ByteArrayOutputStream ostream = new ByteArrayOutputStream();
        PrintWriter out = new PrintWriter(ostream);
        Session session = subject.getSession();
        WorkflowManager workflowManager = ((HippoWorkspace) session.getWorkspace()).getWorkflowManager();
        Node categories = session.getRootNode().getNode("hippo:configuration/hippo:workflows");

        for (NodeIterator iter = categories.getNodes(); iter.hasNext();) {
            Node category = iter.nextNode();
            WorkflowDescriptor descriptor = workflowManager.getWorkflowDescriptor(category.getName(), subject);
            out.println("Category " + category.getName() + ": "
                    + (descriptor != null ? descriptor.getDisplayName() : "none"));
        }
        out.flush();
        dump.setDefaultModel(new Model<String>(new String(ostream.toByteArray())));
    } catch (RepositoryException ex) {
        dump.setDefaultModel(new Model<String>(ex.getClass().getName() + ": " + ex.getMessage()));
    }

    setOkVisible(false);
    setFocusOnOk();
}

From source file:rzd.vivc.ideax.wicket.director.Input.java

public Input(PageParameters param) {
        // Id    
        id = param.get("id").toLong(0);
        ideaModel = new LoadableIdeaModel(id);
        userNames = new LoadableUserNamesModel(id);

        // ?  /*from   w  w w  .  j  a v a2 s . c om*/
        Form form;
        form = new Form("finput") {
            @Override
            public final void onSubmit() {
                Idea idea = (Idea) ideaModel.getObject();
                idea.setUserCreatorID(getUserSession().getUser().getId());
                idea.setAccess((byte) (usersPanel.isAllowAll() ? 1 : 0));
                idea.setDt_begin(idea.getDt_create());

                // 
                final FileUpload uploadedFile = fileUpload.getFileUpload();
                try {
                    String fileName = new Upload().doUpload(uploadedFile);
                    if (!fileName.isEmpty()) {
                        idea.setFileName(fileName);
                    }
                    ///TODO ?     ?? ? 
                } catch (IllegalStateException e) {
                    new SaveErrorInfo().save(e);
                    error(e.getMessage());
                }

                //?   
                try {
                    new IdeaRepository().saveIdeaUserInfoList(idea, selectedUsers);
                    setResponsePage(Messenger.class);
                } catch (Exception e) {
                    new SaveErrorInfo().save(e);
                    error(" ?? ? " + e.getMessage());
                }
            }
        };
        add(form);
        //k ?  ??   ?? 
        form.add(new FeedbackPanel("feedback", new ContainerFeedbackMessageFilter(form)));
        // 
        form.add(new TextField("theme", new PropertyModel(ideaModel, "theme")).setRequired(true));
        //   
        form.add(new TextField("date", new PropertyModel(ideaModel, "dt_end"), Date.class) {
            @Override
            public IConverter getConverter(Class type) {
                return new CustomDateConverter();
            }
        });
        //? 
        form.add(new TextArea("text", new PropertyModel(ideaModel, "text")).setRequired(true));
        // 
        form.setMultiPart(true);
        form.add(fileUpload = new FileUploadField("fileUpload"));
        //?? 
        MultiLineLabel multiLineLabel = new MultiLineLabel("alreadyAddedUsers",
                new PropertyModel<String>(userNames, "commaSeparatedValues"));
        multiLineLabel.setOutputMarkupId(true);
        form.add(multiLineLabel);
        form.add(new AjaxFallbackLink("usersPanelLink") {
            @Override
            public void onClick(AjaxRequestTarget art) {
                if (art != null) {
                    usersPanel.setVisible(true);
                    art.add(usersPanel);
                }
            }
        });
        // ? 
        usersPanel = new UserChoisePanel("usersPanel", multiLineLabel);
        usersPanel.setVisible(false);
        //?      ? ?
        selectedUsers = usersPanel.getSelectedUsers();
        Idea get = new IdeaRepository().get(id);
        usersPanel.setAllowAll(get == null ? false : (get.getAccess() == 0 ? false : true));
        add(usersPanel);
    }