Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name prefix for DialogFieldSet produces wrong names for fields in Touch UI #51

Open
pete-by opened this issue Oct 25, 2016 · 1 comment

Comments

@pete-by
Copy link

pete-by commented Oct 25, 2016

I have a complex field declared in a component's model:

@DialogField @DialogFieldSet(namePrefix = "ctaButton/", title = "CTA Button", collapsible = true) @Optional @Inject private CtaButton ctaButton;

This class has fields declared like:

`@Model(adaptables = Resource.class )
public class CtaButton implements JacksonSerializable {

@DialogField(fieldLabel="Visible", fieldDescription = "Check to make CTA Button visible")
@CheckBox(inputValue = "true", title = "Visible", text = "Check to make CTA Button visible")
@Inject @Optional
private Boolean visible = false;
   ...

}
`

Note, that name is not specified explicitly. Generated XML for the Classic UI is OK:

<visible allowBlank="{Boolean}true" checked="{Boolean}false" disabled="{Boolean}false" fieldDescription="Check to make CTA Button visible" fieldLabel="Visible" hideLabel="{Boolean}false" inputValue="true" jcr:primaryType="cq:Widget" name="./ctaButton/visible" xtype="checkbox"/>
For Touch UI:

<visible cq:hideOnEdit="{Boolean}false" cq:showOnCreate="{Boolean}true" disabled="{Boolean}false" fieldDescription="Check to make CTA Button visible" fieldLabel="Visible" jcr:primaryType="nt:unstructured" name="ctaButton/" renderReadOnly="{Boolean}true" required="{Boolean}false" sling:resourceType="granite/ui/components/foundation/form/checkbox" text="Check to make CTA Button visible" title="Visible"/>

Note, that 'visible' is not appended to 'ctaButton/' and there is no leading './'. However, name is set properly when there is no namePrefix in DialogFieldSet but values are then stored on upper level which is not always desired.
Workaround is to specify the field name explicitly, like:
name='./visible'

Tried with 4.1.2 and cloned from develop branch.

@ak8458
Copy link

ak8458 commented Jan 25, 2019

@pete-by was there any workaround for this issue? This is still an issue on the latest com.icfolson.aem.library V 11.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants