Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 377329

Summary: SapphireListControlledPageBook fails to render with model path for control property
Product: z_Archived Reporter: Greg Amerson <gregory.amerson>
Component: SapphireAssignee: 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 Flags
Patch v1 konstantin: iplog+

Description Greg Amerson CLA 2012-04-21 01:46:40 EDT
Previously a SapphireListControlledPageBook could support control properties that were model paths, e.g. (../SomeProperty) 

Now with the changes stemming from bug 358295 this no longer works. 

Here is the snippet from one of my editors that is now showing this issue:

<switching-panel>
    <list-selection-controller>
        <property>../PortalPropertiesOverrides</property>
    </list-selection-controller>
    <panel>
    ...
    </panel>
</switching-panel>
Comment 1 Konstantin Komissarchik CLA 2012-04-24 13:50:38 EDT
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?
Comment 2 Greg Amerson CLA 2012-04-24 20:54:28 EDT
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 );
Comment 3 Konstantin Komissarchik CLA 2012-04-24 23:17:21 EDT
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...
Comment 4 Greg Amerson CLA 2012-04-24 23:37:37 EDT
Created attachment 214504 [details]
Patch v1

Sure thing, here is a patch
Comment 5 Konstantin Komissarchik CLA 2012-04-24 23:44:57 EDT
Thanks! Patch merged. Please verify.
Comment 6 Greg Amerson CLA 2012-04-24 23:52:01 EDT
Verified from CVS.
Comment 7 Konstantin Komissarchik CLA 2012-04-24 23:52:28 EDT
Closing.