how to use tapestry component in JSP

2013-05-02 Thread Shuu Johnny
Now I face a trouble.
In a  project ,I need to Implement Tapestry 5 Autocomplete Mixin which can
be mixed in an ordinary TextField component.  so far. I couldn't find any
documents for this..
how could I use tapestry component in  ordinary JSP page ?

thanks in advance.
Johnny


tapestry 5.3.6 using autocomplete component problem

2013-05-01 Thread Shuu Johnny
When I want to do the tapestry autocomplete example, I face these trouble.

start-
An unexpected application exception has occurred.

Method
example.hellotapestry.pages.AutoCompleteComp.onProvideCompletionsFromCompInput(java.lang.String)
references component id 'CompInput' which does not exist.

---end---

the using tapestry version is 5.3.6.
the using jars is:

the java code is :

--start
package example.hellotapestry.pages;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;

public class AutoCompleteComp {


@Property
private String component;

private ListString components;


ListString onProvideCompletionsFromCompInput(String key) {

   ListString matches = new ArrayListString();

   IteratorString it=components.iterator();
   while (it.hasNext())
   {
   String element = it.next();
   if (element.startsWith(key))
   {
   matches.add(element);
   }
   }

   return matches;
  }


 public void pageLoaded(){

 components = new ArrayListString();
 components.add(AbstractField);

 }
}
--end
the tml is :
---start---
html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_3_6.xsd;
form 
input t:type=textfield type=input  t:value=component
  t:id=compInput t:mixins=autocomplete /
 /form
 /html
---end---

And when I remove t:mixins=autocomplete in

input t:type=textfield type=input  t:value=component
  t:id=compInput t:mixins=autocomplete /

and comment out the method  onProvideCompletionsFromCompIn
put(String key)  in Java code.
Then  run the application, the testField could be rendered well.
 It seems the autocomplete don't work.

Have I missed on something here?

Thanks in advance.

/Johnny