Where can I configure events to refresh the content views designed in nuxeo studio?

I have designed a content view in my nuxeo studio and I want to define an event to refresh it when I create a document in another custom view, the created document only is showed in my content view when I do click the content view refresh button. I want to create a event and configure my content view with this event for refresh it automatically.

I have developed a view with my custom method: createDocument in a seam action and sent a event documentCreatedAnotherView but in my nuxeo studio I dont know where can I configure this event inside my content view.

0 votes

1 answers

2605 views

ANSWER



Hi,

This cannot be configured directly in Studio interface for now, but you can add an “XML extension” feature with a configuration similar to:

<extension target="org.nuxeo.ecm.platform.ui.web.ContentViewService" point="contentViews">
  <contentView name="myContentView">
    <refresh>
      <event>documentChanged</event>
      <event>documentChildrenChanged</event>
      <event>documentCreatedAnotherView</event>
    </refresh>
  </contentView>
</extension>

Note that content views created via Studio do have the documentChanged and documentChildrenChanged events as refresh events by default, so if you create another document, you should probably send the documentChildrenChanged event on the container to benefit from other listeners to it.

1 votes



Thanks, I used this:

            Events.instance().raiseEvent(EventNames.DOCUMENT_CHANGED, doc);
            Events.instance().raiseEvent(EventNames.DOCUMENT_CHILDREN_CHANGED, doc);
07/17/2013