Search in sources :

Example 31 with Fragment

use of org.apache.wicket.markup.html.panel.Fragment in project sandbox by irof.

the class FragmentSamplePage method onInitialize.

@Override
protected void onInitialize() {
    super.onInitialize();
    // 同じフラグメントを2回入れる
    Fragment fragment1 = new Fragment("target1", "myFragment", this);
    fragment1.add(new Label("message", "hoge"));
    add(fragment1);
    Fragment fragment2 = new Fragment("target2", "myFragment", this);
    fragment2.add(new Label("message", "fuga"));
    add(fragment2);
}
Also used : Label(org.apache.wicket.markup.html.basic.Label) Fragment(org.apache.wicket.markup.html.panel.Fragment)

Example 32 with Fragment

use of org.apache.wicket.markup.html.panel.Fragment in project syncope by apache.

the class AbstractFieldPanel method addRequiredLabel.

public AbstractFieldPanel<T> addRequiredLabel() {
    if (!isRequired()) {
        setRequired(true);
    }
    final Fragment fragment = new Fragment("required", "requiredFragment", this);
    fragment.add(new Label("requiredLabel", "*"));
    replace(fragment);
    this.isRequiredLabelAdded = true;
    return this;
}
Also used : Label(org.apache.wicket.markup.html.basic.Label) Fragment(org.apache.wicket.markup.html.panel.Fragment)

Example 33 with Fragment

use of org.apache.wicket.markup.html.panel.Fragment in project syncope by apache.

the class TopologyTogglePanel method getSyncopeFragment.

private Fragment getSyncopeFragment(final PageReference pageRef) {
    Fragment fragment = new Fragment("actions", "syncopeActions", this);
    AjaxLink<String> reload = new IndicatingOnConfirmAjaxLink<String>("reload", "connectors.confirm.reload", true) {

        private static final long serialVersionUID = -2075933173666007020L;

        @Override
        public void onClick(final AjaxRequestTarget target) {
            try {
                connectorRestClient.reload();
                SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
            } catch (Exception e) {
                LOG.error("While reloading all connectors", e);
                SyncopeConsoleSession.get().error(StringUtils.isBlank(e.getMessage()) ? e.getClass().getName() : e.getMessage());
            }
            ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
        }
    };
    fragment.add(reload);
    MetaDataRoleAuthorizationStrategy.authorize(reload, RENDER, StandardEntitlement.CONNECTOR_RELOAD);
    AjaxLink<String> tasks = new IndicatingAjaxLink<String>("tasks") {

        private static final long serialVersionUID = 3776750333491622263L;

        @Override
        public void onClick(final AjaxRequestTarget target) {
            target.add(schedTaskModal.setContent(new SchedTasks(schedTaskModal, pageRef)));
            schedTaskModal.header(new ResourceModel("task.custom.list"));
            schedTaskModal.show(true);
        }

        @Override
        public String getAjaxIndicatorMarkupId() {
            return Constants.VEIL_INDICATOR_MARKUP_ID;
        }
    };
    fragment.add(tasks);
    MetaDataRoleAuthorizationStrategy.authorize(tasks, RENDER, StandardEntitlement.TASK_LIST);
    return fragment;
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) IndicatingAjaxLink(org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink) IndicatingOnConfirmAjaxLink(org.apache.syncope.client.console.wicket.markup.html.form.IndicatingOnConfirmAjaxLink) StringResourceModel(org.apache.wicket.model.StringResourceModel) ResourceModel(org.apache.wicket.model.ResourceModel) Fragment(org.apache.wicket.markup.html.panel.Fragment) SyncopeClientException(org.apache.syncope.common.lib.SyncopeClientException) SchedTasks(org.apache.syncope.client.console.tasks.SchedTasks)

Example 34 with Fragment

use of org.apache.wicket.markup.html.panel.Fragment in project syncope by apache.

the class AbstractMultiPanel method getDataFragment.

private Fragment getDataFragment() {
    final Fragment contentFragment = new Fragment("content", "dataFragment", AbstractMultiPanel.this);
    contentFragment.add(view.setOutputMarkupId(true));
    return contentFragment;
}
Also used : Fragment(org.apache.wicket.markup.html.panel.Fragment)

Example 35 with Fragment

use of org.apache.wicket.markup.html.panel.Fragment in project syncope by apache.

the class AbstractMultiPanel method getNoDataFragment.

private Fragment getNoDataFragment(final IModel<List<INNER>> model, final String label) {
    final Fragment fragment = new Fragment("content", "noDataFragment", AbstractMultiPanel.this);
    fragment.add(new Label("field-label", new ResourceModel(label, label)));
    fragment.add(getPlusFragment(model, label));
    return fragment;
}
Also used : Label(org.apache.wicket.markup.html.basic.Label) ResourceModel(org.apache.wicket.model.ResourceModel) Fragment(org.apache.wicket.markup.html.panel.Fragment)

Aggregations

Fragment (org.apache.wicket.markup.html.panel.Fragment)51 Label (org.apache.wicket.markup.html.basic.Label)20 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)12 ArrayList (java.util.ArrayList)9 LinkPanel (com.gitblit.wicket.panels.LinkPanel)6 Component (org.apache.wicket.Component)6 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)6 RepositoryModel (com.gitblit.models.RepositoryModel)5 UserModel (com.gitblit.models.UserModel)5 Item (org.apache.wicket.markup.repeater.Item)5 DataView (org.apache.wicket.markup.repeater.data.DataView)5 ListDataProvider (org.apache.wicket.markup.repeater.data.ListDataProvider)5 ResourceModel (org.apache.wicket.model.ResourceModel)4 TicketLabel (com.gitblit.tickets.TicketLabel)3 List (java.util.List)3 ConnInstanceTO (org.apache.syncope.common.lib.to.ConnInstanceTO)3 IndicatingAjaxLink (org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink)3 CompoundPropertyModel (org.apache.wicket.model.CompoundPropertyModel)3 BoxedTablePanel (com.evolveum.midpoint.web.component.data.BoxedTablePanel)2 ListDataProvider (com.evolveum.midpoint.web.component.util.ListDataProvider)2