Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sapphire-dev] updating display text based on model

Hi all,

I have a UI I'm working where I need a label or textbox at the bottom of my dialog that will display a string based that is computed based on the current values in the model.  As properties in the model change, I would like this display string to be recomputed and redisplayed as text.  I have not been able to figure out how to do this.  In my model I have a value property where I specify a custom value binding to be computed and then I put a propertyEditor on this property in the UI.  The custom property is read once and displayed in the UI the first time but I don't know how to get sapphire to re-render this property based on model changes.  Is this possible with Sapphire?

So this leads me to a second problem.  Since I didn't know how to solve this with my first approach, I decided to try to add a custom part to the UI.  With this custom SapphirePart I could just render a Label and then add a model listener and listen for property changes and update the label text accordingly.  However, I ran into problems trying to specify a custom part.  I added the Custom part and listed the new of the CustomSapphirePart.class in the sdef like this:

<composite>
                <content>
                    <custom>
                        <class>TagSourcePreviewPart.class</class>
                    </custom>
                </content>
            </composite>


However this doesn't seem to work as it can't find this class.  I debugged the code and it seems that there is no ReferenceService registered to be able to resolve the class.  Any help on how to specify custom sapphire parts would be appreciated.

Thanks in advance to whoever has time to help out with my questions.

--
Greg Amerson
Liferay, Inc.

East Coast Symposium 2011

May 10-11, 2011

Register today:  www.liferay.com/ECS2011

New! Attend Portal Administrator Training Express or Building Themes in Liferay on May 9 at the same location as ECS!



Back to the top