AjaxCommandButton

View: New views
3 Messages — Rating Filter:   Alert me  

AjaxCommandButton

by kslm23 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
is it possible to invoke AjaxCommandButton as a UIComponent from java code. I am constructing my JSF GUI components in Java as opposed to jsp due to some GUI complexity. I tried to invoke the code below (using both AjaxCommandButtonTag and AjaxCommandButton) and the exception was thrown at runtime saying that the child wasn't an instance of UIComponent. I was thinking that there must be a way to do it from java. Please share your thought on this issue.
HtmlPanelGrid panelGrid = new HtmlPanelGrid();
AjaxCommandButtonTag btn2 = new AjaxCommandButtonTag();        
btn2.setTitle("testing");          
panelGrid.getChildren().add(btn2);

Thanks!

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


Re: AjaxCommandButton

by Sergey Smirnov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Any of Ajax4jsf tag can be invoked from java code. For a4j:commandButton, the right class is:
org.ajax4jsf.ajax.html.HtmlAjaxCommandButton
 
The corresponding class for each of the ajax4jsf component will be mentioned in the final version of the documentation.
 
For now, there is a simple tip:
ajax4jsf.jar has two key files in the META-INF/ folder: a4j.taglib.xml  and faces-config.xml
In the a4j.taglib.xml  you can find a component-type. Then, in the faces-config.xml the implementation class by this type.
----- Original Message -----
From: kslm23@...
To: dev@...
Sent: Friday, December 29, 2006 7:10 AM
Subject: AjaxCommandButton

Hi,
is it possible to invoke AjaxCommandButton as a UIComponent from java code. I am constructing my JSF GUI components in Java as opposed to jsp due to some GUI complexity. I tried to invoke the code below (using both AjaxCommandButtonTag and AjaxCommandButton) and the exception was thrown at runtime saying that the child wasn't an instance of UIComponent. I was thinking that there must be a way to do it from java. Please share your thought on this issue.
HtmlPanelGrid panelGrid = new HtmlPanelGrid();
AjaxCommandButtonTag btn2 = new AjaxCommandButtonTag();        
btn2.setTitle("testing");          
panelGrid.getChildren().add(btn2);

Thanks!

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


Re: AjaxCommandButton

by Ayananshu Monpara :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

        I have similar question too.

I am using jsf popup to display some messages. Now I want to invoke this popup when some exception or error occurs in backend(controllers) & pass the user's action(yes/no/cancel) back to backend.

User may click some link which might take long time & may fail too, in this case error msg should be popped up. Depending on user's action(yes/no), it should allow preceding operations.

How should I accomplish this?

One way I think is, by inserting hidden variable & javascripts template in component renderer & rename elements on the fly & store user response in that hidden field. I think there should be some standard approach too.

Regards




"Sergey Smirnov" <sim@...>

12/29/2006 10:53 AM
Please respond to
dev@...

To
<dev@...>
cc
Subject
Re:  AjaxCommandButton





Any of Ajax4jsf tag can be invoked from java code. For a4j:commandButton, the right class is:
org.ajax4jsf.ajax.html.HtmlAjaxCommandButton
 
The corresponding class for each of the ajax4jsf component will be mentioned in the final version of the documentation.
 
For now, there is a simple tip:
ajax4jsf.jar has two key files in the META-INF/ folder: a4j.taglib.xml  and faces-config.xml
In the a4j.taglib.xml  you can find a component-type. Then, in the faces-config.xml the implementation class by this type.
----- Original Message -----
From: Polina Keselman
To: dev@...
Sent: Friday, December 29, 2006 7:10 AM
Subject: AjaxCommandButton

Hi,
is it possible to invoke AjaxCommandButton as a UIComponent from java code. I am constructing my JSF GUI components in Java as opposed to jsp due to some GUI complexity. I tried to invoke the code below (using both AjaxCommandButtonTag and AjaxCommandButton) and the exception was thrown at runtime saying that the child wasn't an instance of UIComponent. I was thinking that there must be a way to do it from java. Please share your thought on this issue.
HtmlPanelGrid panelGrid = new HtmlPanelGrid();
AjaxCommandButtonTag btn2 = new AjaxCommandButtonTag();        
btn2.setTitle("testing");          
panelGrid.getChildren().add(btn2);

Thanks!

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.
LightInTheBox - Buy quality products at wholesale price!