Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sapphire-dev] New topic in forum Sapphire, called Sorted Node Factory, by Hazem ELRAFFIEE

Title: Eclipse Community Forums
Subject: Sorted Node Factory Author: Hazem ELRAFFIEE Date: Thu, 26 June 2014 08:41
Hello Smile

Let's say I have the following XML:

<salaries>
    <employee name="name1" salary="1000" />
    <employee name="name2" salary="2000" />
    <employee name="name3" salary="4000" />
    <employee name="name4" salary="2500" />
    <employee name="name5" salary="1500" />
    <employee name="name6" salary="1100" />
    <employee name="name7" salary="2300" />
</salaries>


Normally I would create a Node Factory for that like this:

<node-factory>
    <property>Employees</property>
    <case>
        <section>
            <content>
                <property-editor>Name</property-editor>
                <property-editor>Salary</property-editor>
            </content>
        </section>
        <label>${ Name == null ? &quot;UnNamed&quot; : Name }</label>
    </case>
</node-factory>


But then the employees will be viewed with the order they are in the XML. What if I want them to be viewed sorted by salary for example? or by name?
[ Reply ][ Quote ][ View Topic/Message ][ Unsubscribe from this forum ]

Back to the top