on 11-16-2005 6:17 PM
I have a tableview that has a link column. When I click the link a method is called which navigates me to a specific JSP page. Works great. Now I want to be able to pass some specific information on to my bean when the link is clicked. Here is a code snippet:
Vector colVector = new Vector();
colVector.addElement("gID");
colVector.addElement("gName");
colVector.addElement("gView");
colVector.addElement("uID");
DefaultTableViewModel tvm = new DefaultTableViewModel(resultVector, colVector);
tvm.getColumn("gView").setType(TableColumnType.LINK);
tvm.getColumn("gView").setOnItemClick("LinkClicked");
return tvm;
}
public void onLinkClicked (Event evt){
//Go to JSP
}
I would also like to know how to make the Column 'uID' invisible, but that is the value I would like to pass to my bean if the link is clicked for that particular row. Thanks.
On the Dynpage:
public void LinkClicked(Event event) throws PageException {
TableCellClickEvent tcce = (TableCellClickEvent) event;
int rowIndex = tcce.getVisibleRowIndex();
//clicked row
TableColumn Tcolumn = myBean.model.getColumn("uID");
myBean.setClickedUID(Tcolumn.getValueAt(rowIndex).toString());
//value of uID at that row
}
Bean:
private int rowIndex;
..
public void setClickedUID(String string) {
this.uID = string;
}
public String getClickedUID() {
return this.uID;
}
Plz don't forget points, if it helped!
Regards,
P.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sry in ur case itz "tvm"
For more info:
http://help.sap.com/saphelp_nw04/helpdata/en/cf/d10f41f83ff06fe10000000a1550b0/frameset.htm
Regards,
P.
Hi Peter,
setting a column being invisible works, https://media.sdn.sap.com/javadocs/preNW04/SP2/60_sp2_javadocs/htmlb/com/sapportals/htmlb/table/Tabl...
Hope it helps
Detlev
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.