Hi,
I used a navigationbutton in my navigationview. I want validation control in navigationbutton click event. If the process is valid then I want to navigate “XYZ” view, or it isn’t valid I want to show a message.
But,
There is a problem here.
NavigationButton navigationButton = new NavigationButton(“XYZ”);
navigationButton.addClickListener(new NavigationButtonClickListener() {
@Override
public void buttonClick(NavigationButtonClickEvent event) {
try {
/* in the code below I want to process to be stopped. I want to navigation view not to be navigated. But I don't know why the process is continued. And I am seeing empty view. The thing that I want is navigating to a view after I validate it. */
if (!"a".equals("b")) {
Notification.show("a is not equal to b");
return;
}
/* process continues here
.......
*/
getNavigationManager().navigateTo(new XyzView());
/* No problem here */
} catch (Exception e) {
Notification.show("Try Catch Error");
}
}
});