Skip to content

Commit

Permalink
list tasks - detaching
Browse files Browse the repository at this point in the history
  • Loading branch information
katkav committed Mar 15, 2022
1 parent c084786 commit 5f223be
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ public ObjectReferenceColumn(IModel<String> displayModel, String propertyExpress
@Override
public void populateItem(Item<ICellPopulator<T>> item, String componentId, IModel<T> rowModel) {
IModel<ObjectReferenceType> dataModel = extractDataModel(rowModel);
ObjectReferenceType referenceType = dataModel.getObject();
item.add(new ObjectReferenceColumnPanel(componentId, Model.of(referenceType)));
item.add(new ObjectReferenceColumnPanel(componentId, dataModel));

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType;

import org.apache.wicket.model.IDetachable;
import org.apache.wicket.model.IModel;

/**
* @author lazyman
*/
public class SelectableBeanImpl<T extends Serializable> extends Selectable<T> implements SelectableBean<T> {
public class SelectableBeanImpl<T extends Serializable> extends Selectable<T> implements SelectableBean<T> , IDetachable {
private static final long serialVersionUID = 1L;

public static final String F_VALUE = "value";
Expand Down Expand Up @@ -167,4 +168,9 @@ public Object getCustomData() {
public void setCustomData(Object customData) {
this.customData = customData;
}

@Override
public void detach() {
customData = null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,11 @@ private void addCustomColumns(List<IColumn<SelectableBean<TaskType>, String>> co
@Override
public IModel<ObjectReferenceType> extractDataModel(IModel<SelectableBean<TaskType>> rowModel) {
SelectableBean<TaskType> bean = rowModel.getObject();
return Model.of(bean.getValue().getObjectRef());
ObjectReferenceType objectRef = bean.getValue().getObjectRef();
if (objectRef != null) {
objectRef.asReferenceValue().clearParent();
}
return Model.of(objectRef);

}
});
Expand Down

0 comments on commit 5f223be

Please sign in to comment.