Mapping XSD elements to custom form components

Veera_kandregul

15-10-2015

Hi All,

We are creating AEM form based on our XSD schema and we found that xsd schema elements (like xs:string, xs:date) are mapping beautifully to OOTB form components when dragging and dropping from content finder, ex:. xs:string to Text box components.

https://helpx.adobe.com/aem-forms/6/adaptive-form-xml-schema-form-model.html#Using%20an%20XML%20sche...

Can you tell us how we can change this mapping so that XSD elements will get binded to our custom form components (say text-image) when we drag and drop?

Also, if we have two 'text' form components (say text1 and text2 components) , how can we do mapping so that xs:string element will map to specific component (say text1 component)?

 

Thank you,

Veeraswami Kandregula

View Entire Topic

deepak_k_

Employee

15-10-2015

Hi Darren,

What kind of customization you are looking for in terms of components. Is it about data capture experience: for example instead of using textbox for numeric field you want to use numeric stepper for that? if that is the case, you should take a look at custom widget story of Adaptive Forms  : http://blogs.adobe.com/experiencedelivers/experience-management/aem-forms-using-custom-widget-adapti.... This would allow you to customize Adaptive Form components and still leverage the all existing infrastructure around the Form components like: Prefill, Submit, Save, Dynamic scripting etc.

Plus, in 6.1, we are adding feature for Adaptive Form Fragments which allows you to create re-usable composite components which authored once, can be reused across multiple forms. And if your schema is modular enough, then when you drag the components from content finder tab, it would automatically bind to correct fragment that you have already created.

For example, if you have a common XSD schema for Address. You create Adaptive Fragment out of that schema which uses google map component to capture address (or show look ahead address as suggestions) using the above mentioned custom widget infrastructure. You also apply any other scripting rules or property tweaking for the field components you have used in that Fragment. Now you have a uber employee schema which has two address type sections: homeAddress, businessAddress, both of which map to common XSD complexType Address, for which you already created Fragment. Now if you try to drag the Employee schema or addresses from content finder tab onto form, those would automatically map to the custom Address fragment that you created in earlier step and you won't have to do anything further. 

Thus Adaptive Fragment (when used in combination of Custom widgets) would allow you to create really cool Reusable Composite Components (with a lot of power in hands of Author instead of developer as Author can create and manage Fragment using Form Manager UI) which can live as first class citizen in Forms echo system without breaking any functionality (like prefill, submit, scripting etc). And Darg Drop from Content Finde Form Hierarchy Tab would automatically be taken care to auto map the the Form Hierarchy components to the already authored Adaptive Fragment. You should really try that on AEM Forms 6.1 Beta build and provide us the feedback what you like or not like.

Deepak