The "getSuggestedItemsMethod" should instead match the attribute name.

Facelets works on a direct BeanProperty/Attribute -> TagAttribute within your 
document.  "foo" would automatically be wired to "setFoo(...)" on your 
UIComponent.

The documentation for InputSuggest specifies the attribute name to be:

"suggestedItemsMethod", that is the name you want to pass to the MethodRule:

MethodRule rule = new MethodRule("suggestedItemsMethod", List.class, new 
Class[]{String.class, Integer.class});

Hope this Works for you!

-- Jacob


>
>Hi Peter,
>
>I'm putting this on the facelets mailing list as this is where it is
>best discussed.
>
>From my limited knowledge of inputSuggestAjax, it looks like this
>should work (Does the bound method return a List or a Collection?  I
>couldn't tell.)
>
>The component handler below should add a rule so that the
>"getSuggestedItemsMethod" attribute string value is properly converted
>into a "List x(String, Integer)" method binding.
>
>Are you adding the class below as a tag handler for your
>inputSuggestAjax component tag in the taglib.xml file?
>
>On 12/16/05, Peter Mahoney (JIRA) <dev@myfaces.apache.org> wrote:
>>     [ 
>http://issues.apache.org/jira/browse/MYFACES-921?page=comments#action_12360603 
>]
>>
>> Peter Mahoney commented on MYFACES-921:
>> ---------------------------------------
>>
>> I am having problems implementing the component handler. I have started by 
>assuming the two argument method  version, but I do not get the MethodBinding 
>property set. Here is the code so far:
>>
>> public class InputSuggestAjaxHandler extends HtmlComponentHandler {
>>
>>         public InputSuggestAjaxHandler(ComponentConfig tagConfig) {
>>                 super(tagConfig);
>>         }
>>
>>         protected MetaRuleset createMetaRuleset(Class type)
>>     {
>>         MetaRuleset m = super.createMetaRuleset(type);
>>         m.addRule(getSuggestedItemsMethodRule());
>>
>>         return m;
>>     }
>>
>>         private MetaRule getSuggestedItemsMethodRule() {
>>                 MethodRule rule = new MethodRule("getSuggestedItemsMethod", 
>List.class, new Class[]{String.class, Integer.class});
>>
>>                 return rule;
>>         }
>> }
>>
>> I don't think I understand quite what should be happening. When should the 
>MethodBinding property actually set?
>>
>> Thanks
>>
>> > NullPointerException using inputSuggestAjax with Facelets
>> > ---------------------------------------------------------
>> >
>> >          Key: MYFACES-921
>> >          URL: http://issues.apache.org/jira/browse/MYFACES-921
>> >      Project: MyFaces
>> >         Type: Bug
>> >   Components: Sandbox
>> >     Versions: Nightly
>> >     Reporter: Peter Mahoney
>>
>> >
>> > The following exception is generated using inputSuggestAjax with 
>Facelets:
>> > 005-12-09 11:08:58,776 ERROR [localhost].[/webmail].[FacesServlet]:253 
>http-8080-Processor25  -> Servlet.service() for servlet FacesServlet threw 
>exception
>> > java.lang.NullPointerException
>> >       at 
>org.apache.myfaces.custom.inputsuggestajax.InputSuggestAjaxRenderer.encodeAjax(
>InputSuggestAjaxRenderer.java:209)
>> > It appears that InputSuggestAjaxTag uses its 
>setSuggestedItemsMethodProperty method to set the suggestedItemsMethod 
>property in the component, rather than this being carried out by the component 
>itself.
>>
>> --
>> This message is automatically generated by JIRA.
>> -
>> If you think it was sent incorrectly contact one of the administrators:
>>    http://issues.apache.org/jira/secure/Administrators.jspa
>> -
>> For more information on JIRA, see:
>>    http://www.atlassian.com/software/jira
>>
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>

Reply via email to