File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes how to build CommandLink Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "how to build CommandLink" Watch "how to build CommandLink" New topic
Author

how to build CommandLink

deepak reads
Greenhorn

Joined: Nov 01, 2004
Posts: 13
How to build the component commandLink.I am using the code
UICommand command = new UICommand();
But when displayed,it gives me a command button.But i want a commandLink to be displayed.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Use HtmlCommandLink instead.

[Edited]
UICommand is a base class for both HtmlCommandLink and HtmlCommandButton.
[ April 05, 2006: Message edited by: Adeel Ansari ]
deepak reads
Greenhorn

Joined: Nov 01, 2004
Posts: 13
Thanks Adeel,do i have to something else also.Bcoz when i do
HtmlCommmandLink command = new HtmlCommandLink();

It does not show up in the screen where as if with the same code i do
UICommand command = new UIcommand();

It shows in the screen as button

Thanks,
Deepak
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Check. Whether it is rendering the component or not?
Rajeev Ravindran
Ranch Hand

Joined: Aug 27, 2002
Posts: 455
deepak, did you add any components to the htmlcommandlink ? if u dont add any Text or Image it wont get displayed in your page.

try this


here createOutputText is a private method that creates and returns HtmlOutputText and panelGrid5_2_1 is the PanelGrid to which i am adding my components.

Hope it helps.

Thanks,
Rajeev.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to build CommandLink
 
Similar Threads
Database grid tag
JSF datagrid component
White CommandLink
Creating commandlinks at runtime
ValueChangeListener question