-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Let's say I am working on a contact mgt app. I have a contact List page that displays list of contacts then I have an edit contact page that allows editing of a single contact.
Now my data model gets a bit more complicated. A contact can have one or more partners. Partners are modelled as contact in my ER model.
In my edit contact page I have a list showing partners. If I want open the details of a partner (which is a contact) I want to refresh the EditContact page again this time around supplying the id of the partner.
I have implemented navigation using the example I found on fiddle "MVVM paging list detail and back navigation" You can google this. Unfortunately I am not allowed to post url's here. It has worked fine up on till now with this more complicated use case.
In this fiddle example there is MainViewModel that handles navigation. Navigation from other view models is done by issuing a global command.
In my code, I noticed that If I am on editContact page and I want to navigate to (i.e. reload) editContact page navigation does not happen.
Any ideas ? Is there a better approach to navigation in ZK ? What is the recommended approach ?
In the future we will be working on more complex data models e.g. Building, Building units e.t.c. Where self referential relations like this are common.
In my view model
I have attempted the following logic
Map<String, Object> arguments = new HashMap<String, Object>();
arguments.put("detailsPojo", pojo);
arguments.put("scDetailPojo", scPojo);
arguments.put("bindVarPojoParam", selectedRecord);
arguments.put("parentSubBindVarPojoParam", editRecord);
arguments.put("subBindVarPojoParam", subBindVariable);
BindUtils.postGlobalCommand(null, null, "openSubBindVarDetailsView2", arguments);
The page does not reload.
I have also tried this
Execution exec = Executions.getCurrent();
HashMap arguments = (HashMap)exec.getArg();
arguments.put("detailsPojo", pojo);
arguments.put("scDetailPojo", scPojo);
arguments.put("bindVarPojoParam", selectedRecord); // parentSubBindVarPojoParam
arguments.put("parentSubBindVarPojoParam", editRecord);
arguments.put("subBindVarPojoParam", subBindVariable);
exec.sendRedirect("");
I get the following error
java.lang.ClassCastException: java.util.Collections$EmptyMap cannot be cast to java.util.HashMap
Asked: 2021-05-04 18:43:22 +0800
Seen: 8 times
Last updated: May 13 '21
bug with intboxes on mobile devices
zk keikai-how to add custom button/label to formulabar?
zk-keikai- update multiple cells parallel at same time asynchronously
zk-keikai-How to auto fit column width based on text
zk-keikai-ClipboardPateEvent-called twice
Reference a spring bean from VariableResolver