2 Replies Latest reply on Mar 24, 2010 8:28 AM by Ben Katz

    What could be causing a4j:support to not work..

    Ben Katz Newbie

      Hi,

       

      I've created a web page with alot of ajax and richfaces (a4j:support all over the place).

      It worked fine until I tried to embed it in another project (I copied the jsp and referenced the backing bean in the jar file from the original project)

       

      At that point all a4j:support stopped working. Other richfaces components still work (Rich context menu for example) and components are visible but not active (Their a4j:support functionality is not working)

       

      I have no idea where to start looking.

      Could someone think of a possible reason for this to happen so I can atleast know where to look?

       

      EDIT - Adding code sample

      I thought i'd add some code sample so maybe someone with could spot the problem

       

      Thank you!

       

       

      The working version:

      <table id="j_id_id1:Button-1364169152" onmousedown="this.className='actionButton actionButtonMouseClick'" onmouseup="this.className='actionButton actionButtonMouseOver'" onmouseover="this.className='actionButton actionButtonMouseOver'" onmouseout="this.className='actionButton'" onclick="A4J.AJAX.Submit('j_id_id1',event,{'similarityGroupingId':'j_id_id1:ChooseActionSupportObject_\x2D1364169152','parameters':{'CurrentButton':'\x2D1364169152','j_id_id1:ChooseActionSupportObject_\x2D1364169152':'j_id_id1:ChooseActionSupportObject_\x2D1364169152'} ,'containerId':'j_id_id0'} )"><tbody><tr><td>Message Text (OkCancel  :&lt;p&gt;
      &lt;div )</td></tr>
      <tr><td></td></tr>
      <tr><td><div id="j_id_id1:ContextMenuButton-1364169152"><script type="text/javascript"><!--
      var contextMenu = new Richfaces.ContextMenu('j_id_id1:ContextMenuButton-1364169152', 50, [new E('div',{'style':'display: none; z\x2Dindex: 2;', 'className':'rich\x2Dmenu\x2Dlist\x2Dborder', 'id':'j_id_id1:ContextMenuButton\x2D1364169152_menu'},[new E('div',{'className':'rich\x2Dmenu\x2Dlist\x2Dbg'},[new E('div',{'onclick':function (context) { return Richfaces.interpolate("RichFaces.Menu.submitForm(event,this,{'p':{'MenuItemDown':'\x2D1364169152'} } )", context);}, 'id':'j_id_id1:downButton\x2D1364169152', 'className':'rich\x2Dmenu\x2Ditem rich\x2Dmenu\x2Ditem\x2Denabled'},[new E('span',{'id':'j_id_id1:downButton\x2D1364169152:icon', 'className':'rich\x2Dmenu\x2Ditem\x2Dicon'},[new E('img',{'width':'16', 'src':'/ScriptManager/faces/a4j/g/3_3_2.SR1images/spacer.gif', 'height':'16', 'alt':''})]),new E('span',{'id':'j_id_id1:downButton\x2D1364169152:anchor', 'className':'rich\x2Dmenu\x2Ditem\x2Dlabel'},[new T('Move Down')])]),new E('div',{'onclick':function (context) { return Richfaces.interpolate("RichFaces.Menu.submitForm(event,this,{'p':{'MenuItemUp':'\x2D1364169152'} } )", context);}, 'id':'j_id_id1:upButton\x2D1364169152', 'className':'rich\x2Dmenu\x2Ditem rich\x2Dmenu\x2Ditem\x2Denabled'},[new E('span',{'id':'j_id_id1:upButton\x2D1364169152:icon', 'className':'rich\x2Dmenu\x2Ditem\x2Dicon'},[new E('img',{'width':'16', 'src':'/ScriptManager/faces/a4j/g/3_3_2.SR1images/spacer.gif', 'height':'16', 'alt':''})]),new E('span',{'id':'j_id_id1:upButton\x2D1364169152:anchor', 'className':'rich\x2Dmenu\x2Ditem\x2Dlabel'},[new T('Move Up')])]),new E('div',{'onclick':function (context) { return Richfaces.interpolate("RichFaces.Menu.submitForm(event,this,{'p':{'MenuItemUp':'\x2D1364169152'} } )", context);}, 'id':'j_id_id1:removeButton\x2D1364169152', 'className':'rich\x2Dmenu\x2Ditem rich\x2Dmenu\x2Ditem\x2Denabled'},[new E('span',{'id':'j_id_id1:removeButton\x2D1364169152:icon', 'className':'rich\x2Dmenu\x2Ditem\x2Dicon'},[new E('img',{'width':'16', 'src':'/ScriptManager/faces/a4j/g/3_3_2.SR1images/spacer.gif', 'height':'16', 'alt':''})]),new E('span',{'id':'j_id_id1:removeButton\x2D1364169152:anchor', 'className':'rich\x2Dmenu\x2Ditem\x2Dlabel'},[new T('Remove')])]),new E('div',{'className':'rich\x2Dmenu\x2Dlist\x2Dstrut'},[new E('div',{'style':'', 'className':'rich\x2Dmenu\x2Dlist\x2Dstrut'},[new T('&#160;')])])])])
      , new E('script',{'type':'text/javascript', 'id':'j_id_id1:ContextMenuButton\x2D1364169152_menu_script'},[new T('\x3C!\x2D\x2D\nnew RichFaces.Menu.Layer(\'j_id_id1:ContextMenuButton\\x2D1364169152_menu\',{\'hideDelay\':800,\'delay\':50} ).asContextMenu().addItems([[\'j_id_id1:downButton\\x2D1364169152\'\x5D ,[\'j_id_id1:upButton\\x2D1364169152\'\x5D ,[\'j_id_id1:removeButton\\x2D1364169152\'\x5D \x5D );\n//\x2D\x2D\x3E')])
      ]);Richfaces.onAvailable('j_id_id1:Button\x2D1364169152',function () {var vars = {contextMenu:contextMenu};return function() { with (vars) {contextMenu.attachToElementById('j_id_id1:Button\x2D1364169152','oncontextmenu',{} )}}}());
      //--></script></div></td></tr>
      </tbody></table>
      
      

       

      The not working version:

      <table id="j_id_id5:Button-499223575" class="actionButton rich-cm-attached">
      <tbody><tr><td>Key Press (LongPress:2518)</td></tr><tr><td></td></tr><tr>
      <td><div id="j_id_id5:ContextMenuButton-499223575"><script type="text/javascript">var contextMenu = new Richfaces.ContextMenu('j_id_id5:ContextMenuButton-499223575', 50, [new E('div',{'style':'display: none; z\x2Dindex: 2;', 'className':'rich\x2Dmenu\x2Dlist\x2Dborder', 'id':'j_id_id5:ContextMenuButton\x2D499223575_menu'},[new E('div',{'className':'rich\x2Dmenu\x2Dlist\x2Dbg'},[new E('div',{'onclick':function (context) { return Richfaces.interpolate("RichFaces.Menu.submitForm(event,this,{'p':{'MenuItemDown':'\x2D499223575'} } )", context);}, 'id':'j_id_id5:downButton\x2D499223575', 'className':'rich\x2Dmenu\x2Ditem rich\x2Dmenu\x2Ditem\x2Denabled'},[new E('span',{'id':'j_id_id5:downButton\x2D499223575:icon', 'className':'rich\x2Dmenu\x2Ditem\x2Dicon'},[new E('img',{'width':'16', 'src':'/ManagementPortal/faces/a4j/g/3_3_2.SR1images/spacer.gif', 'height':'16', 'alt':''})]),new E('span',{'id':'j_id_id5:downButton\x2D499223575:anchor', 'className':'rich\x2Dmenu\x2Ditem\x2Dlabel'},[new T('Move Down')])]),new E('div',{'onclick':function (context) { return Richfaces.interpolate("RichFaces.Menu.submitForm(event,this,{'p':{'MenuItemUp':'\x2D499223575'} } )", context);}, 'id':'j_id_id5:upButton\x2D499223575', 'className':'rich\x2Dmenu\x2Ditem rich\x2Dmenu\x2Ditem\x2Denabled'},[new E('span',{'id':'j_id_id5:upButton\x2D499223575:icon', 'className':'rich\x2Dmenu\x2Ditem\x2Dicon'},[new E('img',{'width':'16', 'src':'/ManagementPortal/faces/a4j/g/3_3_2.SR1images/spacer.gif', 'height':'16', 'alt':''})]),new E('span',{'id':'j_id_id5:upButton\x2D499223575:anchor', 'className':'rich\x2Dmenu\x2Ditem\x2Dlabel'},[new T('Move Up')])]),new E('div',{'onclick':function (context) { return Richfaces.interpolate("RichFaces.Menu.submitForm(event,this,{'p':{'MenuItemUp':'\x2D499223575'} } )", context);}, 'id':'j_id_id5:removeButton\x2D499223575', 'className':'rich\x2Dmenu\x2Ditem rich\x2Dmenu\x2Ditem\x2Denabled'},[new E('span',{'id':'j_id_id5:removeButton\x2D499223575:icon', 'className':'rich\x2Dmenu\x2Ditem\x2Dicon'},[new E('img',{'width':'16', 'src':'/ManagementPortal/faces/a4j/g/3_3_2.SR1images/spacer.gif', 'height':'16', 'alt':''})]),new E('span',{'id':'j_id_id5:removeButton\x2D499223575:anchor', 'className':'rich\x2Dmenu\x2Ditem\x2Dlabel'},[new T('Remove')])]),new E('div',{'className':'rich\x2Dmenu\x2Dlist\x2Dstrut'},[new E('div',{'style':'', 'className':'rich\x2Dmenu\x2Dlist\x2Dstrut'},[new T(' ')])])])])
      , new E('script',{'type':'text/javascript', 'id':'j_id_id5:ContextMenuButton\x2D499223575_menu_script'},[new T('new RichFaces.Menu.Layer(\'j_id_id5:ContextMenuButton\\x2D499223575_menu\',{\'hideDelay\':800,\'delay\':50} ).asContextMenu().addItems([[\'j_id_id5:downButton\\x2D499223575\'\x5D ,[\'j_id_id5:upButton\\x2D499223575\'\x5D ,[\'j_id_id5:removeButton\\x2D499223575\'\x5D \x5D );')])
      ]);Richfaces.onAvailable('j_id_id5:Button\x2D499223575',function () {var vars = {contextMenu:contextMenu};return function() { with (vars) {contextMenu.attachToElementById('j_id_id5:Button\x2D499223575','oncontextmenu',{} )}}}());</script></div></td>
      </tr>
      </tbody>
      </table>