• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Popup working with CommandButton but not with CommandLink

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
commandButton and commandLink are meant to submit form.

Use simple HTML code to invoke javascript like <input type="button" /> or <a href="javascript code" />
 
reply
    Bookmark Topic Watch Topic
  • New Topic