| Summary: | SapphireListControlledPageBook fails to render with model path for control property | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Greg Amerson <gregory.amerson> | ||||
| Component: | Sapphire | Assignee: | Konstantin Komissarchik <konstantin> | ||||
| Status: | CLOSED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | konstantin | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Greg Amerson
I setup a simple repro of this and its working for me, so we are missing some aspect of your setup that isn't captured in this bug. Could you either (a) put together a complete repro project based on your app or (b) step through SapphireListControlledPageBook.findPropertyEditor() method to see if the cause of the problem becomes apparent? Hey Konstantin,
Here is a fuller look at my SDEF so you can maybe see why this is happening.
So in this case the PageBook control is the <property>../PortalPropertiesOverrides</property> for the <list-selection-controller>
In SapphireListControlledPageBook render() call, line 156, when it calls findPropertyEditor it passes in context.getPart(), which context.getPart() is returning the <with> directive at the very top of this snippet of heirarchy. So the recursive calls of findPropertyEditor is never able to find the <property>../PortalPropertiesOverrides</property> editor part.
I changed that line to use "this" instead of "context.getPart()" and that worked in my scenario, the findPropertyEditor() was able to find the propertyEditor correctly.
<node>
<id>PortalPropertiesNode</id>
<label>Portal Properties</label>
<section>
<content>
<with>
<path>PortalPropertiesFile</path>
<panel>
<key>IPortalPropertiesFile</key>
<content>
<property-editor>
<property>Value</property>
</property-editor>
<separator></separator>
<property-editor>
<property>../PortalPropertiesOverrides</property>
<hint>
<value>DefaultListPropertyEditorRenderer$Factory</value>
<name>factory</name>
</hint>
</property-editor>
<separator>
<label>Details</label>
</separator>
<switching-panel>
<list-selection-controller>
<property>../PortalPropertiesOverrides</property>
</list-selection-controller>
<panel>
<key>IPortalProperty</key>
<content>
<property-editor>
<property>Name</property>
<label>Override Name</label>
</property-editor>
<property-editor>
<property>Value</property>
<label>Override Value</label>
</property-editor>
</content>
</panel>
<default-panel>
<content>
<label>Select a portal property item above to view or edit additional parameters.</label>
</content>
</default-panel>
</switching-panel>
</content>
</panel>
<label>Customize Liferay Portal Properties</label>
</with>
</content>
</section>
final PropertyEditorPart listPropertyEditorPart = findPropertyEditor( this, this.element, this.property );
It looks like you found the problem. Using context.getPart() isn't appropriate here. The intention is to start searching with the current part. Why don't you attach a patch for the fix so that you can be properly credited with fixing this issue... Created attachment 214504 [details]
Patch v1
Sure thing, here is a patch
Thanks! Patch merged. Please verify. Verified from CVS. Closing. |