tags:

views:

37

answers:

0

Hello, i am trying to figure out a way around this. i have two Implicit List in which clicking on any element in the first list will always send the user to the next list. my problem now is how does the second list remember the element that invoked it in the first list so that it can act accordingly. heres is an example:

first List CommandAction method:

  if (c == List.SELECT_COMMAND ){
           /* action for selected item in the list*/
            selection = this.getSelectedIndex();
            switch(selection){
                case 0:
                     wshop.displayShop();
                     break;
                case 1:
                     wshop.displayShop();
                     break;
            }


        }  

2nd List commandAction method

public void commandAction(Command c, Displayable d) {

  /* action for selected item in the 2nd list that depends on element in first list*/

        if (c == List.SELECT_COMMAND ){

            select = slist.getSelectedIndex();
            switch(select){
                case 0:
                     wshop.displayForm();
                     break;
                case 1:
                     wshop.displayForm();
                     break;
            }

my question is if i click on case 0 in the first list and then case 1 in the second, how can i compare/combine the two so that it can perform a specific action as different actions will be invoked depending on the selection from the first? i hope i have made my self clear on this. Thank you