ZK - Open Source Ajax Java FrameworkZK - Open Source Ajax Java Framework

new feature page.setComplete

admin
26 Mar 2008 17:17:30 GMT
26 Mar 2008 17:17:30 GMT


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4865378

By: oberinspector

try to get page.setComplet to work from richlet, but doesn't seem to work in the way i create the desktop... following (simplyfied) code works fine and the diplayed page looks good, but the generated html does not (2x HTML, 2xHEAD, 2x BODY...)

from my richlet.service(page) i instantiate a Richlet desktop:

public class RichletDesktop {
private final WebSiteData wsd;

public RichletDesktop(Page page) throws MenuHierarchyException,
ParsedUrlException, SiteParserException,
SiteNotFoundException, IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {


//analyze the url and store result in ParsedURL pu
ParsedURL pu = new ParsedURL(page);

//retrieve website data from db (html template, title, navigation sitemap...)
wsd = new WebSiteData(pu.getSiteURL(), null);


page.getDesktop().setAttribute("WEBSITE_DATA", wsd);
page.setTitle(wsd.getTitle());

//create the html root component from html template string (from db... complete with html, head, body)
Component htmlRootComponent = page.getDesktop().getExecution()
.createComponentsDirectly(wsd.getHtml(), null, null, null);


page.setComplete(true); //new...doesnt work here??? how to avoid rendering of second html/head/body?
htmlRootComponent.setPage(page);
ComponentManager.update();

}

}