Hey all.
I’ve got two questions. I’ve got a manifest entity, which contains multiple order entities.
First, when in a browse screen, you can select rows and add a click event to an row. I’m wondering if it is also possible to make the column level clickable on top of that. For example, if my manifest entity had attributes which stored the number of pending orders, and the number of cancelled orders, is it possible to make those columns clickable (on top of the row) so clicking on an attribute could open a new order-screen with only the pending orders of that manifest ?
Second, I’ve got to the point where I can click a row in my manifest browse, and it opens an order screen with only the orders of that manifest. Which looks like this:
On my manifest browse screen, Ive got the following itemclick override which sends the manifestId to an order browse screen:
@Override
public void init(Map<String, Object> params) {
ManifestsTable.sortBy(ManifestsDs.getMetaClass().getPropertyPath("dateTime"), false);
ManifestsTable.setItemClickAction(new BaseAction("Open orderBrowse of Manifest") {
@Override
public void actionPerform(Component component) {
String manifestId = ManifestsTable.getSingleSelected().getId().toString();
params.put("manifest", manifestId);
openWindow("app$Order.browse", WindowManager.OpenType.NEW_TAB, params);
}
});
In my order browse screen, I’ve set a query filter to filter the orders by that manifestId:
if (params.get("manifest") != null) {
String manifestId = params.get("manifest").toString();
LogicalCondition Condition = new LogicalCondition("", LogicalOp.AND);
Condition.getConditions().add(new Clause("", "o.manifestShipmentidentifier in (select m from app$Manifest m where m.id =" + manifestId + ")", null, null, null));
QueryFilter queryFilter = new QueryFilter(Condition);
eyouOrdersDs.setQueryFilter(queryFilter);
eyouOrdersDs.refresh();
}
I don’t know if this is the cleanest solution, but it works
However, I would like to emphasize the fact that it’s a selected set of orders, by showing the manifest id attribute in the filter of the order browser, filled out by that id. Anyone got a suggestion on how that can be accomplished ?