Hi, I would like to explain a little problem with OFBiz convert where I don't found a clean solution.

To start : a search form with a multiple drop-down that call a perform service with an attribute List
the form :
<field name="partyClassificationGroupId">
<drop-down allow-multiple="true" size="20" allow-empty="true">...

the service :
<service ...>
<attribute name="partyClassificationGroupId" type="List" mode="IN" optional="true"/> ...

When I execute the research, the service get the list but the paginate lost it. On the queryString the list is encoded like this : "{element1, element2}", but the service use Converter class to load it and search : "[element1, element2]".

The queryString is encoded by UtilHttp.urlEncodeArgs :
if (value instanceof String) {
valueStr = (String) value;
} else {
valueStr = value.toString();
}
which generate "{element1, element2}"

And converter StringToList :
if (obj.startsWith("[") && obj.endsWith("]")) {
return StringUtil.toList(obj);

Other point, converter ListToString use also value.toString();

Do you think it is better to extend StringToList to support "{}" or to correct encode and convert process to use "[]" ?

Nicolas


-- Nicolas MALIN Consultant Tél : 06.17.66.40.06 Site projet : http://www.neogia.org/ ------- Société LibrenBerry Tél : 02.48.02.56.12 Site : http://www.librenberry.net/

Reply via email to