Very simple rich:simpleTogglePanel does not work
hanafey Feb 19, 2008 2:29 PMThe simplest possible rich:simpleTogglePanel does not work with switchType ajax (v3.1.4)
This is the page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j"> <head> <title>Test</title> </head> <body> <span style="display:none">#{a4j.version}</span> <a4j:log hotkey="M"/> <a4j:form> <h:panelGrid columns="3" width="100%"> <rich:simpleTogglePanel switchType="server" label="Server Switch Type"> The regular JSF form submission is processed during the changing mode between showing and hidding the additional content. </rich:simpleTogglePanel> <rich:simpleTogglePanel switchType="ajax" label="Ajax Switch Type"> This type allows to perform the partual view update instead of the whole page reloading. You also can point to other areas of the view to be re-rendered while the panel content is toggled. </rich:simpleTogglePanel> <rich:simpleTogglePanel switchType="client" label="Client Switch Type"> The switching between showing and hiding the toggle panel content performs on the client side. </rich:simpleTogglePanel> </h:panelGrid> </a4j:form> </body> </html>
The aj4 log contains:
debug[14:25:50,365]: Have Event [object Object] with properties: target: [object HTMLDivElement], srcElement: undefined, type: click debug[14:25:50,365]: NEW AJAX REQUEST !!! with form :j_id3 debug[14:25:50,366]: Append hidden control j_id3:j_id9 with value [true] and value attribute [true] debug[14:25:50,367]: Append hidden control j_id3 with value [j_id3] and value attribute [j_id3] debug[14:25:50,367]: Append hidden control autoScroll with value [] and value attribute [] debug[14:25:50,368]: Append hidden control j_id3:_link_hidden_ with value [] and value attribute [] debug[14:25:50,368]: Append hidden control j_id3:_idcl with value [] and value attribute [] debug[14:25:50,369]: Append hidden control javax.faces.ViewState with value [_id1] and value attribute [_id1] debug[14:25:50,369]: parameter j_id3:j_id7 with value j_id3:j_id7 debug[14:25:50,370]: Start XmlHttpRequest debug[14:25:50,372]: Reqest state : 1 debug[14:25:50,372]: QueryString: AJAXREQUEST=_viewRoot&j_id3%3Aj_id9=true&j_id3=j_id3&autoScroll=&j_id3%3A_link_hidden_=&j_id3%3A_idcl=&javax.faces.ViewState=_id1&j_id3%3Aj_id7=j_id3%3Aj_id7& debug[14:25:50,376]: Reqest state : 1 debug[14:25:50,460]: Reqest state : 2 debug[14:25:50,461]: Reqest state : 3 debug[14:25:50,462]: Reqest state : 4 debug[14:25:50,462]: Reqest end with state 4 debug[14:25:50,463]: Response with content-type: text/xml;charset=UTF-8 debug[14:25:50,463]: Full response content: <html xmlns="http://www.w3.org/1999/xhtml"><head><link rel='stylesheet' type='text/css' href='/Tractor/a4j_3_1_4.GAcss/simpleTogglePanel.xcss/DATB/eAGTWzQ.BgAD.AG8.jsf' /><script type='text/javascript' src='/Tractor/a4j_3_1_4.GAorg.ajax4jsf.javascript.AjaxScript.jsf'></script><script type='text/javascript' src='/Tractor/a4j_3_1_4.GAorg/ajax4jsf/javascript/scripts/form.js.jsf'></script><script type='text/javascript' src='/Tractor/a4j_3_1_4.GAorg.ajax4jsf.javascript.PrototypeScript.jsf'></script><script type='text/javascript' src='/Tractor/a4j_3_1_4.GAorg.ajax4jsf.javascript.ImageCacheScript.jsf'></script><script type='text/javascript' src='/Tractor/a4j_3_1_4.GAorg/richfaces/renderkit/html/scripts/browser_info.js.jsf'></script><script type='text/javascript' src='/Tractor/a4j_3_1_4.GAscripts/simpleTogglePanel.js.jsf'></script></head><div class="dr-stglpnl rich-stglpanel " id="j_id3:j_id7" style="width: ; ;"><script type="text/javascript"> //<![CDATA[ SimpleTogglePanelManager.add(new SimpleTogglePanel("j_id3:j_id7", "true")); //]]> </script><div class="dr-stglpnl-h rich-stglpanel-header " id="j_id3:j_id7_header" onclick="A4J.AJAX.Submit('_viewRoot','j_id3',event,{'parameters':{'j_id3:j_id7':'j_id3:j_id7'} ,'actionUrl':'/Tractor/play/stp.jsf?javax.portlet.faces.DirectLink=true'} )"><div class="dr-stglpanel-marker rich-stglpanel-marker"><div class="dr-stglpnl-m rich-stglpnl-marker" id="j_id3:j_id7_switch_on" style="display: ;">«</div><div class="dr-stglpnl-m rich-stglpnl-marker" id="j_id3:j_id7_switch_off" style="display: none;">»</div></div>Ajax Switch Type </div><div class="dr-stglpnl-b rich-stglpanel-body " id="j_id3:j_id7_body" style="display : ; height: ;"> This type allows to perform the partual view update instead of the whole page reloading. You also can point to other areas of the view to be re-rendered while the panel content is toggled.</div></div><meta name="Ajax-Update-Ids" content="j_id3:j_id7" /><span id="ajax-view-state"><span id="org.ajax4jsf.view.state" name="org.ajax4jsf.view.state"><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="_id1" /></span></span><meta id="Ajax-Response" name="Ajax-Response" content="true" /></html> debug[14:25:50,464]: Header Ajax-Expired not found, search in <meta> error[14:25:50,464]: Error parsing XML error[14:25:50,465]: Parse Error: XML Parsing Error: undefined entity Location: http://localhost:8080/Tractor/play/stp.jsf?javax.portlet.faces.DirectLink=true Line Number 5, Column 545: </script><div class="dr-stglpnl-h rich-stglpanel-header " id="j_id3:j_id7_header" onclick="A4J.AJAX.Submit('_viewRoot','j_id3',event,{'parameters':{'j_id3:j_id7':'j_id3:j_id7'} ,'actionUrl':'/Tractor/play/stp.jsf?javax.portlet.faces.DirectLink=true'} )"><div class="dr-stglpanel-marker rich-stglpanel-marker"><div class="dr-stglpnl-m rich-stglpnl-marker" id="j_id3:j_id7_switch_on" style="display: ;">«</div><div class="dr-stglpnl-m rich-stglpnl-marker" id="j_id3:j_id7_switch_off" style="display: none;">»</div></div>Ajax Switch Type </div><div class="dr-stglpnl-b rich-stglpanel-body " id="j_id3:j_id7_body" style="display : ; height: ;"> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^ debug[14:25:50,465]: call getElementById for id= org.ajax4jsf.oncomplete