| Author |
Popup working with CommandButton but not with CommandLink
|
Ashok Subramaniam
Greenhorn
Joined: May 07, 2008
Posts: 4
|
|
Hi All, I have this piece of code which has a button when clicked brings up a popup page. This works as desired. UIColumn _editColumn = new UIColumn(); HtmlCommandExButton _editCommand = new HtmlCommandexButton(); _editCommand.setStyleClass("commandButton"); _editCommand.setId("cmdEdit" + num + type); String _editActionListener = "#{hksHandler.editHksLP}"; String _editAction = "#{hksHandler.editHksLPOutcome}"; Class[] params = { ActionEvent.class }; MethodBinding _editActionBindingListener = application.createMethodBinding(_editActionListener,params); MethodBinding _editActionBinding = application.createMethodBinding(_editAction,null); _editCommand.setActionListener(_editActionBindingListener); _editCommand.setAction(_editActionBinding); _editCommand.setOnclick("setPress('popup','FRTR')"); _editColumn.getAttributes().put("width","20px"); _editColumn.getChildren().add(_editCommand); _dataTable.getChildren().add(_editColumn); However, I wish to have a CommandLink that does the same job. Here is the code for CommandLink UIColumn _editColumn = new UIColumn(); HtmlCommandLink _editCommand = new HtmlCommandLink(); HtmlOutputText _editText = new HtmlOutputText(); _editText.setValue("edit"); _editCommand.getChildren().add(_editText); _editCommand.setStyleClass("commandLink"); _editCommand.setId("cmdEdit" + num + type); String _editActionListener = "#{hksHandler.editHksLP}"; String _editAction = "#{hksHandler.editHksLPOutcome}"; Class[] params = { ActionEvent.class }; MethodBinding _editActionBindingListener = application.createMethodBinding(_editActionListener,params); MethodBinding _editActionBinding = application.createMethodBinding(_editAction,null); _editCommand.setActionListener(_editActionBindingListener); _editCommand.setAction(_editActionBinding); _editCommand.setOnclick("setPress('popup','FRTR')"); _editColumn.getAttributes().put("width","20px"); _editColumn.getChildren().add(_editCommand); _dataTable.getChildren().add(_editColumn); This does not bring me a popup page although the setPress() is a jsp function which is used to bring the popup page. Please advice how I can solve this issue. Thanks, Ashok.
|
 |
Venkat Sadasivam
Ranch Hand
Joined: May 10, 2008
Posts: 139
|
|
commandButton and commandLink are meant to submit form. Use simple HTML code to invoke javascript like <input type="button" /> or <a href="javascript code" />
|
“Any fool can write code that a computer can understand. Good programmers write code that humans can understand. ”<br>
-Martin Fowler
|
 |
 |
|
|
subject: Popup working with CommandButton but not with CommandLink
|
|
|