[jboss-user] [JBoss Portal] New message: "Re: Long client id's for rich faces components in portlets"
vineet tripathi
do-not-reply at jboss.com
Tue Jan 26 06:50:24 EST 2010
User development,
A new message was posted in the thread "Long client id's for rich faces components in portlets":
http://community.jboss.org/message/522270#522270
Author : vineet tripathi
Profile : http://community.jboss.org/people/vineet_tripathi
Message:
--------------------------------------------------------------
*Namespacing*
The bridge handles the namespacing combinations of JSF in the portal environment. In situations where you need to use the id of an element in your JSF/xhtml markup, you would normally see something like 'form1:myBtn' in the rendered markup. But now with the bridge namespacing you will see something similar to:
jbpns_2fdefault_2fNews_2fStories_2fStoryTemplateWindow12snpbj:_viewRoot:form1:myBtn
To overcome this, you can use the following expression in your Facelets page to prepend the namespace to your javascript code:
document.getElementById('#{facesContext.externalContext.response.namespace}the_rest_of_JSF_ID');
Please note that since this uses the portletResponse, once you try to view this page on the servlet application side you will get an exception. To avoid this, you need to check for the type of response in your backing bean and assign a new "safe" namespace variable for the UI.
Refer to: http://www.infoq.com/articles/jsf-ajax-seam-portlets-pt-1
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/522270#522270
More information about the jboss-user
mailing list