List of usage examples for org.apache.wicket.ajax.markup.html AjaxFallbackLink AjaxFallbackLink
public AjaxFallbackLink(final String id)
From source file:au.org.theark.core.web.component.tabbedPanel.AjaxDynamicTabbedPanel.java
License:Open Source License
@Override protected WebMarkupContainer newLink(final String linkId, final int index) { return new AjaxFallbackLink<Void>(linkId) { private static final long serialVersionUID = 1L; @Override//from ww w.ja va2s . c om public void onClick(final AjaxRequestTarget target) { setSelectedTab(index); if (target != null) { target.add(AjaxDynamicTabbedPanel.this); } onAjaxUpdate(target); } }; }
From source file:com.comcast.cdn.traffic_control.traffic_monitor.wicket.components.AddPanel.java
License:Apache License
public AddPanel(final String id) { super(id);/* w ww . j ava 2s . c om*/ this.setOutputMarkupId(true); editform = new Form<Object>("editform"); addlink = new AjaxFallbackLink<Object>("add") { private static final long serialVersionUID = 1L; @Override public void onClick(final AjaxRequestTarget target) { AddPanel.this.showForm(true); if (target != null) { target.add(AddPanel.this); } } }; add(addlink); field = new TextField<String>("field", new Model<String>("")); editform.add(field); editform.add(new AjaxLink<Object>("cancel") { private static final long serialVersionUID = 1L; @Override public void onClick(final AjaxRequestTarget target) { AddPanel.this.showForm(false); if (target != null) { target.add(AddPanel.this); } } }); editform.add(new AjaxButton("submit", editform) { private static final long serialVersionUID = 1L; @Override public void onSubmit(final AjaxRequestTarget target, final Form<?> form) { addResponse(field.getModelObject().toString(), target); AddPanel.this.showForm(false); if (target != null) { target.add(AddPanel.this); } } }); this.add(editform); showForm(false); }
From source file:com.conwax.ajax.examples.AjaxFallbackLinkPage.java
License:Apache License
public AjaxFallbackLinkPage() { super();//from www. j av a 2s . c o m final Label label = new Label("label", new PropertyModel<Integer>(this, "counter")); label.setOutputMarkupId(true); add(label); add(new AjaxFallbackLink<Void>("link") { private static final long serialVersionUID = 1L; @Override public void onClick(AjaxRequestTarget target) { counter++; if (null != target) { target.add(label); } } }); }
From source file:com.eltiland.ui.course.components.tree.ELTDefaultAbstractTree.java
License:Apache License
/** * Creates a link of type specified by current linkType. When the links is clicked it calls the * specified callback.//from w w w . ja v a2 s .com * * @param parent The parent component * @param id The component id * @param callback The link call back * @return The link component */ protected MarkupContainer newLink(final MarkupContainer parent, final String id, final ILinkCallback callback) { if (getLinkType() == LinkType.REGULAR) { return new Link<Void>(id) { private static final long serialVersionUID = 1L; /** * {@inheritDoc} */ @Override public void onClick() { callback.onClick(null); } }; } else if (getLinkType() == LinkType.AJAX) { return new AjaxLink<Void>(id) { private static final long serialVersionUID = 1L; /** * {@inheritDoc} */ @Override public void onClick(final AjaxRequestTarget target) { callback.onClick(target); } }; } else { return new AjaxFallbackLink<Void>(id) { private static final long serialVersionUID = 1L; /** * {@inheritDoc} */ @Override public void onClick(final AjaxRequestTarget target) { callback.onClick(target); } }; } }
From source file:com.evolveum.midpoint.web.component.AjaxTabbedPanel.java
License:Apache License
@Override protected WebMarkupContainer newLink(final String linkId, final int index) { return new AjaxFallbackLink<Void>(linkId) { private static final long serialVersionUID = 1L; @Override//from w ww . j a v a 2 s. co m public void onClick(final AjaxRequestTarget target) { setSelectedTab(index); if (target != null) { target.add(AjaxTabbedPanel.this); } onAjaxUpdate(target); } }; }
From source file:com.evolveum.midpoint.web.component.wf.SwitchableApprovalProcessPreviewsPanel.java
License:Apache License
private void initLayout(IModel<Boolean> showNextStagesModel) { setOutputMarkupId(true);//from w w w. j a v a 2 s. co m WebMarkupContainer nextStagesContainer = new WebMarkupContainer(ID_NEXT_STAGES_CONTAINER); nextStagesContainer.add(new ApprovalProcessExecutionInformationPanel(ID_NEXT_STAGES, nextStagesModel)); nextStagesContainer.add(WebComponentUtil.createHelp(ID_NEXT_STAGES_HELP)); nextStagesContainer.add(new VisibleBehaviour(() -> displayedProcessInfoBox == ProcessInfoBox.NEXT_STAGES)); add(nextStagesContainer); WebMarkupContainer wholeProcessContainer = new WebMarkupContainer(ID_WHOLE_PROCESS_CONTAINER); wholeProcessContainer .add(new ApprovalProcessExecutionInformationPanel(ID_WHOLE_PROCESS, wholeProcessModel)); wholeProcessContainer.add(WebComponentUtil.createHelp(ID_WHOLE_PROCESS_HELP)); wholeProcessContainer .add(new VisibleBehaviour(() -> displayedProcessInfoBox == ProcessInfoBox.WHOLE_PROCESS)); add(wholeProcessContainer); WebMarkupContainer showNextStagesContainer = new WebMarkupContainer(ID_SHOW_NEXT_STAGES_CONTAINER); showNextStagesContainer.add(new AjaxFallbackLink(ID_SHOW_NEXT_STAGES) { @Override public void onClick(Optional target) { displayedProcessInfoBox = ProcessInfoBox.NEXT_STAGES; ((AjaxRequestTarget) target.get()).add(SwitchableApprovalProcessPreviewsPanel.this); } }); showNextStagesContainer.add(WebComponentUtil.createHelp(ID_SHOW_NEXT_STAGES_HELP)); showNextStagesContainer.add(new VisibleBehaviour(() -> Boolean.TRUE.equals(showNextStagesModel.getObject()) && displayedProcessInfoBox != ProcessInfoBox.NEXT_STAGES)); add(showNextStagesContainer); WebMarkupContainer showWholeProcessContainer = new WebMarkupContainer(ID_SHOW_WHOLE_PROCESS_CONTAINER); showWholeProcessContainer.add(new AjaxFallbackLink(ID_SHOW_WHOLE_PROCESS) { @Override public void onClick(Optional target) { displayedProcessInfoBox = ProcessInfoBox.WHOLE_PROCESS; ((AjaxRequestTarget) target.get()).add(SwitchableApprovalProcessPreviewsPanel.this); } }); showWholeProcessContainer .add(new VisibleBehaviour(() -> displayedProcessInfoBox != ProcessInfoBox.WHOLE_PROCESS)); showWholeProcessContainer.add(WebComponentUtil.createHelp(ID_SHOW_WHOLE_PROCESS_HELP)); add(showWholeProcessContainer); }
From source file:com.evolveum.midpoint.web.page.admin.server.currentState.ActionsExecutedInformationPanel.java
License:Apache License
protected void initLayout() { WebMarkupContainer tableLinesContainer = new WebMarkupContainer(ID_OBJECTS_TABLE_LINES_CONTAINER); ListView tableLines = new ListView<ActionsExecutedObjectsTableLineDto>(ID_OBJECTS_TABLE_LINES, new AbstractReadOnlyModel<List<ActionsExecutedObjectsTableLineDto>>() { @Override/*from w ww . j av a 2 s. c o m*/ public List<ActionsExecutedObjectsTableLineDto> getObject() { final ActionsExecutedInformationDto modelObject = getModelObject(); if (modelObject == null) { return new ArrayList<>(); } if (showResultingActionsOnly) { return modelObject.getUniqueObjectsTableLines(); } else { return modelObject.getObjectsTableLines(); } } }) { protected void populateItem(final ListItem<ActionsExecutedObjectsTableLineDto> item) { item.add(new Label(ID_OBJECT_TYPE, new AbstractReadOnlyModel<String>() { @Override public String getObject() { String key = item.getModelObject().getObjectTypeLocalizationKey(); if (key != null) { return createStringResource(key).getString(); } else { return item.getModelObject().getObjectType().getLocalPart(); } } })); item.add(new Label(ID_OPERATION, new AbstractReadOnlyModel<String>() { @Override public String getObject() { return createStringResource(item.getModelObject().getOperation()).getString(); } })); item.add(new Label(ID_CHANNEL, new AbstractReadOnlyModel<String>() { @Override public String getObject() { String channel = item.getModelObject().getChannel(); if (channel != null && !channel.isEmpty()) { String key = "Channel." + channel; return createStringResource(key).getString(); } else { return ""; } } })); item.add(new Label(ID_SUCCESS_COUNT, new PropertyModel<String>(item.getModel(), ActionsExecutedObjectsTableLineDto.F_SUCCESS_COUNT))); item.add(new Label(ID_LAST_SUCCESS_OBJECT, new PropertyModel<String>(item.getModel(), ActionsExecutedObjectsTableLineDto.F_LAST_SUCCESS_OBJECT))); item.add(new Label(ID_LAST_SUCCESS_TIMESTAMP, new PropertyModel<String>(item.getModel(), ActionsExecutedObjectsTableLineDto.F_LAST_SUCCESS_TIMESTAMP))); item.add(new Label(ID_FAILURE_COUNT, new PropertyModel<String>(item.getModel(), ActionsExecutedObjectsTableLineDto.F_FAILURE_COUNT))); } }; tableLinesContainer.add(tableLines); tableLinesContainer.setOutputMarkupId(true); add(tableLinesContainer); final Label showResultingActionsOnlyLabel = new Label(ID_SHOW_RESULTING_ACTIONS_ONLY_LABEL, new AbstractReadOnlyModel<String>() { @Override public String getObject() { return showResultingActionsOnly ? createStringResource( "ActionsExecutedInformationPanel.showingResultingActionsOnly").getString() : createStringResource("ActionsExecutedInformationPanel.showingAllActions") .getString(); } }); showResultingActionsOnlyLabel.setOutputMarkupId(true); add(showResultingActionsOnlyLabel); add(new AjaxFallbackLink<String>(ID_SHOW_RESULTING_ACTIONS_ONLY_LINK) { @Override public void onClick(AjaxRequestTarget ajaxRequestTarget) { showResultingActionsOnly = !showResultingActionsOnly; ajaxRequestTarget.add(ActionsExecutedInformationPanel.this); } }); add(new VisibleEnableBehaviour() { @Override public boolean isVisible() { return getModelObject() != null; } }); }
From source file:com.evolveum.midpoint.web.page.admin.server.TaskResultTabPanel.java
License:Apache License
private void initLayout(final IModel<TaskDto> taskDtoModel, final PageBase pageBase) { SortableDataProvider<OperationResult, String> provider = new ListDataProvider<>(this, new PropertyModel<List<OperationResult>>(taskDtoModel, TaskDto.F_OP_RESULT)); TablePanel resultTablePanel = new TablePanel<>(ID_OPERATION_RESULT, provider, initResultColumns()); resultTablePanel.setStyle("padding-top: 0px;"); resultTablePanel.setShowPaging(false); resultTablePanel.setOutputMarkupId(true); add(resultTablePanel);//from www. j ava2 s . c o m add(new AjaxFallbackLink(ID_SHOW_RESULT) { public void onClick(AjaxRequestTarget target) { OperationResult opResult = taskDtoModel.getObject().getTaskOperationResult(); OperationResultPanel body = new OperationResultPanel(pageBase.getMainPopupBodyId(), new Model<>(OpResult.getOpResult(pageBase, opResult)), pageBase); body.setOutputMarkupId(true); pageBase.showMainPopup(body, target); } }); }
From source file:com.evolveum.midpoint.web.page.admin.server.TaskWfChildPanel.java
License:Apache License
private void initLayout(final IModel<TaskDto> taskDtoModel) { changesModel = new PropertyModel<>(taskDtoModel, TaskDto.F_CHANGE_BEING_APPROVED); TaskChangesPanel changesPanel = new TaskChangesPanel(ID_CHANGES, changesModel); changesPanel.setOutputMarkupId(true); add(changesPanel);//from w w w. j a v a2 s . c o m final ItemApprovalHistoryPanel history = new ItemApprovalHistoryPanel(ID_HISTORY, new PropertyModel<WfContextType>(taskDtoModel, TaskDto.F_WORKFLOW_CONTEXT), UserProfileStorage.TableId.PAGE_TASK_HISTORY_PANEL, (int) parentPage.getItemsPerPage(UserProfileStorage.TableId.PAGE_TASK_HISTORY_PANEL)); history.setOutputMarkupId(true); add(history); add(WebComponentUtil.createHelp(ID_HISTORY_HELP)); WebMarkupContainer workItemsContainer = new WebMarkupContainer(ID_CURRENT_WORK_ITEMS_CONTAINER); final ISortableDataProvider<WorkItemDto, String> provider = new ListDataProvider(this, new PropertyModel<List<WorkItemDto>>(taskDtoModel, TaskDto.F_WORK_ITEMS)); final WorkItemsPanel workItemsPanel = new WorkItemsPanel(ID_CURRENT_WORK_ITEMS, provider, UserProfileStorage.TableId.PAGE_TASK_CURRENT_WORK_ITEMS_PANEL, (int) parentPage.getItemsPerPage(UserProfileStorage.TableId.PAGE_TASK_CURRENT_WORK_ITEMS_PANEL), WorkItemsPanel.View.ITEMS_FOR_PROCESS); workItemsPanel.setOutputMarkupId(true); workItemsContainer.add(workItemsPanel); workItemsContainer.setOutputMarkupId(true); workItemsContainer.add(new VisibleEnableBehaviour() { @Override public boolean isVisible() { return provider.size() > 0; } }); workItemsContainer.add(WebComponentUtil.createHelp(ID_CURRENT_WORK_ITEMS_HELP)); add(workItemsContainer); final PropertyModel<List<ProcessInstanceDto>> relatedRequestsModel = new PropertyModel<>(taskDtoModel, TaskDto.F_WORKFLOW_REQUESTS); WebMarkupContainer relatedRequestsContainer = new WebMarkupContainer(ID_RELATED_REQUESTS_CONTAINER); relatedRequestsContainer.add(new VisibleEnableBehaviour() { @Override public boolean isVisible() { return CollectionUtils.isNotEmpty(relatedRequestsModel.getObject()); } }); relatedRequestsContainer.setOutputMarkupId(true); add(relatedRequestsContainer); ISortableDataProvider<ProcessInstanceDto, String> requestsProvider = new ListDataProvider(this, relatedRequestsModel); relatedRequestsContainer.add(new ProcessInstancesPanel(ID_RELATED_REQUESTS, requestsProvider, null, 10, ProcessInstancesPanel.View.TASKS_FOR_PROCESS, null)); relatedRequestsContainer.add(WebComponentUtil.createHelp(ID_RELATED_REQUESTS_HELP)); add(new AjaxFallbackLink(ID_SHOW_PARENT) { public void onClick(AjaxRequestTarget target) { String oid = taskDtoModel.getObject().getParentTaskOid(); if (oid != null) { PageParameters parameters = new PageParameters(); parameters.add(OnePageParameterEncoder.PARAMETER, oid); setResponsePage(PageTaskEdit.class, parameters); } } }); add(WebComponentUtil.createHelp(ID_SHOW_PARENT_HELP)); }
From source file:com.evolveum.midpoint.web.page.admin.workflow.WorkItemPanel.java
License:Apache License
protected void initLayout(PageBase pageBase) { WebMarkupContainer additionalInfoColumn = new WebMarkupContainer(ID_ADDITIONAL_INFO_COLUMN); WebMarkupContainer historyContainer = new WebMarkupContainer(ID_HISTORY_CONTAINER); historyContainer.add(new ItemApprovalHistoryPanel(ID_HISTORY, new PropertyModel<WfContextType>(getModel(), WorkItemDto.F_WORKFLOW_CONTEXT), UserProfileStorage.TableId.PAGE_WORK_ITEM_HISTORY_PANEL, (int) pageBase.getItemsPerPage(UserProfileStorage.TableId.PAGE_WORK_ITEM_HISTORY_PANEL))); final VisibleEnableBehaviour historyContainerVisible = new VisibleEnableBehaviour() { @Override/* ww w .j a v a 2s. c o m*/ public boolean isVisible() { return getModelObject().hasHistory(); } }; historyContainer.add(historyContainerVisible); historyContainer.add(WebComponentUtil.createHelp(ID_HISTORY_HELP)); additionalInfoColumn.add(historyContainer); WebMarkupContainer relatedWorkItemsContainer = new WebMarkupContainer(ID_RELATED_WORK_ITEMS_CONTAINER); final IModel<List<WorkItemDto>> relatedWorkItemsModel = new PropertyModel<>(getModel(), WorkItemDto.F_OTHER_WORK_ITEMS); final ISortableDataProvider<WorkItemDto, String> relatedWorkItemsProvider = new ListDataProvider<>(this, relatedWorkItemsModel); relatedWorkItemsContainer.add(new WorkItemsPanel(ID_RELATED_WORK_ITEMS, relatedWorkItemsProvider, null, 10, WorkItemsPanel.View.ITEMS_FOR_PROCESS)); final VisibleEnableBehaviour relatedWorkItemsContainerVisible = new VisibleEnableBehaviour() { @Override public boolean isVisible() { return !relatedWorkItemsModel.getObject().isEmpty(); } }; relatedWorkItemsContainer.add(relatedWorkItemsContainerVisible); relatedWorkItemsContainer.add(WebComponentUtil.createHelp(ID_RELATED_WORK_ITEMS_HELP)); additionalInfoColumn.add(relatedWorkItemsContainer); final WebMarkupContainer relatedWorkflowRequestsContainer = new WebMarkupContainer( ID_RELATED_REQUESTS_CONTAINER); final IModel<List<ProcessInstanceDto>> relatedWorkflowRequestsModel = new PropertyModel<>(getModel(), WorkItemDto.F_RELATED_WORKFLOW_REQUESTS); final ISortableDataProvider<ProcessInstanceDto, String> relatedWorkflowRequestsProvider = new ListDataProvider<>( this, relatedWorkflowRequestsModel); relatedWorkflowRequestsContainer.add(new ProcessInstancesPanel(ID_RELATED_REQUESTS, relatedWorkflowRequestsProvider, null, 10, ProcessInstancesPanel.View.TASKS_FOR_PROCESS, new PropertyModel<String>(getModel(), WorkItemDto.F_PROCESS_INSTANCE_ID))); final VisibleEnableBehaviour relatedWorkflowRequestsContainerVisible = new VisibleEnableBehaviour() { @Override public boolean isVisible() { return !relatedWorkflowRequestsModel.getObject().isEmpty(); } }; relatedWorkflowRequestsContainer.add(relatedWorkflowRequestsContainerVisible); relatedWorkflowRequestsContainer.add(WebComponentUtil.createHelp(ID_RELATED_REQUESTS_HELP)); additionalInfoColumn.add(relatedWorkflowRequestsContainer); final VisibleEnableBehaviour additionalInfoColumnVisible = new VisibleEnableBehaviour() { @Override public boolean isVisible() { return historyContainerVisible.isVisible() || relatedWorkItemsContainerVisible.isVisible() || relatedWorkflowRequestsContainerVisible.isVisible(); } }; additionalInfoColumn.add(additionalInfoColumnVisible); add(additionalInfoColumn); WebMarkupContainer primaryInfoColumn = new WebMarkupContainer(ID_PRIMARY_INFO_COLUMN); primaryInfoColumn .add(new Label(ID_REQUESTED_BY, new PropertyModel(getModel(), WorkItemDto.F_REQUESTER_NAME))); primaryInfoColumn.add(new Label(ID_REQUESTED_BY_FULL_NAME, new PropertyModel(getModel(), WorkItemDto.F_REQUESTER_FULL_NAME))); primaryInfoColumn.add( new Label(ID_REQUESTED_ON, new PropertyModel(getModel(), WorkItemDto.F_STARTED_FORMATTED_FULL))); primaryInfoColumn.add(new Label(ID_WORK_ITEM_CREATED_ON, new PropertyModel(getModel(), WorkItemDto.F_CREATED_FORMATTED_FULL))); primaryInfoColumn.add(new Label(ID_ASSIGNEE, new PropertyModel(getModel(), WorkItemDto.F_ASSIGNEE))); primaryInfoColumn.add(new Label(ID_CANDIDATES, new PropertyModel(getModel(), WorkItemDto.F_CANDIDATES))); //primaryInfoColumn.add(new ScenePanel(ID_DELTAS_TO_BE_APPROVED, new PropertyModel<SceneDto>(getModel(), WorkItemDto.F_DELTAS))); primaryInfoColumn.add(new TaskChangesPanel(ID_DELTAS_TO_BE_APPROVED, new PropertyModel<TaskChangesDto>(getModel(), WorkItemDto.F_CHANGES))); primaryInfoColumn.add(new AttributeModifier("class", new AbstractReadOnlyModel<String>() { @Override public String getObject() { return additionalInfoColumnVisible.isVisible() ? "col-md-5" : "col-md-12"; } })); add(primaryInfoColumn); add(new AjaxFallbackLink(ID_SHOW_REQUEST) { public void onClick(AjaxRequestTarget target) { String oid = WorkItemPanel.this.getModelObject().getTaskOid(); if (oid != null) { PageParameters parameters = new PageParameters(); parameters.add(OnePageParameterEncoder.PARAMETER, oid); setResponsePage(PageTaskEdit.class, parameters); } } }); add(WebComponentUtil.createHelp(ID_SHOW_REQUEST_HELP)); add(new TextArea<>(ID_APPROVER_COMMENT, new PropertyModel<String>(getModel(), WorkItemDto.F_APPROVER_COMMENT))); }