javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-2588

clientbehavior rendered multiple times with nested composite components

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Works as designed
    • Affects Version/s: 2.1.14
    • Fix Version/s: 2.2.5
    • Component/s: None
    • Labels:
      None

      Description

      Hi,

      I'd like to have a couple of composite components: "toolbar" and "editor".

      The toolbar is used in several edit pages, but can also be nested within the editor component.

      I need ajax behavior on some pages, so I have the toolbar declare a clientbehavior like this:

      toolbar.xhtml: <cc:clientBehavior name="save" targets="toolbarSaveBtn" event="action" />

      When I use the toolbar directly in pages everything is fine, but if I attempt to nest the toolbar into the editor component and "bridge" the clientbehavior with:

      editor.xhtml: <cc:clientBehavior name="save" targets="toolbar" event="save" />

      (Where toolbar is the toolbar component id).

      The containing page has:

      <form>
      <editor:editor id="editor">
      <f:ajax event="save" listener="#

      {backingBean.saveNew}

      " execute="@form" render="@all"
      </editor:editor>
      </form>

      When the toolbar internals are "inlined/copied" directly into "editor" it behaves like expected, when I put the toolbar into the editor component I see my listener getting triggered multiple (4 i think) times per click on the toolbar button.

      When I do a view source in the browser it looks like the client behavior has been included twice in "onclick".

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Manfred Riem
              Reporter:
              chris_dezide
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: