[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
AutoComplete is not working  XML
Forum Index -> Development
Author Message
tdrasch

Power User
[Avatar]

Joined: 13/03/2009 19:09:45
Messages: 81
Location: Villingen-Schwenningen
Offline

Hi Community,

I added an autocomplete component on my grid column.
But, it is not working.

Does someone have an idea?

Code:
 public class HttpXmlInterfaceUI extends InteractionUI implements Serializable{
 
 public class NameAutoCompleteProvider extends DefaultAutoCompleteProvider
     {
         public List<String> getProposals(String currentText)
         {
 //            // simulate some waiting time...
 //            try
 //            {
 //                Thread.currentThread().sleep(3000);
 //            }
 //            catch (Throwable t)
 //            {
 //            }
             List<String> result = new ArrayList<String>();
             if ("CaptainCasa".equalsIgnoreCase(currentText))
             {
                 result.add("CaptainCasa");
                 result.add("CaptainCasa Enterprise Client");
                 result.add("CaptainCasa Corporate Community");
                 result.add("CaptainCasa GmbH");
             }
             else if ("JSF".equalsIgnoreCase(currentText))
             {
                 result.add("JSF - Java Server Faces");
                 result.add("JSF - CaptainCasa Utilization");
                 result.add("JSF - Server Side UI Standard");
                 result.add("JSF - Some German Umlaute: üüü");
                 result.add("JSF - This is a Euro: €");
             }
             else if ("Müller".equalsIgnoreCase(currentText))
             {
                 result.add("Müller, Björn");
                 result.add("Müller, Karl");
             }
             return result;
         }
     }
 ...
 	protected NameAutoCompleteProvider m_nameAC;
 	protected String m_name;
 
     public String getNameACURL() { return m_nameAC.getURL(); }
     public String getName() { return m_name; }
     public void setName(String value) {m_name = value;}
 	
 	public HttpXmlInterfaceUI(IWorkpageDispatcher dispatcher) {
 		super(dispatcher);
 		try 
 		{
 m_nameAC = new NameAutoCompleteProvider();
 	        AutoCompleteMgr.add(m_nameAC);
 	        // register clearing of "m_nameAC"
 	        this.getOwningDispatcher().getWorkpage().addLifecycleListener(new WorkpageDefaultLifecycleListener() 
 	        {
 	            public void reactOnDestroyed()
 	            {
 	                super.reactOnDestroyed();
 	                AutoCompleteMgr.remove(m_nameAC);
 	            }
 	        });
 }
     	catch (Exception ex) 
 ...
 


Code:
 <t:gridcol id="g_77" text="Column" width="100" >
 <t:autocomplete id="g_78" flush="true" popupwidth="250" value="#{d.HttpXmlInterfaceUI.name}" valuesurl="#{d.HttpXmlInterfaceUI.nameACURL}" />
 </t:gridcol>
 


By adding "CaptainCasa" there is no roundtrip to the server.
By using the example code on the CC Demo Workplace it is working fine.

Thanks in advance

--------------------------------
Good karma - for the moment...
why is the word abbreviation so long?
[WWW]
Admin

Power User

Joined: 21/11/2007 11:36:10
Messages: 37
Offline

Hi,

please check you we.xml - there is an "AutoCompleteServlet" registered (two places: the serverlet and the mapping). Please compare to the web.xml_templat in the same directory.

Regards, Björn

PS: AUTOCOMPLETE is not supported with Android so far!
tdrasch

Power User
[Avatar]

Joined: 13/03/2009 19:09:45
Messages: 81
Location: Villingen-Schwenningen
Offline

Hi Björn,

thats it!
Thank you very much again!

With best regards...

--------------------------------
Good karma - for the moment...
why is the word abbreviation so long?
[WWW]
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team