1

I have some questions related to how to customize the Openfin window.

  1. How we can restrict to open multiple modules from Openfin Dock. Currently we can open a same browser from dock for multiple times and on each click it's multiple instance is created. How this befavior can be restricted?

  2. How we set a default size to a module so that whenever it is opened it opens with the size specified?

  3. When we use the concept of generate notification in openfin and add some buttons in it so how we can give the onClick event for that notification button? I tried to do so but it's not working.

    import { create, IndicatorColor, NotificationOptions, addEventListener as 
    addNotificationEventListener } from '@openfin/workspace/notifications';
    
    export const openFinNotification = () => {
    async function generateNotification() {
    const notification: NotificationOptions = {
    body: 'The hidden window has been launched.',
    buttons: [
     {
       title: 'Close Hidden Window',
       type: 'button',
       cta: false,
       onClick: {
         task: 'Close',
       },
     },
     {
       title: 'Show Hidden Window',
       type: 'button',
       cta: true,
       onClick: {
         task: 'Show',
       },
     },
    ],
    priority: 1,
    indicator: {
     color: IndicatorColor.GREEN,
     text: 'Hidden Window Loaded',
    },
    category: 'hidden',
    title: 'Hidden Window Loaded',
    template: 'markdown',
    };
    await create(notification);
    }
    
    return (
    <div>
     <div>
       <h3>Click button to generate Notification.</h3>
       <br />
       <button onClick={generateNotification} buttonText="Generate Notification" />
     </div>
     </div>
     );
     };
     export default openFinNotification;
    

0