Supporting Full Screen Display

The purpose of this example is to show how the integration between the page builder and a CHIP works.

This example does not show the implementation of the fullscreen contract.

Each ChipInstance has a fullscreen flag. If this flag is set, the respective CHIP is the only visible CHIP within the page builder, occupying all available space for CHIPs.

Both the page builder and the CHIP can get and set this flag. The page builder must ensure that it is set for one CHIP only. To do this, the page builder has to attach a listener at each of its ChipInstances, which is called when the fullscreen flag is changed.

      function onFullscreen(oChipInstance) {
        // TODO fullscreen handling
      }
      function onSuccess(oLayout, oPage) {
        var aChipInstances = oPage.getChipInstances(),
          i,
          n,
          oChipInstance,
          oTitleControl;
        for (i = 0, n = aChipInstances.length; i < n; i += 1) {
          oChipInstance = aChipInstances[i];
          oTitleControl = new sap.ui.commons.TextView({
            text: oChipInstance.getTitle()
          });
          oChipInstance.attachFullscreen(onFullscreen.bind(null, oChipInstance));
          oLayout.addContent(oTitleControl)
                 .addContent(oChipInstance.getImplementationAsSapui5());
        }
      }