Re: Disable filter and dynamic multilinguistic multivalue

"David Griffon" <[email protected]>
Newsgroups gmane.comp.cms.jahia.template
Message-ID <008e01c480c6$cc886fb0$0a01a8c0@rondoudou>
>Ok for the dynamic multilinguistic multivalue. It is so sad... I will try 
>to solve it myself. I guess I should modify >the 
>/jsp/jahia/engines/shared/smalltext_field.jsp file.

Hello, i find a way to use dynamic multilinguistic multivalue in the
directory people template .. it is not the best .. but it works !


i use the resource bundle to define my  multilingual values of my items
in the global.inc
i define a new vector for each filters :
    Vector typeVector = new Vector(); // used for filters
    Vector typeVectorTrad = new Vector(); // used for Translation

in the filter include (witch are included where is the left menu) i add
 String TypeTrad = getResourceBundle (typeValue,typeValue,jData);

that gives me the translation of my values
then i add it to the vector for a futur use
typeVectorTrad.add(ImplTypeTrad);
and i print it to show the list ..
 %> - <%=TypeTrad%><%

then the <select> section of my filter (in the list) looks like :
     <select >
                        <%
            Enumeration typeEnum= typeVector.elements();
            Enumeration typeEnumTrad= typeVectorTrad.elements();
            while (typeEnum.hasMoreElements()) {
                String myType = (String) typeEnum.nextElement();
                String myTypeTrad = (String) typeEnumTrad.nextElement();
                %><option value="<%=myType%>" <% if
(seltype.equals(myType)){%>selected<% }%>><%=myTypeTrad%></option><%
            }
            %>
        </select>
(you can do a better condition test by testing the two lists with
hasMoreElements() .. but i do it fast ..)

and if you need to print any translated version of the value you can use
that
 String TypeTrad = getResourceBundle (typeValue,typeValue,jData);

I hope it helps you.

David Griffon
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.