Search in sources :

Example 1 with LinkColumn

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

the class ResourceListPanel method initColumns.

private List<IColumn> initColumns() {
    List<IColumn> columns = new ArrayList<IColumn>();
    IColumn column = new LinkColumn<SelectableBean<ResourceType>>(createStringResource("ObjectType.name"), "name", "value.name") {

        @Override
        public void onClick(AjaxRequestTarget target, IModel<SelectableBean<ResourceType>> rowModel) {
            ResourceType resource = rowModel.getObject().getValue();
            resourceSelectedPerformed(target, resource);
        }
    };
    columns.add(column);
    return columns;
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) IModel(org.apache.wicket.model.IModel) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) ArrayList(java.util.ArrayList) ResourceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType) LinkColumn(com.evolveum.midpoint.web.component.data.column.LinkColumn)

Example 2 with LinkColumn

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

the class ObjectSelectionPanel method initColumns.

private List<IColumn<SelectableBean<ObjectType>, String>> initColumns() {
    List<IColumn<SelectableBean<ObjectType>, String>> columns = new ArrayList<>();
    IColumn column = new LinkColumn<SelectableBean<ObjectType>>(createStringResource("chooseTypeDialog.column.name"), context.getSortableProperty(), "value.name") {

        @Override
        public void onClick(AjaxRequestTarget target, IModel<SelectableBean<ObjectType>> rowModel) {
            ObjectType object = rowModel.getObject().getValue();
            context.chooseOperationPerformed(target, object);
        }
    };
    columns.add(column);
    return columns;
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ObjectType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType) IModel(org.apache.wicket.model.IModel) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) ArrayList(java.util.ArrayList) LinkColumn(com.evolveum.midpoint.web.component.data.column.LinkColumn)

Example 3 with LinkColumn

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

the class WorkItemsPanel method createTargetNameColumn.

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

        @Override
        protected IModel<String> createLinkModel(IModel<WorkItemDto> rowModel) {
            return Model.of(WebModelServiceUtils.resolveReferenceName(rowModel.getObject().getTargetRef(), getPageBase()));
        }

        @Override
        public void onClick(AjaxRequestTarget target, IModel<WorkItemDto> rowModel) {
            WorkItemDto dto = rowModel.getObject();
            dispatchToObjectDetailsPage(dto.getTargetRef(), getPageBase(), false);
        }

        @Override
        public void populateItem(Item<ICellPopulator<WorkItemDto>> cellItem, String componentId, final IModel<WorkItemDto> rowModel) {
            super.populateItem(cellItem, componentId, rowModel);
            Component c = cellItem.get(componentId);
            c.add(new AttributeAppender("title", getTargetObjectDescription(rowModel)));
        }
    };
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) PageWorkItem(com.evolveum.midpoint.web.page.admin.workflow.PageWorkItem) Item(org.apache.wicket.markup.repeater.Item) IModel(org.apache.wicket.model.IModel) WorkItemDto(com.evolveum.midpoint.web.page.admin.workflow.dto.WorkItemDto) Component(org.apache.wicket.Component) DateLabelComponent(com.evolveum.midpoint.web.component.DateLabelComponent) LinkColumn(com.evolveum.midpoint.web.component.data.column.LinkColumn) AttributeAppender(org.apache.wicket.behavior.AttributeAppender)

Example 4 with LinkColumn

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

the class WorkItemsPanel method createObjectNameColumn.

IColumn<WorkItemDto, String> createObjectNameColumn(final String headerKey) {
    return new LinkColumn<WorkItemDto>(createStringResource(headerKey), WorkItemDto.F_OBJECT_NAME) {

        private static final long serialVersionUID = 1L;

        @Override
        protected IModel<String> createLinkModel(IModel<WorkItemDto> rowModel) {
            return Model.of(WebModelServiceUtils.resolveReferenceName(rowModel.getObject().getObjectRef(), getPageBase()));
        }

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

Example 5 with LinkColumn

use of com.evolveum.midpoint.web.component.data.column.LinkColumn 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 LinkColumn<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) ProcessInstanceDto(com.evolveum.midpoint.web.page.admin.workflow.dto.ProcessInstanceDto) LinkColumn(com.evolveum.midpoint.web.component.data.column.LinkColumn)

Aggregations

LinkColumn (com.evolveum.midpoint.web.component.data.column.LinkColumn)8 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)8 IModel (org.apache.wicket.model.IModel)8 ProcessInstanceDto (com.evolveum.midpoint.web.page.admin.workflow.dto.ProcessInstanceDto)3 ArrayList (java.util.ArrayList)3 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)3 WorkItemDto (com.evolveum.midpoint.web.page.admin.workflow.dto.WorkItemDto)2 PropertyColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn)2 Item (org.apache.wicket.markup.repeater.Item)2 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)1 SystemException (com.evolveum.midpoint.util.exception.SystemException)1 DateLabelComponent (com.evolveum.midpoint.web.component.DateLabelComponent)1 PageAuditLogDetails (com.evolveum.midpoint.web.page.admin.reports.PageAuditLogDetails)1 PageWorkItem (com.evolveum.midpoint.web.page.admin.workflow.PageWorkItem)1 AuditEventRecordType (com.evolveum.midpoint.xml.ns._public.common.audit_3.AuditEventRecordType)1 ObjectType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType)1 ResourceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType)1 XMLGregorianCalendar (javax.xml.datatype.XMLGregorianCalendar)1 QName (javax.xml.namespace.QName)1 AttributeModifier (org.apache.wicket.AttributeModifier)1