AEM 6.2 Forms and element id's. | Community
Skip to main content
roberth55706517
Level 4
August 9, 2016

AEM 6.2 Forms and element id's.

  • August 9, 2016
  • 1 reply
  • 7912 views

I'm noticing that in 6.2, the binding that is built for the form items doesn't match the id of the items. When I use the id returned by calling var anId = $(this).parents('.guideFieldNode').data('guideViewBind') then take the returned id and then call guideBridge._resolveId( anId ), it does not find the element. The id for the element in the page does not match the id created in the guideBridge._guide._modelTemplateCasheStore._modelIdCache list of items. 

When the components are built in the JSP page, the binding is done using the ${guideid} variable. This id is very different that the id that is in the cache. 

Any idea what I need to do in order to fix this?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

roberth55706517
Level 4
August 10, 2016

The id of the HTML element from ${getid}:

guideContainer-rootPanel-fragmentPanel-contact-fullLegalName-first___

The id in the guide store:
guideContainer-rootPanel-your-info-contact-contact-fragmentPanel-contact-fullLegalName-first__
 

Why don't they just use the same method to generate both id's so you can match them up?

Adobe Employee
August 11, 2016

This is a special case for fragments and hence you are seeing different Ids. Consider the case where you drop a fragment twice in the form side by side, as per the jsp code, the id would become the same and it would be difficult for the runtime to differentiate between the two. So in the case of fragments we change the id when fragment is loaded. 

Also this logic is internal to Adaptive Form and can be changed anytime. It is not recommended to depend on the id to do anything. The recommended approach is to add a CSS Class via CSS Class Property in your Field Dialog and access that using the class selector.

Regards

Varun Dua

roberth55706517
Level 4
August 11, 2016

The problem is that there each item is on the form once. We hide and display fragments with javascript. The problem is with validation because the list of failed elements returned from the guideBridge validation method has ID's that don't exist on the page, you can't use the somExpression to resolve the element, and the _visible flag is always set to true even though the the elements are hidden. It is almost impossible to keep the form controls consistent with the guideBridge in this case. This is all so messy that it is hard to leverage adaptive forms for dynamic content.