You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Ma...@t-systems.com on 2015/02/16 18:47:14 UTC

Fill drop-down list from java service

Hi All,

I try to fill a drop-down list with values calculated in a java service.


<form name="myFormName" type="single">
        <actions>
                 <service service-name="myJavaService" result-map="myResultMap">
                        </service>
        </actions>
<field name="myfield" title="myFieldTitle"
<drop-down allow-empty="true" current-description="myDescription">
<list-options list-name="myListName" key-name="myKeyName" description="myValue"/>
</drop-down>
</field>
</form>

Can anyone help me with a java code-snippet or description showing the type and structure of the needed return value of my java service (value: myResultMap in the example).


Thanks & regards,

Markus




AW: AW: Fill drop-down list from java service

Posted by Ma...@t-systems.com.
I try without space and with explicit set of the myListName, but still the same problem.

Do you have a working example where you fill a drop-down list from java? If yes, can you please output the structure of your ${myResultMap}
in a field like this:

<field name="debug1" title="Debug"><text default-value="${resultMap}"/></field>

and post the content here.


-----Ursprüngliche Nachricht-----
Von: Nicolas Malin [mailto:nicolas.malin@nereide.fr] 
Gesendet: Montag, 16. Februar 2015 23:09
An: user@ofbiz.apache.org
Betreff: Re: AW: Fill drop-down list from java service

Le 16/02/2015 22:54, Markus.Rau@t-systems.com a écrit :
> 			<list-options list-name=" myResultMap.myListName" key-name="myKeyName" description="myValue"/>
You have a space at the beginning of your value " 
myResultMap.myListName" -> "myResultMap.myListName".
But if doesn't work try this :

<form name="myFormName" type="single">
	<actions>
        		 <service service-name="myJavaService" result-map="myResultMap"/>
                  <set field="myListName" from="myResultMap.myListName"/>
	</actions>
	<field name="myfield" title="myFieldTitle"
		<drop-down allow-empty="true" current-description="myDescription">
			<list-options list-name="myListName" key-name="myKeyName" description="myValue"/>
		</drop-down>
	</field>
</form>



Re: AW: Fill drop-down list from java service

Posted by Nicolas Malin <ni...@nereide.fr>.
Le 16/02/2015 22:54, Markus.Rau@t-systems.com a écrit :
> 			<list-options list-name=" myResultMap.myListName" key-name="myKeyName" description="myValue"/>
You have a space at the beginning of your value " 
myResultMap.myListName" -> "myResultMap.myListName".
But if doesn't work try this :

<form name="myFormName" type="single">
	<actions>
        		 <service service-name="myJavaService" result-map="myResultMap"/>
                  <set field="myListName" from="myResultMap.myListName"/>
	</actions>
	<field name="myfield" title="myFieldTitle"
		<drop-down allow-empty="true" current-description="myDescription">
			<list-options list-name="myListName" key-name="myKeyName" description="myValue"/>
		</drop-down>
	</field>
</form>



AW: Fill drop-down list from java service

Posted by Ma...@t-systems.com.
I tried your suggestion, but the drop-down field is still empty. 

The content of myResultMap looks like this:

{responseMessage=success, myResultMap={myListName=[[GenericEntity:myEntityName][myKeyName,key1(java.lang.String)][myValue,value1(java.lang.String)], [GenericEntity:myEntityName][myKeyName,key2(java.lang.String)][myValue,value2(java.lang.String)]]}}


<form name="myFormName" type="single">
	<actions>
       		 <service service-name="myJavaService" result-map="myResultMap">
        		</service>		
	</actions>  
	<field name="myfield" title="myFieldTitle"
		<drop-down allow-empty="true" current-description="myDescription">
			<list-options list-name=" myResultMap.myListName" key-name="myKeyName" description="myValue"/>
		</drop-down>
	</field>
</form>

I guess myResultMap doesn't fit to the expected structure of a <list-options ..> element. 


-----Ursprüngliche Nachricht-----
Von: Nicolas Malin [mailto:nicolas.malin@nereide.fr] 
Gesendet: Montag, 16. Februar 2015 19:10
An: user@ofbiz.apache.org
Betreff: Re: Fill drop-down list from java service

Le 16/02/2015 18:47, Markus.Rau@t-systems.com a écrit :
> <list-options list-name="myListName" key-name="myKeyName" description="myValue"/>
try this

<list-options list-name="myResultMap.myListName" key-name="myKeyName" description="myValue"/>




Re: Fill drop-down list from java service

Posted by Nicolas Malin <ni...@nereide.fr>.
Le 16/02/2015 18:47, Markus.Rau@t-systems.com a écrit :
> <list-options list-name="myListName" key-name="myKeyName" description="myValue"/>
try this

<list-options list-name="myResultMap.myListName" key-name="myKeyName" description="myValue"/>