Skip to Content
author's profile photo Former Member
Former Member

How do refer to 2 tableView models in TableCellClickEvent

Hi All

I have 2 table view models each in their own JSPs. In my portal component java file...in my doContent method I want to capture the value clicked by the user, so I have this code to do that:

//*************************************************************************************************

if(event instanceof TableCellClickEvent){

TableCellClickEvent tcce = (TableCellClickEvent) event;

int realSelectedRow = tcce.getVisibleRowIndex() + Integer.parseInt(myBean.getVisibleRow()) - 1;

int realSelectedColumn = tcce.getVisibleColIndex();

String x = myBean.getModel().getValueAt(realSelectedRow, realSelectedColumn).toString();

aResource = request.getResource("jsp","pagelet/WildcardUsers.jsp");

if(eventName.equals("myOnCellClick")){

aResource = request.getResource("jsp","pagelet/WildcardUsers.jsp");

response.write("");

myBean.setUser(x);Â Â Â

}//end if(eventName.equals("myOnCellClick"))

}//end if(event instanceof TableCellClickEvent)

//****************************************************************************************************

This code refers to a cell clicked in one model, how do I distinguish between another model within this TableCellClickEvent statement ?

Thanx in advance

Rakhee

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Dec 01, 2003 at 08:53 PM

    Doesn't

    tcce.getComponentName()

    deliver the name of the component? Maybe you could work with that?

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanx Siegfried, I got it to work another way.

      To briefly explain..I used one model, two functions that sets the model with specific data, and in my abstract portal component..i called the the 2 different JSPs according to some options and those 2 functions.

      Regards

      Rakhee