Skip to main content

[webtier] Re: Passing ajax listener into a component

3 replies [Last post]
Anonymous

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joel Weight

Thanks for the reply Ed. The code you point to is for actions, not
actionListener. I agree that there shouldn't be any difference, but it
seems there is. I'm easily able to successfully specify an action as a
composite component attribute with a method-signature, but with the code in
my first post, I wasn't able to do the same for an actionListener.

Obviously it could be an error on my part in how I'm using the composite
component, but it was pretty simple. I've worked around the problem for
now, but would be interested to see code that successfully passes an
actionListener.

That said, I'm running this in google app engine, and was never able to get
el 2 working correctly in that environment, so i'm using the old el.
Perhaps that is causing the problem?

Joel

On Mon, Apr 26, 2010 at 1:25 PM, Ed Burns wrote:

> >>>>> On Mon, 26 Apr 2010 09:53:22 -0700 (PDT), webtier@javadesktop.orgsaid:
>
> JW> Thanks for the pointer. I had actually already read that and am
> JW> wondering which part of my attribute doesn't conform to the VDL
> JW> specification. I tried changing the return type of void to
> JW> java.lang.Void with no change in behavior. I was able to work
> JW> around the problem by simply not passing the listener, but would
> JW> like to figure out why it doesn't work.
>
> Here's a sample app that does do this.
>
> If you checkout the mojarra source code, you'll find that the ezcomp02
> sample in jsf-demo/sandbox/ezcomp02 has a file that does this.
> src/main/webapp/resources/ezcomp/loginPanel.html
>
> the cc-metadata, also in the sandbox, also passes a method in this way.
>
> Ed
>
> --
> | edburns... | office: +1 408 884 9519
> | homepage: | http://ridingthecrest.com/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: webtier-help@glassfish.dev.java.net
>
>
[att1.html]

Joel Weight

Ok, I'm a n00b. I should have just setup the control that provides the
action as an action source and let the component client attach their own
action listener rather than trying to pass the action listener in as an
attribute of the component.

Joel

On Sat, May 1, 2010 at 5:08 PM, Joel Weight wrote:

> Thanks for the reply Ed. The code you point to is for actions, not
> actionListener. I agree that there shouldn't be any difference, but it
> seems there is. I'm easily able to successfully specify an action as a
> composite component attribute with a method-signature, but with the code in
> my first post, I wasn't able to do the same for an actionListener.
>
> Obviously it could be an error on my part in how I'm using the composite
> component, but it was pretty simple. I've worked around the problem for
> now, but would be interested to see code that successfully passes an
> actionListener.
>
> That said, I'm running this in google app engine, and was never able to get
> el 2 working correctly in that environment, so i'm using the old el.
> Perhaps that is causing the problem?
>
> Joel
>
>
> On Mon, Apr 26, 2010 at 1:25 PM, Ed Burns wrote:
>
>> >>>>> On Mon, 26 Apr 2010 09:53:22 -0700 (PDT), webtier@javadesktop.orgsaid:
>>
>> JW> Thanks for the pointer. I had actually already read that and am
>> JW> wondering which part of my attribute doesn't conform to the VDL
>> JW> specification. I tried changing the return type of void to
>> JW> java.lang.Void with no change in behavior. I was able to work
>> JW> around the problem by simply not passing the listener, but would
>> JW> like to figure out why it doesn't work.
>>
>> Here's a sample app that does do this.
>>
>> If you checkout the mojarra source code, you'll find that the ezcomp02
>> sample in jsf-demo/sandbox/ezcomp02 has a file that does this.
>> src/main/webapp/resources/ezcomp/loginPanel.html
>>
>> the cc-metadata, also in the sandbox, also passes a method in this way.
>>
>> Ed
>>
>> --
>> | edburns... | office: +1 408 884 9519
>> | homepage: | http://ridingthecrest.com/
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
>> For additional commands, e-mail: webtier-help@glassfish.dev.java.net
>>
>>
>
[att1.html]

Edward Burns

On 5/1/10 20:11 , Joel Weight wrote:
> Ok, I'm a n00b. I should have just setup the control that provides the
> action as an action source and let the component client attach their own
> action listener rather than trying to pass the action listener in as an
> attribute of the component.
>
> Joel
>
> On Sat, May 1, 2010 at 5:08 PM, Joel Weight > > wrote:
>
> Thanks for the reply Ed. The code you point to is for actions, not
> actionListener. I agree that there shouldn't be any difference, but
> it seems there is. I'm easily able to successfully specify an
> action as a composite component attribute with a method-signature,
> but with the code in my first post, I wasn't able to do the same for
> an actionListener.

The following attributes are handled for you automatically, you don't
need to declare them:

*

  • action
  • *

  • actionListener
  • *

  • validator
  • *

  • valueChangeListener
  • Therefore, you should be able to do the same thing as in my action
    example with actionListener, provided you are ok using "actionListener"
    as the attribute name.

    Ed

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
    For additional commands, e-mail: webtier-help@glassfish.dev.java.net