Tinymce: Get values from all forms in a tabbed window

82 views Asked by At

I have the following code to a custom plugin that renders a popup window with one with filechooser and onw with input:

 const fileChooserTabContent = {
      type: 'textbox',
      subtype: 'file',
      label: 'Select some file',
      name: 'file',
      size: 40,
      height: '100px',
      /*eslint-disable */
      onchange: fileChangeValue
      /*eslint-enable */
    };

    const urlInput = {
      type: 'textbox',
      label: 'Insert a text',
      name: 'text',
      placeholder: 'Place the file Url here',
      size: 40,
      height: '100px',
    };

    ed.addButton('upload', {
      title: 'A popup window',
      text: '',
      icon: 'upload-icon',
      onClick() {
        ed.windowManager.open({
          title: 'A tab',
          bodyType: 'tabpanel',
          body: [
            {
              title: 'Blah Blah',
              type: 'form',
              items: [fileChooserTabContent],
            },
            {
              title: 'Text Blah Blah',
              type: 'form',
              items: [urlInput],
            },
          ],

          onsubmit: function (e) {
            console.log(e.data.text);
          },
        });
      },
    });

But when fill the form in the second tab with values I cannot retrieve any value from the form from the second tab. The only value I can retrieve is the one from the form in the first tab. Do you have any idea why?

0

There are 0 answers