Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Mapping XSD elements to custom form components

Avatar

Level 3

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

1 Accepted Solution

Avatar

Correct answer by
Employee

Yes you can achieve this by simply do it by dragging dropping you custom component from side kick and then giving correct bindRef (for putting bindRef -  open the edit dialog of the component , navigate to the script tab) to the component just dropped.

bindRef for element/attribute can be seen by double clicking the element/attribute in the data model hierarchy. Just copy paste the same in the bindRef field of the edit dialog. 

View solution in original post

7 Replies

Avatar

Correct answer by
Employee

Yes you can achieve this by simply do it by dragging dropping you custom component from side kick and then giving correct bindRef (for putting bindRef -  open the edit dialog of the component , navigate to the script tab) to the component just dropped.

bindRef for element/attribute can be seen by double clicking the element/attribute in the data model hierarchy. Just copy paste the same in the bindRef field of the edit dialog. 

Avatar

Level 3

Thanks, i agree that we can use bind-ref but i would like to know how we can change mapping so that binding will be done automatically when we drag and drop from content finder.

 

Cheers,

Veearswami Kandregula

Avatar

Employee

This is no provision to register any new AF component against any of the element/attribute type right now.

Avatar

Level 7

Hi mandeep - This is a big feature for actual AEM Forms clients. The standard mapping of schema elements to foundation components is great for sales / demo purposes but in reality you will be extending the foundation components to customise them for each particular client project you will work with.

If AEM Forms are going to be created by end users and not developers (as it is being sold right now) then we need to be able to customise mappings for individual clients.

Thanks

Avatar

Employee

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

Avatar

Level 7

Hi Deepak - we intend to give the business custom components to suit the requirements for generating custom forms by using the normal AEM/CQ methodology of overriding AF foundation components to provide the extra/modified functionality to the custom component, thus keeping the existing infrastructure around prefill, submit, etc and maintaining backwards compatibility to foundation components. This is how normal AEM foundation components work and how we would expect all AF components to work.

The AEM 6.1 beta functionality looks very promising for us too (I am starting to review it now) however, this project is happening now and we need to use currently available GA functionality to enable business users to create forms within their organisation. I am not sure telling business users to apply custom CSS styles to enable custom widgets (that they cant see) will sit well with the business to be honest.

We want the ability to use XSD mapping to custom/overridden AF component idea as it sits well with what the business was sold (ie drag and drop functionality to create forms) which currently is not possible once we override the foundation components.

Avatar

Employee

There is alternate way to enable custom widget via guideBridge using css selector (which should returns field for which you want to enable the custom widget) at template level.

Most of the functionality in AEM Forms is achieved via javascript (due to the dynamic nature of scripting, prefill and submit which all uses js engine) instead of simple jsp (as in case of other AEM components which are mostly static). That's why I was asking what kind custom components you are looking for.

If you still want the XSD being mapped to custom AF component on 6.0, unfortunately that's not supported right now. You would to get in touch with Adobe Support to log enhancement request for that.