-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Their are list of links,on click of those links we redirect to another page. But sometimes on click of one perticular link the page get redirect but display empty page. This happens only that perticular link and all other links redirects proper and shows content in page.
Hard to reproduce. Can you show us the dependend code?
Aaahh, Multi page design. I recommend my two eBooks. The second is for multi page websites.
Executions.sendRedirect() accepts NO params. So you must store the params in the user session. Next i think you mean 'viewRequest.zul' not 'viewRequest.html'.
VM1 calls zul for VM2:
// put the params in the session
Sessions.getCurrent().setAttribute("myParams", map);
Executions.sendRedirect("viewRequest.zul");
VM2:
/**
* Init. We use this method if we have a multi-page application for getting
* the needed params from the session. Otherwise we get the params in the @AfterCompose
* method.
*/
@SuppressWarnings("unchecked")
@Init
public void init() {
final HashMap<String, Object> map = (HashMap<String, Object>) Sessions.getCurrent().getAttribute("myParams");
/**
* Check if this page is called as 'Executions.sendRedirect()'.<br>
* If so than we get the needed parameters from the session variables.
*/
if (map != null) {
if (map.containsKey("mode")) {
. . .
best Stephan
I don't think it is necessary to store the parameters in the session to use sendRedirect. You may pass the parameters inside the url query string:
String url = "my-page.zul?id=" + myParamerer;
Executions.getCurrent().sendRedirect(url);
and then retrieve your parameters while initializing the view model:
@Init
public void init(@QueryParam("id") String myParameter) { ... }
Hope that helps
Costas
Yes Costas, you are right. That's an other way to do such things.
Hello ChaitanyaIssueTracker,
Since the specific page is not displayed correctly, you have to debug it and see if:
*As an alternative way to get the parameter that is included in the url please use the following:
String parameter = Executions.getCurrent().getParameter("parameter-name");
Best Regards,
Darksu
Asked: 2015-01-07 12:13:30 +0800
Seen: 28 times
Last updated: Jan 09 '15
sendRedirect hide URL [closed]
Timeout on timeOut on....... [closed]
redirection without "server processing page"
Executions.SendRedirect in the @Init [closed]
How to access attribute of servlet context in zk application ?
How to open new tab in SelectorComposer?
execution.sendRedirect not working in IE9 & IE8
Hi terrytornado, On click at the link it calls method @Command public void showIssueDetails(@BindingParam("issueID") String issueID,@BindingParam("effortBreakUp") String effortBreakUp,@BindingParam("activityID") int activityID){ Executions.sendRedirect("/viewRequest.htm");}
ChaitanyaIssueTracker ( 2015-01-07 13:29:41 +0800 )edit