-
1. Re: jsf client id and page refresh problem with richfaces modal panel
swap_raw4u Aug 30, 2010 6:31 AM (in response to swap_raw4u)Please guys somebody please help me out on this
-
2. Re: jsf client id and page refresh problem with richfaces modal panel
speleomaniac Sep 20, 2010 6:43 AM (in response to swap_raw4u)May be that can help
NamespacingIn 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:myBtnTo 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_IDsince 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.Namespacing
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
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.
-
3. Re: jsf client id and page refresh problem with richfaces modal panel
deadlock_gr Sep 21, 2010 7:13 AM (in response to swap_raw4u)1 of 1 people found this helpful1. You can add the attribute prependId="false" in the form of your page. The ids you have set for your components will be used as is.
-
4. Re: jsf client id and page refresh problem with richfaces modal panel
akaine Sep 21, 2010 8:57 AM (in response to swap_raw4u)1 of 1 people found this helpfulAlso you can call elements by their "clean" id using RF component finder: #{rich:component('myId')} which returns the JS element object.
Example:
<rich:modalPanel id="myModalPanel">
some event attached to some other element showing the modal panel:
onclick="#{rich:component('myModalPanel')}.show();"
-
5. Re: jsf client id and page refresh problem with richfaces modal panel
amarkhel Sep 24, 2010 10:13 AM (in response to swap_raw4u)1. Use onclick="#{rich:component('myModalPanel')} finder
2. I guess your code for closing popup is wrong, can you post your code? Anyway you can use in pages.xml next construction:
<action on-postback="false" execute="#{indexManager.init}"/>
3. Can you post the code and describe concrete problem?