3

Is it possible to create a new adaptive form component in HTL/sightly or extend an existing component?

Basically just trying to create a dropdown component (or any other component) that populates its values from a java model and will be saved to crx repo when the form is submitted.

All current adaptive form components are written in jsp and I've already tried extending the GuideField class them and manage to populate a dropdown dynamically but on page load it displays this in the console and the submit button won't work.

guideRuntime.js:26192 TypeError: Cannot read property 'priority' of undefined
    at child.getAttribute (guideRuntime.js:26698)
    at child._addProperty (guideRuntime.js:30187)
    at child.<anonymous> (guideRuntime.js:30156)
    at en.js:576
sootballz
  • 31
  • 4
  • Do you have a `guideNodeClass` defined in the template of your component? The forms framework is kind of tightly coupled, and any new component needs to be extending from any of the existing components, otherwise you may notice some issues. And `guidenumericstepper` uses HTL instead of JSP. – rakhi4110 Oct 30 '18 at 09:40
  • I created a new java class X which extends GuideField which extends GuideNode. And X is included in the init.jsp. `` – sootballz Oct 31 '18 at 02:16
  • What is the value of the `guideNodeClass` property present in the `cq:template` node under your custom component? – rakhi4110 Oct 31 '18 at 21:50
  • customDropDownList i think it was originally guideDropDownList so I renamed it to match my component. I've tried renaming the guideNodeClass back to guideDropDownList and that allows the form to submit again but the dropdown values are empty after doing that. – sootballz Nov 02 '18 at 02:27

0 Answers0