Fórumok

[solved: not the best way] Get PortletPreferences in order?

thumbnail
yaragad from Spain, módosítva 12 év-val korábban

[solved: not the best way] Get PortletPreferences in order?

Junior Member Bejegyzések: 52 Csatlakozás dátuma: 2011.03.15. Legújabb bejegyzések
I have a portlet.xml where I define all the Portlet preferences:


<portlet-preferences>

		<preference id="1">
			<name>First</name>
			<value>value1</value>
		</preference>

		<preference id="2">
			<name>Second</name>
			<value>any value</value>
		</preference>

		<preference id="3">
			<name>Third</name>
			<value>any value 3</value>
		</preference>
                .........

</portlet-preferences>


The probel is when I get the PortletPreferences Map or the Enumerator, cause they are in disorder.
How to get them ordered like in XML file? Or... is possible to get the preference id, to order them manually?
thumbnail
yaragad from Spain, módosítva 12 év-val korábban

RE: Get PortletPreferences in order?

Junior Member Bejegyzések: 52 Csatlakozás dátuma: 2011.03.15. Legújabb bejegyzések
One solution is adding a second value and arrange it on java class.


<name> param1</name>
<value>defaultValue</value>
<value>1</value>

<name> param2</name>
<value>defaultValue2</value>
<value>2</value>


Should be an smart way, but it works XD