-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi all,
I have a problem with the buttons in the navigation bar.
My application is very similar to the one of the index.zul ... with navigation buttons on the left side.
My problem is related to the button and how to reload the page.
Some pages have got links inside that open other page inside the center component...
Now ... if I press the navigation menu button (the same) I would love to reload the page ... but this do not happen ... I have to load a different page and get back on the other to reopen the page...
What shall I do to correct this behavior?
Thanks in advance
Kar
You can use Executions.sendRedirect() to reload the page.
Hi Jumperchen,
the problem that Executions.sendRedirect() has is that I cannot specify the target div of the page that I want to update with my content.
The code used by kar is like the following:
Executions.createComponents(myLink, centerDiv, sessionScope);
where myLink is the url to load, centerDiv is a page specific div to load the content into, and sessionScope is the Map to get some parameter from.
Now, Executions.createComponents doesn't refresh probably because component is already created, and must only be reloaded...so i'd like to know if there's any API to realize a similar requirement.
Thanx.
Ale
You can invoke the comp.invalidate() to refresh its content.
Hi jumperchen,
I've got a menu that load the specific component and calls the Executions.createComponents(myLink, centerDiv, sessionScope);
So I've tried to invalidate my centerDiv, even before or after Executions.createComponents, but nothing happens... which component do u mean to be invalidated?
Thanx.
Ale
centerDiv.GetChildrens().clear();
Executions.createComponents(myLink, centerDiv, sessionScope);
...nothing changes... or it is the same result, so you assume it is nothing changed.
That's AJAX. Why it should load components new, if nothing have change?
For testing make changes in the components that should be loaded newly.
You're right Terry, probably I didn't explain very well.
My problem is that my app has a collection of menu items, on the left side of the layout, and a center content that should be filled every time i click on a specific button, with its corresponding ZUL component. So my problem is that one:
- I can fill correctly the center content with my ZUL component A clicking on its relative button, calling Execute.createComponent,
- I click on a second time that button, and another component B is loaded in the center content
- I click the second time on my first button -> my component A is not shown anymore.
So I cannot reload a component after another component has been loaded.
Ale
Asked: 2010-02-05 03:49:45 +0800
Seen: 721 times
Last updated: Apr 08 '10