You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by pb...@johnson.ca on 2009/10/08 17:50:40 UTC
no events firing - trinidad???
I have the most primitive program here and I cannot for the life of me
understand why a commandbutton in trinidad won't work. Am I missing some
congiguration?
Here is the code???
<f:view>
<tr:form id="a222b">
<tr:commandButton text="Put One Back"
actionListener="#{quantityBean.putOneBack}">
</tr:commandButton>
</tr:form>
</f:view>
public class QuantityBean
{
private int quantity=-1;
public int getQuantity() {
return quantity;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
}
public String putOneBack(ActionEvent e){
System.out.println("QuantityBean.putOneBack()");
quantity--;
return "success";
}
}
=============================================
Patrick Breen
Web Software Developer, Corporate Systems
Johnson Inc.
Phone..: (709) 737-1173
Email....: pbreen@johnson.ca
=============================================
Quote of the month...
I have often repented speaking, but never of holding my tongue.
Xenocrates
Re: no events firing - trinidad???
Posted by Richard Yee <ri...@gmail.com>.
In case you didn't figure this out already, the method signature of
the action method does not take a parameter.
I believe you want to use the action="#{quantityBean.putOneBack}" in
your jsp page and
in your backing bean, have a method
public String putOneBack() {
System./out/.println("QuantityBean.putOneBack()");
quantity--;
return "success";
}
If you are staying on the same page, you can return null.
There was confusion because there is also an actionListener attribute
that can be used to just listen for events and not change the viewId.
If you use the actionListener attribute,
then the signature of the listener method would be return void and
take an ActionEvent parameter.
-R
On Thu, Oct 8, 2009 at 11:52 PM, Luca Graf (Inxmail GmbH)
<lu...@inxmail.de> wrote:
> Which MyFaces/Trinidad version do you use? There was an issue in
> MyFaces-1.1.6 in combination with Trinidad 1.1.x that prevented
> commadButtons to fire there action
> (https://issues.apache.org/jira/browse/MYFACES-2160).
>
> Luca
>
>
> Richard Yee wrote:
>>
>> The method signature for putOneBack is wrong. It should retun null and the
>> parameter is actionListenerEvent
>>
>> -R
>>
>> Sent from my iPhone
>>
>> On Oct 8, 2009, at 8:50 AM, pbreen@johnson.ca <ma...@johnson.ca>
>> wrote:
>>
>>>
>>> I have the most primitive program here and I cannot for the life of me
>>> understand why a commandbutton in trinidad won't work. Am I missing some
>>> congiguration?
>>>
>>> Here is the code???
>>>
>>> <f:view>
>>>
>>> <tr:form id=/"a222b"/>
>>>
>>> <tr:commandButton text=/"Put One Back"/
>>>
>>> actionListener="#{quantityBean.putOneBack}">
>>> </tr:commandButton>
>>>
>>> </tr:form>
>>> </f:view>
>>>
>>>
>>>
>>> *public* *class* QuantityBean
>>> {
>>> *private* *int* quantity=-1;
>>>
>>> *public* *int* getQuantity() {
>>> *return* quantity;
>>> }
>>>
>>> *public* *void* setQuantity(*int* quantity) {
>>> *this*.quantity = quantity;
>>> }
>>> *public* String putOneBack(ActionEvent e){
>>> System./out/.println("QuantityBean.putOneBack()");
>>> quantity--;
>>> *return* "success";
>>> }
>>> }
>>>
>>>
>>> =============================================
>>> Patrick Breen
>>> Web Software Developer, Corporate Systems
>>> Johnson Inc.
>>> Phone..: (709) 737-1173
>>> Email....: pbreen@johnson.ca <ma...@johnson.ca>
>>> =============================================
>>> Quote of the month...
>>> I have often repented speaking, but never of holding my tongue.
>>> Xenocrates
>
>
> --
> Junior Software Developer
>
> ------------------------------------------------------
>
> Inxmail GmbH
> Wentzingerstr. 21, 79106 Freiburg, Germany
> Tel: +49 761 296979-404, Fax: -9
> luca.graf@inxmail.de, www.inxmail.de
>
> Handelsregister Freiburg, HRB 5870
> Ust.-ID: DE198371679
> Geschäftsleitung: Martin Bucher, Peter Ziras
> ------------------------------------------------------
>
> Inxmail Professional kostenlos testen:
> http://www.inxmail.de/jetzt-testen
>
> Tipps und Tricks für E-Mail-Marketers:
> http://www.inxmail.de/newsletter
>
> Inxmail kompakt in 140 Zeichen:
> http://www.twitter.com/inxmail_gmbh
>
>
Re: no events firing - trinidad???
Posted by "Luca Graf (Inxmail GmbH)" <lu...@inxmail.de>.
Which MyFaces/Trinidad version do you use? There was an issue in
MyFaces-1.1.6 in combination with Trinidad 1.1.x that prevented
commadButtons to fire there action
(https://issues.apache.org/jira/browse/MYFACES-2160).
Luca
Richard Yee wrote:
> The method signature for putOneBack is wrong. It should retun null and
> the parameter is actionListenerEvent
>
> -R
>
> Sent from my iPhone
>
> On Oct 8, 2009, at 8:50 AM, pbreen@johnson.ca
> <ma...@johnson.ca> wrote:
>
>>
>> I have the most primitive program here and I cannot for the life of
>> me understand why a commandbutton in trinidad won't work. Am I
>> missing some congiguration?
>>
>> Here is the code???
>>
>> <f:view>
>>
>> <tr:form id=/"a222b"/>
>>
>> <tr:commandButton text=/"Put One Back"/
>>
>>
>> actionListener="#{quantityBean.putOneBack}">
>> </tr:commandButton>
>>
>> </tr:form>
>> </f:view>
>>
>>
>>
>> *public* *class* QuantityBean
>> {
>> *private* *int* quantity=-1;
>>
>> *public* *int* getQuantity() {
>> *return* quantity;
>> }
>>
>> *public* *void* setQuantity(*int* quantity) {
>> *this*.quantity = quantity;
>> }
>>
>>
>> *public* String putOneBack(ActionEvent e){
>> System./out/.println("QuantityBean.putOneBack()");
>> quantity--;
>> *return* "success";
>> }
>> }
>>
>>
>> =============================================
>> Patrick Breen
>> Web Software Developer, Corporate Systems
>> Johnson Inc.
>> Phone..: (709) 737-1173
>> Email....: pbreen@johnson.ca <ma...@johnson.ca>
>> =============================================
>> Quote of the month...
>> I have often repented speaking, but never of holding my tongue.
>> Xenocrates
--
Junior Software Developer
------------------------------------------------------
Inxmail GmbH
Wentzingerstr. 21, 79106 Freiburg, Germany
Tel: +49 761 296979-404, Fax: -9
luca.graf@inxmail.de, www.inxmail.de
Handelsregister Freiburg, HRB 5870
Ust.-ID: DE198371679
Geschäftsleitung: Martin Bucher, Peter Ziras
------------------------------------------------------
Inxmail Professional kostenlos testen:
http://www.inxmail.de/jetzt-testen
Tipps und Tricks für E-Mail-Marketers:
http://www.inxmail.de/newsletter
Inxmail kompakt in 140 Zeichen:
http://www.twitter.com/inxmail_gmbh
Re: no events firing - trinidad???
Posted by Richard Yee <ri...@gmail.com>.
The method signature for putOneBack is wrong. It should retun null and
the parameter is actionListenerEvent
-R
Sent from my iPhone
On Oct 8, 2009, at 8:50 AM, pbreen@johnson.ca wrote:
>
> I have the most primitive program here and I cannot for the life of
> me understand why a commandbutton in trinidad won't work. Am I
> missing some congiguration?
>
> Here is the code???
>
> <f:view>
>
> <tr:form id="a222b">
>
> <tr:commandButton text="Put One Back"
>
>
> actionListener="#{quantityBean.putOneBack}">
> </tr:commandButton>
>
> </tr:form>
> </f:view>
>
>
>
> public class QuantityBean
> {
> private int quantity=-1;
>
> public int getQuantity() {
> return quantity;
> }
>
> public void setQuantity(int quantity) {
> this.quantity = quantity;
> }
>
>
> public String putOneBack(ActionEvent e){
> System.out.println("QuantityBean.putOneBack()");
> quantity--;
> return "success";
> }
> }
>
>
> =============================================
> Patrick Breen
> Web Software Developer, Corporate Systems
> Johnson Inc.
> Phone..: (709) 737-1173
> Email....: pbreen@johnson.ca
> =============================================
> Quote of the month...
> I have often repented speaking, but never of holding my tongue.
> Xenocrates
Re: no events firing - trinidad???
Posted by pb...@johnson.ca.
Bruno,
Thanks for your response. I did as you suggested and changed the return
type to void but that didn't work. Any other ideas? I have had it. It
seems like the button is not listening for the event? I converted the
code to use a tomahawk button instead and the event fires no problem???
Pat
=============================================
Patrick Breen
Web Software Developer, Corporate Systems
Johnson Inc.
Phone..: (709) 737-1173
Email....: pbreen@johnson.ca
=============================================
Quote of the month...
I have often repented speaking, but never of holding my tongue.
Xenocrates
Bruno Aranda <br...@gmail.com>
08/10/2009 01:31 PM
Please respond to
"MyFaces Discussion" <us...@myfaces.apache.org>
To
MyFaces Discussion <us...@myfaces.apache.org>
cc
Subject
Re: no events firing - trinidad???
public String putOneBack(ActionEvent e){
should be
public void putOneBack(ActionEvent e){
Cheers!
Bruno
2009/10/8 <pb...@johnson.ca>
I have the most primitive program here and I cannot for the life of me
understand why a commandbutton in trinidad won't work. Am I missing some
congiguration?
Here is the code???
<f:view>
<tr:form id="a222b">
<tr:commandButton text="Put One Back"
actionListener="#{quantityBean.putOneBack}">
</tr:commandButton>
</tr:form>
</f:view>
public class QuantityBean
{
private int quantity=-1;
public int getQuantity() {
return quantity;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
}
public String putOneBack(ActionEvent e){
System.out.println("QuantityBean.putOneBack()");
quantity--;
return "success";
}
}
=============================================
Patrick Breen
Web Software Developer, Corporate Systems
Johnson Inc.
Phone..: (709) 737-1173
Email....: pbreen@johnson.ca
=============================================
Quote of the month...
I have often repented speaking, but never of holding my tongue.
Xenocrates
Re: no events firing - trinidad???
Posted by Bruno Aranda <br...@gmail.com>.
*public* String putOneBack(ActionEvent e){
should be
*public* void putOneBack(ActionEvent e){
Cheers!
Bruno
2009/10/8 <pb...@johnson.ca>
>
> I have the most primitive program here and I cannot for the life of me
> understand why a commandbutton in trinidad won't work. Am I missing some
> congiguration?
>
> Here is the code???
>
> <f:view>
>
> <tr:form id=*"a222b"*>
>
> <tr:commandButton text=*"Put One Back"*
>
>
> actionListener="#{quantityBean.putOneBack}">
> </tr:commandButton>
>
> </tr:form>
> </f:view>
>
>
>
> *public* *class* QuantityBean
> {
> *private* *int* quantity=-1;
>
> *public* *int* getQuantity() {
> *return* quantity;
> }
>
> *public* *void* setQuantity(*int* quantity) {
> *this*.quantity = quantity;
> }
>
>
> *public* String putOneBack(ActionEvent e){
> System.*out*.println("QuantityBean.putOneBack()");
> quantity--;
> *return* "success";
> }
> }
>
>
> =============================================
> Patrick Breen
> Web Software Developer, Corporate Systems
> Johnson Inc.
> Phone..: (709) 737-1173
> Email....: pbreen@johnson.ca
> =============================================
> Quote of the month...
> I have often repented speaking, but never of holding my tongue.
> Xenocrates
Re: no events firing - trinidad???
Posted by Richard Yee <ri...@gmail.com>.
From my last email, the other thing you could do is change the tag
attribute from actionListener to action and leave your putOneBack
method signature alone. I think that is what you want. Action and
action listener methods are two different things. The action method
can cause navigation to a different view I'd while the actionlistener
method does not( hence the void return).
Richard
Sent from my iPhone
On Oct 8, 2009, at 8:50 AM, pbreen@johnson.ca wrote:
>
> I have the most primitive program here and I cannot for the life of
> me understand why a commandbutton in trinidad won't work. Am I
> missing some congiguration?
>
> Here is the code???
>
> <f:view>
>
> <tr:form id="a222b">
>
> <tr:commandButton text="Put One Back"
>
>
> actionListener="#{quantityBean.putOneBack}">
> </tr:commandButton>
>
> </tr:form>
> </f:view>
>
>
>
> public class QuantityBean
> {
> private int quantity=-1;
>
> public int getQuantity() {
> return quantity;
> }
>
> public void setQuantity(int quantity) {
> this.quantity = quantity;
> }
>
>
> public String putOneBack(ActionEvent e){
> System.out.println("QuantityBean.putOneBack()");
> quantity--;
> return "success";
> }
> }
>
>
> =============================================
> Patrick Breen
> Web Software Developer, Corporate Systems
> Johnson Inc.
> Phone..: (709) 737-1173
> Email....: pbreen@johnson.ca
> =============================================
> Quote of the month...
> I have often repented speaking, but never of holding my tongue.
> Xenocrates