1 Reply Latest reply on Jun 12, 2009 11:05 AM by nbelaevski

    Problem in dynamicaly setting <a4j:support>'s onComplete exp

      Hi All,

      Let me explain what I am trying to do.

      I want a Context Menu to be displayed on right click of tree.

      for that I am using <a4j:support >

      <a4j:support rendered="true" event="oncontextmenu" oncomplete="#{rich:component('TreePopUpMenu')}.doShow(event, {})"
       <f:attribute name="nodeData" value="#{treeNode}"/>

      There is no problem when i used it with .xhtml.

      The real problem occurs when I create <a4j:support> dynamicaly.
      I am setting

      using the code

      HtmlAjaxSupport support = new HtmlAjaxSupport();
      support.setOncomplete("#{rich:component('TreePopUpMenu')}.doShow(event, {})");

      It's giving the following error when i try to render the page

      Error: illegal character
      Source File: http://localhost:8000/simmanager/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/tree-item.js.wtk
      Line: 15, Column: 107
      Source Code:
      anager/portals/Base/facelets/widgettest/simactivityloadspec.jsf','oncomplete':function(request,event,data){#{rich:component('TreePopUpMenu')}.doShow(event, {})},'similarityGroupingId':'UISpecs_Sample_Tree:UISpecs_Sample_Tree-f:TreeEventOnClick:0::j_id26'}

      Do we have any way to call this from javascript?

      Thanks in Advance!!!!!!