[Tapestry5] tapestry5 使用autocomplete问题

zhouye19 2013-04-30
Hi,大家好。我在做个项目上tapestry5 autocomplete 改造的时候,碰到了这个问题。 我做了一个demo测试
java代码是:
public class AutoCompleteComp {


@Property
private String component;

private List<String> components;

List<String> onProvideCompletionsFromName(String key) {
        List<String> matches = new ArrayList<String>(); 
            
           Iterator<String> it=components.iterator(); 
           while (it.hasNext()) 
           { 
               String element = it.next(); 
               if (element.startsWith(key)) 
               { 
                   matches.add(element); 
               } 
           } 
            
           return matches; 
}
}

tml 代码是:
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3_0.xsd">
<t:form t:id="loadForm">
<t:textfield t:id="name" t:mixins="autocomplete" />
<t:submit value="确定" />
</t:form>
</html>

tapestry版本是 5.3.6, 在访问页面的时候, 出现如下错误:
An unexpected application exception has occurred.
Method example.hellotapestry.pages.AutoCompleteComp.onProvideCompletionsFromName(java.lang.String) references component id 'Name' which does not exist.

请大家帮忙!谢谢!
我是鱼饵 2013-07-17
id不应该是component吗?
superaxis 2013-08-01
onProvideCompletionsFromname

n小写
Global site tag (gtag.js) - Google Analytics