AboutSupportDeveloper GuideVersion 47.154.100.2
OpenFin JavaScript API
    Preparing search index...

    Class ViewModule

    Static namespace for OpenFin API methods that interact with the View class, available under fin.View.

    Hierarchy

    • Base
      • ViewModule
    Index
    • get me(): Identity

      Returns Identity

      me should only be accessed from the fin global (FinApi.me); access through entity classes is not guaranteed to behave sensibly in all calling contexts.

    • Experimental

      Creates a new View.

      Parameters

      Returns Promise<View.View>

      let view;
      async function createView() {
      const me = await fin.Window.getCurrent();
      return fin.View.create({
      name: 'viewNameCreate',
      target: me.identity,
      bounds: {top: 10, left: 10, width: 200, height: 200}
      });
      }

      createView()
      .then((createdView) => {
      view = createdView;
      console.log('View created.', view);
      view.navigate('https://google.com');
      console.log('View navigated to given url.');
      })
      .catch(err => console.log(err));

      Note that created views needs to navigate somewhere for them to actually render a website.

    • Experimental

      Asynchronously returns a View object that represents the current view

      Returns Promise<View.View>

      fin.View.getCurrent()
      .then(view => console.log('current view', view))
      .catch(err => console.log(err));
    • Experimental

      Synchronously returns a View object that represents the current view

      Returns View.View

      const view = fin.View.getCurrentSync();
      console.log(view);
    • Experimental

      Asynchronously returns an API handle for the given View identity.

      Parameters

      Returns Promise<View.View>

      Wrapping a View identity that does not yet exist will not throw an error, and instead returns a stub object that cannot yet perform rendering tasks. This can be useful for plumbing eventing for a View throughout its entire lifecycle.

      fin.View.wrap({ uuid: 'testViewUuid', name: 'testViewName' }))
      .then(view => console.log('wrapped view', view))
      .catch(err => console.log(err));
    • Experimental

      Synchronously returns an API handle for the given View identity.

      Parameters

      Returns View.View

      Wrapping a View identity that does not yet exist will not throw an error, and instead returns a stub object that cannot yet perform rendering tasks. This can be useful for plumbing eventing for a View throughout its entire lifecycle.

      const view = fin.View.wrapSync({ uuid: 'testView', name: 'testViewName' });
      await view.hide();