-
FEATURED COMPONENTS
First time here? Check out the FAQ!
We would like to click on a button in order to save a form. This submit button has to execute an insert or update via JPA.
At the end, we would like to show a notification with the result of operation then launch a redirection.
How to manage a Client.showNotification then a Executions.sendRedirect ? How can we waiting the end of notification before sendRedirect ?
Thank you.
So here my solution.
But works for me. Here is the sample piece of code
try {
CRUDService.Save(this.selectedRecord);
Infrastructure.showSuccessmessage();
goBack();
public static void showSuccessmessage() {
Clients.showNotification(Consts.SUCCESS_MESSAGE,
Clients.NOTIFICATION_TYPE_INFO, null, "top_center", 4100);
}
/* Start: Auto Close Notification message box
/* ----------------------------------------------------------------------------------------------------------------------- */
/* Start: Auto Close Notification message box /* ----------------------------------------------------------------------------------------------------------------------- */ .z-notification .z-notification-cl,.z-notification .z-notification-cnt { height: 30px; width: 250px; }
.z-notification-info .z-notification-cl { background-color: #ADD8E6; }
.z-notification .z-notification-cl { color: white; }
.z-notification .z-notification-cnt { background: none repeat scroll 0 center transparent; font-size: 14px; font-weight: normal; margin: 0 !important; overflow: hidden; }
.z-notification-info .z-notification-cl { background-color: #da5867; }
Yes i am using zk 6 with MVVM. But not with redirect, instead of that Executions.createComponents.
You can see example here. Follow the steps
Click this Link
In the Top Menu, Click MVVM
Next click CRUD Form.
You can see "MVVM CRUD Without DB Connection". In the action column, you can download the source code, or you can run or you can look the documentation.
Have you ever tried Clients.showNotification() methods with parameter duration (in ms)?
void org.zkoss.zk.ui.util.Clients.showNotification(String msg, String type, Component ref, int x, int y, int duration)
void org.zkoss.zk.ui.util.Clients.showNotification(String msg, String type, Component ref, int x, int y, int duration, boolean closable)
void org.zkoss.zk.ui.util.Clients.showNotification(String msg, String type, Component ref, String position, int duration)
maybe that can help.
Asked: 2013-06-13 10:50:13 +0800
Seen: 235 times
Last updated: Jul 16 '13
Databinding and auto-complete on combobox
Composite component and bind in ZK 6
How to detach / reattach MVVM windows?
Is there a way to resolve view model properties as input to client side javascripts?
How can I synchronize data in a ListBox in MVVM ? [closed]
MVVM Validator: class not found ? [closed]
How to Call Child ViewModel Method from Parent Window? [closed]
I do implement the same way. But after save, will show the notification at the top and immediately it will be back to listing screen. Putting messagebox for saving it is not acceptable because they have click the ok button.
Senthilchettyin ( 2013-06-13 11:40:13 +0800 )editYeah, messagebox is not ok for the client. I try to put the sendredirect but the notify action doesn't work. I try with a Thread.sleep but all are frozen....
Mychal ( 2013-06-13 13:28:00 +0800 )edit