Hi,

*Requirement*
I have a HomePageViewModel where there is one action (button) that does
some processing and return another view model PendingApprovalViewModel.
This PendingApprovalViewModel contains a collection of
TransactionViewModel. For this TransactionViewModel there is a bulk action
as "Approve".

1) HomePageViewModel#process() : PendingApprovalViewModel
2) PendingApprovalViewModel#pendingApprovalTransaction <-
Collection<TransactionViewModel>
3) TransactionViewModel#approve(Collection<TransactionViewModel>):void
4) TransactionViewModel#id, label, description, money, valueDate, etc.

Objective is to show a table/grid of transactions with checkbox and let
user select desired transaction record and click on "Approve" action/button.

*Problem Statement*
After processing the PendingApprovalViewModel is returned with transaction
filled in it however, when PendingApprovalViewModel is rendered application
seems to create new instance of PendingApprovalViewModel, instead of
rendering the original view model that was returned.

When I return Collection<TransactionViewModel> it render all the
TransactionViewModel correctly but without checkbox and "Approve"
button/action.

Looks like I am missing something very fundamental w.r.to ViewModel. May be
I need access to  request or session where I can store these
TransactionViewModel and amend PendingApprovalViewModel to get it from that
store and return.

Any advise/help on this will be great.

*Apache ISIS version : 2.0.0-M1*

Thank You,
Jayesh

Reply via email to