I'm trying to use a context menu (using tapestry5-jquery's jquery/ContextMenu mixin) to perform an action, and then I want to update the page to reflect the new state. The first part works just fine, but I can't figure out how to get the page updated afterwards. While a zone update would be ideal, reloading the page would do in a pinch.

I've reduced the problem down to a simple test page:

---------------------------------
ContextMenuTest.tml

<html t:type="layout" title="Context Menu Test"
      xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd";
      xmlns:p="tapestry:parameter"
      xmlns:j="tapestry-library:jquery">

  <t:zone t:id="testZone">
    The count is ${count}.
    <div t:type="any" t:items="contextMenuItems"
                 t:mixins="jquery/ContextMenu"
                 t:zone="testZone"
                 t:id="uid_contextMenu">
       left-click here
    </div>
  </t:zone>
</html>
---------------------------------

---------------------------------
ContextMenuTest.java

public class ContextMenuTest {

  @Persist @Property int count;

  public List<ContextMenuItem> getContextMenuItems() {
return Arrays.asList(new ContextMenuItem("Update count", "updateCount"));
  }

  @Component private Zone testZone;

  @OnEvent(value="updateCount")
  Object contextMenuAction() {
    count++;
    return testZone.getBody();
  }
}
---------------------------------

Thanks in advance,
Robin



--
Dr Robin Garner
Technology Services
Southern Cross University
P: +61 2 6620 3281   M: +61 418 619 500
http://cs.anu.edu.au/people/robin.garner/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to