Revision history [back]

click to hide/show revision 1
initial version

answered 2016-01-08 07:31:27 +0800

chillworld gravatar image chillworld flag of Belgium

https://github.com/chillw...

I think I have found your problem.

First you iterate over a collection to show multiple groupboxes.
Secondly you make a template in each groupbox for the values of the groupbox :

children="@load(vm.expensesforApproval)"

But this collection is the same for every groupbox. You need to make a separation for it and it's possible by :

children="@load(vm.expensesforApproval(each.processID))"

so the getter is now :

public ListModel getExpensesforApproval(Integer id) {
    return new ListModelList(filterCollectionOnId(id));
}

Greetz chill.

I think I have found your problem.

First you iterate over a collection to show multiple groupboxes.
Secondly you make a template in each groupbox for the values of the groupbox :

children="@load(vm.expensesforApproval)"

But this collection is the same for every groupbox. You need to make a separation for it and it's possible by :

children="@load(vm.expensesforApproval(each.processID))"
children="@load(vm.getExpensesforApproval(each.processID))"

so the getter is now :

public ListModel getExpensesforApproval(Integer id) {
    return new ListModelList(filterCollectionOnId(id));
}

Greetz chill.

I think I have found your problem.

First you iterate over a collection to show multiple groupboxes.
Secondly you make a template in each groupbox for the values of the groupbox :

children="@load(vm.expensesforApproval)"

But this collection is the same for every groupbox. You need to make a separation for it and it's possible by :

children="@load(vm.getExpensesforApproval(each.processID))"

so the getter is now :

public ListModel getExpensesforApproval(Integer id) {
    return new ListModelList(filterCollectionOnId(id));
}

Edit:

In the zul, add this to the groupbox :

onOpen="@command('open')"

and the java code :

@Command
public void open(@ContextParam(ContextType.TRIGGER_EVENT) OpenEvent evt) {
    Groupbox box =  (Groupbox)evt.getTarget();
    for (Component comp : box.getParent().getChildren()) {
        if (comp instanceof Groupbox) {
            ((Groupbox)comp).setOpen(false);
        }
    }
    box.setOpen(evt.isOpen());
}

This should do what you want.

Greetz chill.

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More