As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
function searchDocument(value,qName,formName,listName) { alert('debut'); var set = search.luceneSearch("TEXT:cmoi"); alert('fin'); }
public class SearchBean { private NodeService nodeService; private static final Log logger = LogFactory.getLog(SearchBean.class); public void searchContent() throws IOException { FacesContext context = FacesContext.getCurrentInstance(); ResponseWriter out = context.getResponseWriter(); Map<?, ?> requestMap = context.getExternalContext().getRequestParameterMap(); String strQName = (String)requestMap.get("qname"); String strRequest = (String)requestMap.get("request"); … out.write('The result!'); } }
<managed-bean> <managed-bean-name>SearchBean</managed-bean-name> <managed-bean-class>myPackage.SearchBean</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> <managed-property> <property-name>nodeService</property-name> <value>#{NodeService}</value> </managed-property> </managed-bean>
function searchDocument(value,qName) { dojo.io.bind({ method: 'post', url: getContextPath() + '/ajax/invoke/SearchBean.searchContent', content: { qname : qName, request : value}, load: function handleInfo(type, data, evt) { /*La variable data contient tout ce que vous avez écrit dans le bean, il suffit de récupérer la liste, la nettoyer et la recompléter*/ }, error: handleErrorDojo, mimetype: 'text/html' }); };