Search in sources :

Example 1 with AjaxLinkColumn

use of com.evolveum.midpoint.web.component.data.column.AjaxLinkColumn in project midpoint by Evolveum.

the class ProcessInstancesPanel method createNameColumn.

@NotNull
private IColumn<ProcessInstanceDto, String> createNameColumn() {
    if (WebComponentUtil.isAuthorized(AuthorizationConstants.AUTZ_UI_TASKS_ALL_URL, AuthorizationConstants.AUTZ_UI_TASK_URL)) {
        return new AjaxLinkColumn<ProcessInstanceDto>(createStringResource("MyRequestsPanel.name"), "name") {

            @Override
            protected IModel createLinkModel(IModel<ProcessInstanceDto> rowModel) {
                return createProcessNameModel(rowModel);
            }

            @Override
            public void onClick(AjaxRequestTarget target, IModel<ProcessInstanceDto> rowModel) {
                ProcessInstanceDto piDto = rowModel.getObject();
                itemDetailsPerformed(target, piDto.getTaskOid());
            }
        };
    } else {
        return new GenericColumn<>(createStringResource("MyRequestsPanel.name"), rowModel -> createProcessNameModel(rowModel));
    }
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) GenericColumn(com.evolveum.midpoint.web.component.data.column.GenericColumn) IModel(org.apache.wicket.model.IModel) AjaxLinkColumn(com.evolveum.midpoint.web.component.data.column.AjaxLinkColumn) ProcessInstanceDto(com.evolveum.midpoint.web.page.admin.workflow.dto.ProcessInstanceDto) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with AjaxLinkColumn

use of com.evolveum.midpoint.web.component.data.column.AjaxLinkColumn in project midpoint by Evolveum.

the class ProcessInstancesPanel method createObjectNameColumn.

// copied and adapted from WorkItemsPanel - TODO deduplicate
IColumn<ProcessInstanceDto, String> createObjectNameColumn(final String headerKey) {
    return new AjaxLinkColumn<ProcessInstanceDto>(createStringResource(headerKey), ProcessInstanceDto.F_OBJECT_NAME) {

        @Override
        public void onClick(AjaxRequestTarget target, IModel<ProcessInstanceDto> rowModel) {
            ProcessInstanceDto dto = rowModel.getObject();
            dispatchToObjectDetailsPage(dto.getObjectRef(), getPageBase(), false);
        }
    };
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) IModel(org.apache.wicket.model.IModel) AjaxLinkColumn(com.evolveum.midpoint.web.component.data.column.AjaxLinkColumn) ProcessInstanceDto(com.evolveum.midpoint.web.page.admin.workflow.dto.ProcessInstanceDto)

Example 3 with AjaxLinkColumn

use of com.evolveum.midpoint.web.component.data.column.AjaxLinkColumn in project midpoint by Evolveum.

the class ProcessInstancesPanel method createTargetNameColumn.

IColumn<ProcessInstanceDto, String> createTargetNameColumn(final String headerKey) {
    return new AjaxLinkColumn<ProcessInstanceDto>(createStringResource(headerKey), ProcessInstanceDto.F_TARGET_NAME) {

        @Override
        public void onClick(AjaxRequestTarget target, IModel<ProcessInstanceDto> rowModel) {
            ProcessInstanceDto dto = rowModel.getObject();
            dispatchToObjectDetailsPage(dto.getTargetRef(), getPageBase(), false);
        }
    };
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) IModel(org.apache.wicket.model.IModel) AjaxLinkColumn(com.evolveum.midpoint.web.component.data.column.AjaxLinkColumn) ProcessInstanceDto(com.evolveum.midpoint.web.page.admin.workflow.dto.ProcessInstanceDto)

Aggregations

AjaxLinkColumn (com.evolveum.midpoint.web.component.data.column.AjaxLinkColumn)3 ProcessInstanceDto (com.evolveum.midpoint.web.page.admin.workflow.dto.ProcessInstanceDto)3 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)3 IModel (org.apache.wicket.model.IModel)3 GenericColumn (com.evolveum.midpoint.web.component.data.column.GenericColumn)1 NotNull (org.jetbrains.annotations.NotNull)1