Re: search in container problem

Philippe Vollenweider <[email protected]>
Newsgroups gmane.comp.cms.jahia.template
Message-ID <[email protected]>
Hello,

You should construct a ContainerSearcher with something like this:

String searchQuery =
     request.getParameter(JahiaSearchConstant.CLIST_SEARCHQUERY_INPUT_PREFIX 
+ "contacts");
if (searchQuery != null && !"".equals(searchQuery.trim()) ){
         ContainerSearcher containerSearcher =
             new 
ContainerSearcher("contacts",jParams, 
searchQuery,jParams.getEntryLoadRequest());
         request.setAttribute("contacts_search_handler",containerSearcher);
}

Philippe.

At 07.11.2005 11:26, you wrote:

>Hello,
>
>I declare a container list of contacts and I 
>want t add search option but It seems not working.
>Can you help me?
>
><%@ include file="include/header.inc" %>
><content:declareContainerList
>  name="contacts"
>  title="Contacts"
>  titleKey="Contacts"
>  >
>  <content:declareContainer >
>
>   <content:declareField
>    name="nom"
>    title= "Nom"
>    titleKey= "Nom"
>    type= "SharedSmallText"
>    value=""
>   />
>   <content:declareField
>    name="prenom"
>    title= "Prenom"
>    titleKey= "Prenom"
>    type= "SharedSmallText"
>    value=""
>   />
>
>   <content:declareField
>    name="adresse"
>    title= "Adresse"
>    titleKey= "Adresse"
>    type= "SmallText"
>    value=""
>   />
>
>   <content:declareField
>    name="telephone"
>    title= "Telephone"
>    titleKey= "Telephone"
>    type= "SmallText"
>    value=""
>   />
>
>   <content:declareField
>    name="mail"
>    title= "Mail"
>    titleKey= "Mail"
>    type= "SharedSmallText"
>    value=""
>   />
>   <content:declareField
>    name="categorie"
>    title= "Categorie"
>    titleKey= "Categorie"
>    type= "SharedSmallText"
>    value="<jahia_multivalue[Ami:Famille:Professionnel]>"
>   />
>
>  </content:declareContainer>
></content:declareContainerList>
>
>
><table width="100%">
>  <tr><td valign="top" width=10%><%@ include 
> file="include/left_menu.inc" %></td>
>   <td width=5%></td>
>   <td align=left>
>    <h1><%@ include file="include/page_title.inc"%></h1></td><td width=20%>
>   </td>
>  </tr>
>  <tr>
>   <td width=10%></td>
>   <td width=5%></td>
>   <td width=80%>
>
>    <table width="100%" border=1>
>     <content:jahiaPageForm name="myForm">
>     <content:containerList name="contacts" 
> id="contactsContainerList" windowSize="5">
>     <tr><td>
>      <jahiaHtml:actionMenu 
> name="contactsContainerList" namePostFix="" 
> resourceBundle="jahiatemplates.Corporate_portal_templates" 
> useFieldSet="false" actionIcon='<%=theURL + 
> "/images/add.gif"%>' labelKey="addPeople">
>      </jahiaHtml:actionMenu></td>
>     </tr>
>     <tr>
>      <td align="left" 
> valign="top"><b><jahia:resourceBundle 
> resourceBundle="jahiatemplates.Corporate_portal_templates" 
> resourceName="search"/> : </b></td>
>      <td>
>       <input type="text" 
> name="<content:ctnListSQueryInputName/>" 
> value="<content:ctnListSQueryInputValue/>" 
> size="30" /><a 
> href="javascript:document.myForm.submit()"><img 
> src="<jahia:contextURL/>/images/search.gif" 
> alt="" width="15" height="15" border="0" align="middle"/></a>
>      </td>
>     </tr>
>     <th class="boxtitletransparent" width=15%>Nom&#160;</th>
>     <th class="boxtitletransparent" width=10%>Prénom</th>
>     <th class="boxtitletransparent" width=20%>Adresse</th>
>     <th class="boxtitletransparent" width=10%>Téléphone</th>
>     <th class="boxtitletransparent" width=15%>Mail</th>
>     <th class="boxtitletransparent" width=15%>Catégorie</th>
>     <th width=15%></th>
>      <content:container  id="contactContainer">
>       <content:textField  valueId="nomBean" 
> name='nom'  display="false" defaultValue=""/>
>       <content:textField  valueId="nomBean1" 
> name='prenom'  display="false" defaultValue=""/>
>       <content:textField  valueId="nomBean2" 
> name='adresse'  display="false" defaultValue=""/>
>       <content:textField  valueId="nomBean3" 
> name='telephone'  display="false" defaultValue=""/>
>       <content:textField  valueId="nomBean4" 
> name='mail'  display="false" defaultValue=""/>
>       <content:textField  valueId="nomBean5" 
> name='categorie'  display="false" defaultValue=""/>
>
>       <tr><td><bean:write name="nomBean" filter="true"/></td>
>       <td><bean:write name="nomBean1" filter="true"/></td>
>       <td><bean:write name="nomBean2" filter="true"/></td>
>       <td><bean:write name="nomBean3" filter="true"/></td>
>       <td><bean:write name="nomBean4" filter="true"/></td>
>       <td><bean:write name="nomBean5" filter="true"/></td>
>       <td>
>       <jahiaHtml:actionMenu
>        name="contactContainer"
>        namePostFix=""
>        resourceBundle="jahiatemplates.Corporate_portal_templates"
>        useFieldSet="false" 
> actionIcon='<%=theURL + "/images/update.gif"%>' labelKey="update">
>       </jahiaHtml:actionMenu></td>
>       </tr>
>      </content:container>
>      </content:containerList>
>     </content:jahiaPageForm>
>    </table>
>   </td>
>   <td width=10%></td>
>  </tr>
></table>
><%@ include file="include/footer.inc" %>
>
>
>No virus found in this incoming message.
>Checked by AVG Anti-Virus.
>Version: 7.1.362 / Virus Database: 267.12.8/162 - Release Date: 05.11.2005

-------=[ pvollenweider at jahia dot com ]=---------
Jahia : A collaborative source CMS and Portal Server
www.jahia.org Community and product web site
www.jahia.com Commercial services company
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.