4 Replies Latest reply on Apr 15, 2010 9:52 AM by Ilya Shaikovsky

    dynamically include xhtml pages by selecting radiobutton

    matteo cremolini Newbie

      Hi all,

      we have to dynamically include(with a4j:include) different xhtml pages by selecting a radiobutton as demanded by our customer .

      The approach we chose is to have the 'view-id' property of a4j:include tag updated with the correct path when a radiobutton is clicked.

      Here is a snippet of the page:

       

      <h:selectOneRadio id="insertMode"
          value="#{insertDocumentBean.insertMode}">
          <f:selectItem itemLabel="#{'Da Disco'}" itemValue="" />
          <f:selectItem itemLabel="#{'Da scanner dipartimentale'}"
           itemValue="/includes/fromGroupScanners.xhtml" />    
          <f:selectItem itemLabel="#{'Riferimento a cartaceo'}"
           itemValue="/includes/sheetReference.xhtml" />
          <a4j:support event="onclick" eventsQueue="insertModeQueue"
           ajaxSingle="true" limitToList="true"
           reRender="insertModeContainer,errorPanel,documentiScannerPanel"></a4j:support>
         </h:selectOneRadio> <a4j:outputPanel id="insertModeContainer" layout="none"
          ajaxRendered="false">
          <a4j:include
           viewId="#{sdp:getStringValueOrDefault(param.insertMode,'/includes/fileUpload.xhtml')}"
           layout="inline" />
         </a4j:outputPanel>
      

       

      This seems to be fine when running in Firefox but running in Explorer (7 and 8) there is a javascript error that blocks the request.

       

      The error is:

       

      Webpage error details

      User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727)
      Timestamp: Tue, 13 Apr 2010 13:43:20 UTC


      Message: Unknown runtime error
      Line: 2373
      Char: 3
      Code: 0
      URI: http://10.7.34.52:8080/SDP/doc/a4j/g/3_3_2.SR1/org/ajax4jsf/framework.pack.js.jsf

       

      We need this problem to be fixed because Explorer is the main browser for our customer.

      Thanx in advance.

       

      Matteo