icfnext / cq-component-maven-plugin

Other
22 stars 35 forks source link

Unable to Add Width Property to PathField Widgets #8

Closed modeckimellett closed 10 years ago

modeckimellett commented 10 years ago

Use Case: PathFields inside MultiCompositeField (cq-library) must have their widths set manually as they do not auto adjust appropriately, especially when not on the first tab of the dialog.

The width property appears to only be available through additionalProperties in the DialogField annotation. However, when width is added there it is not reflected on fields with the PathField Annotation.

The following is written in the Java Annotations:

    @DialogField(fieldLabel = "Path", required = true, additionalProperties = {
                    @FieldProperty(name = "width", value = "230"),
            })
    @PathField(rootPath = PathConstants.PATH_CONTENT_START, showTitleInTree = true)
    private String path;

The resulting xml for this line looks like this:

<path allowBlank="{Boolean}false" escapeAmp="{Boolean}false" fieldLabel="Path" hideLabel="{Boolean}false" hideTrigger="{Boolean}false" jcr:primaryType="cq:Widget" name="path" parBrowse="{Boolean}false" rootPath="/content/" rootTitle="Websites" showTitleInTree="{Boolean}true" xtype="pathfield"/>

but I expected to see width="230" included. Note that there are other properties which may need to be included on PathFields using additionalProperties in the future.

kand commented 10 years ago

This issue appears to only effect the produced xml for certain components. For example, TextArea works properly, but Html5SmartImage and PathField do not.

Also, tested this in the most recent version (2.4.1)

michaelhodgdon commented 10 years ago

Can you confirm you are using the latest version. I know we have done bug fixes for this already.

Michael Hodgdon CITYTECH, Inc. 312.673.6433 x162 www.citytechinc.com mhodgdon@citytechinc.com

On May 16, 2014, at 3:31 AM, Andrew Kos notifications@github.com wrote:

This issue appears to only effect the produced xml for certain components. For example, TextArea works properly, but Html5SmartImage and PathField do not.

— Reply to this email directly or view it on GitHub.

modeckimellett commented 10 years ago

Hmm no we aren't. Sorry about that. I'll talk to my team about upgrading. Thank you!

kand commented 10 years ago

I had tested it previously with the most recent version unsuccessfully, but I just tested it again and it worked. Not sure if there was old data in the jcr or something.