0

Is AlloyUI Form Builder works for liferay 6.0.5. Because our site works on Liferay 6.0.5 and we can't update it with the latest version. I have placed the code mentioned in alloyui.com. I can drag and drop the fields but I can't submit the form. There is a script error in firebug M.loaded[n], I didn't understand what to do.

Suggest something on this. I am using the below code in liferay 6.0.5 jsp pages

<script src="http://cdn.alloyui.com/3.0.0/aui/aui-min.js">
<link href="http://cdn.alloyui.com/3.0.0/aui-css/css/bootstrap.min.css" rel="stylesheet"></link>

<div id="myFormBuilder"></div>

<script>
    YUI().use(
  'aui-form-builder',
  function(Y) {
    new Y.FormBuilder(
      {
        availableFields: [
          {
            iconClass: 'form-builder-field-icon-text',
            id: 'firstName1',
            label: 'First Name',
            readOnlyAttributes: ['name'],
            type: 'text',
            //unique: true,
            width: 75
          },
          {
            iconClass: 'form-builder-field-icon-text',
            id: 'lastName',
            label: 'Last Name',
            readOnlyAttributes: ['name'],
            type: 'text',
            //unique: true,
            width: 75
          },
          {
            iconClass: 'form-builder-field-icon-text',
            id: 'preferredName',
            label: 'Preferred Name',
            readOnlyAttributes: ['name'],
            type: 'text',
            //unique: true,
            width: 75
          },
          {
            iconClass: 'form-builder-field-icon-text',
            id: 'emailAddress',
            label: 'Email Address',
            readOnlyAttributes: ['name'],
            type: 'text',
            //unique: true,
            width: 75
          },
          {
            iconClass: 'form-builder-field-icon-radio',
            label: 'Gender',
            options: [
              {
                label: 'Male',
                value: 'male'
              },
              {
                label: 'Female',
                value: 'female'
              }
            ],
            type: 'radio'
          },
          {
            iconClass: 'form-builder-field-icon-button',
            label: 'Button',
            type: 'button'
          },
        ],
        boundingBox: '#myFormBuilder',
        fields: [
          {
            label: 'City',
            options: [
              {
                label: 'Ney York',
                value: 'new york'
              },
              {
                label: 'Chicago',
                value: 'chicago'
              }
            ],
            predefinedValue: 'chicago',
            type: 'select'
          },
          {
            label: 'Colors',
            options: [
              {
                label: 'Red',
                value: 'red'
              },
              {
                label: 'Green',
                value: 'green'
              },
              {
                label: 'Blue',
                value: 'blue'
              }
            ],
            type: 'radio'
          }
        ]
      }
    ).render();
  }
);
</script>
Revathi
  • 9
  • 3

1 Answers1

1

It is NOT possible to use the aui-form-builder in Liferay 6.0.

According to the Liferay Integration wiki article, Liferay 6.0 uses AlloyUI 1.0.3. After searching the source in the AlloyUI 1.0.3 tag, it seems like the aui-form-builder did not exist in that version. As far as I can tell from the API docs, aui-form-builder was added in the 2.0.x version.

Note: it is not possible to upgrade to a new major version of AlloyUI in Liferay either.

stiemannkj1
  • 4,418
  • 3
  • 25
  • 45
  • Thank you for your suggestion. Is there any other way that I can implement form builder in liferay. – Revathi Nov 27 '14 at 05:35
  • 1
    @Revan, the only way that I can think of, without rewriting `aui-form-builder` from scratch, would be to find all of it's dependencies in the new version AlloyUI and copy/create them and `aui-form-builder` for the old version of AlloyUI. You can look into [Building Your Own Widget Library with YUI](http://www.yuiblog.com/blog/2008/06/24/buildingwidgets/) for help with that kind of thing, but it seems like it would be far more trouble than it's worth. Also please accept my answer if it has answered your question. – stiemannkj1 Nov 29 '14 at 05:37