I have an issue I'm sure someone else must have come across at one point or another.
It's essentially to do with rendering order. Take the following example:

final BigDecimalCalc adder = new BigDecimalCalc();

add(new ListView<...>("myListView", yModel(...)) {
        ...
        protected void populateItem(ListItem<...> item) {
                ...
                BigDecimal total = ...;
                adder.add(total);
        }}
});

add(new Label("mySum", adder.getValue());

So of course the mySum label gets rendered before the listView items have been rendered, which in turn means that the result for mySum is always zero.

Now I could likely pre-load my data and make my calculations before sending it to the components, but it seems to me that since I'm iterating over the data anyway, I'd like to use that loop for doing something like sum the elements in the list.

Does anyone have a solution for this or is there some Wicket magic I haven't found yet?

- Brill

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to