Details
Description
Hello i have seen that the navigation fails when i use icefaces in portlets.
The problem is in "DOMResponseWriter" class . When I navigate to another page, this class detects if the new page contains the html and body tags, and if these tags aren't then the class add them. In client side, javascript tries to find a component body with id="body" (<body id="body" >) and this fails, because when the portlet was rendered these tags were eliminated.
A solution is don't add these tags and if i need add css style to head use a javascript that load this, by example:
function loadCSS(uri) {
var objHead = document.getElementsByTagName('head');
if (objHead[0]) {
if (document.createElementNS && objHead[0].tagName == 'head') {
var objCSS = objHead[0].appendChild(document.createElementNS('http://www.w3.org/1999/xhtml', 'link'));
} else {
var objCSS = objHead[0].appendChild(document.createElement('link'));
}
objCSS.rel = 'stylesheet';
objCSS.href = uri;
objCSS.type = 'text/css';
}
}
I hope that this was usefull.
Jorge Rodríguez Pedrianes
The problem is in "DOMResponseWriter" class . When I navigate to another page, this class detects if the new page contains the html and body tags, and if these tags aren't then the class add them. In client side, javascript tries to find a component body with id="body" (<body id="body" >) and this fails, because when the portlet was rendered these tags were eliminated.
A solution is don't add these tags and if i need add css style to head use a javascript that load this, by example:
function loadCSS(uri) {
var objHead = document.getElementsByTagName('head');
if (objHead[0]) {
if (document.createElementNS && objHead[0].tagName == 'head') {
var objCSS = objHead[0].appendChild(document.createElementNS('http://www.w3.org/1999/xhtml', 'link'));
} else {
var objCSS = objHead[0].appendChild(document.createElement('link'));
}
objCSS.rel = 'stylesheet';
objCSS.href = uri;
objCSS.type = 'text/css';
}
}
I hope that this was usefull.
Jorge Rodríguez Pedrianes
We've made significant changes to how portlets are handled since 1.5.3. Navigation needs to be reviewed to see if this is still an issue.