How to deselect the selected row when we come back again?

Hi all,
I have one screen(100),which contains records.User can select any one record and click 'Details' button.Then it will take to screen 110.When I am coming back to screen 110 again.The previously selected row is again in selected mode only.Now if I am selecting another row and click the 'Detail' button.I am getting the error saying that 'Please select one record'.In debugging mode also I checked using the FM get_current_cell but nothing is getting selected surprisingly.
Even I used CALL METHOD grid->refresh_table_display in the PBO of screen 100.
Below is the code I used in PBO of screen 100
ODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'PF100'.
SET TITLEBAR 'TITLE'.
DATA: G_CONSISTENCY_CHECK TYPE CHAR1.
DATA: G_EXCLUDE TYPE UI_FUNCTIONS.
IF container100 IS INITIAL.
*ex_FUNCTIONS-
*-- Check execution mode (foreground/background)
IF cl_gui_alv_grid=>offline( ) IS INITIAL.
CREATE OBJECT CONTAINER100
EXPORTING CONTAINER_NAME = 'CONTAINER100'.
CREATE OBJECT GRID
EXPORTING I_PARENT = CONTAINER100.
CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_BYPASSING_BUFFER = 'X'
I_BUFFER_ACTIVE = ''
I_CONSISTENCY_CHECK = G_CONSISTENCY_CHECK
IT_TOOLBAR_EXCLUDING = G_EXCLUDE
IT_TOOLBAR_EXCLUDING = IT_TOOLBAR
I_STRUCTURE_NAME =
IS_VARIANT = gs_layout
I_SAVE = 'A'
I_DEFAULT = 'X'
IS_LAYOUT = X_LAYOUT
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING = IT_TOOLBAR
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
IT_OUTTAB = IT_YAPOHDR_MAIN[]
IT_FIELDCATALOG = IT_FIELDCAT[].
IT_SORT =
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4.
ENDIF.
*--Register enter key for data changed event
CALL METHOD grid->set_ready_for_input
EXPORTING i_ready_for_input = 0.
create object event_receiver.
Register the 'hotspot' event handler method dynamically...
set handler event_receiver->handle_hotspot_click for grid.
Register the User Command event handler method dynamically...
set handler event_receiver->handle_user_command for grid.
Register the User Command event handler method dynamically...
set handler event_receiver->handle_data_changed for grid.
else.
CALL METHOD grid->refresh_table_display.
endif.
ENDMODULE. " STATUS_0100 OUTPUT
The below is the code I used in PAI of screen 110.
MODULE USER_COMMAND_0110 INPUT.
DATA : LT_DETAILS_MAIN LIKE YAPOPLN_ITM OCCURS 0 WITH HEADER LINE,
LV_POP TYPE C,
APPROVE.
CASE SY-UCOMM.
WHEN 'BACK'.
CALL METHOD grid->REFRESH_TABLE_DISPLAY.
CALL METHOD grid->GET_FRONTEND_FIELDCATALOG.
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
ENDMODULE.                 " USER_COMMAND_0110  INPUT
Please Let me know if there is any solution.
Thanks,
Balaji

Hello Balaji
The sample report <b>ZUS_SDN_TWO_ALV_GRIDS_7</b> shows basically what I meant in my previous answer. There is no row mark available on the first ALV list. Instead of bothering the user to push a button he or she can simply double-click on the ALV lists and sees the details of a customer.
As you can see there is absolutely no need to free any object instances or rebuild grid controls.
Final remark: based on the function module you mention I assume you are still using fm-based ALV lists. Do not use them. OO-based ALV lists are much easier to develop, to maintain and to enhance.
*& Report  ZUS_SDN_TWO_ALV_GRIDS_7
*& Description: Display two ALV lists either in single screen or
*&              two screens
*& Screen '0100' contains no elements.
*& ok_code -> assigned to GD_OKCODE
*& Flow logic:
*  PROCESS BEFORE OUTPUT.
*    MODULE STATUS_0100.
*  PROCESS AFTER INPUT.
*    MODULE USER_COMMAND_0100.
REPORT  zus_sdn_two_alv_grids_7.
TYPE-POOLS: abap.
DATA:
  gd_repid         TYPE syst-repid,
  gd_okcode        TYPE ui_func,
  go_docking       TYPE REF TO cl_gui_docking_container,
  go_docking2      TYPE REF TO cl_gui_docking_container,
  go_splitter      TYPE REF TO cl_gui_splitter_container,
  go_cell_top      TYPE REF TO cl_gui_container,
  go_cell_bottom   TYPE REF TO cl_gui_container,
  go_grid1         TYPE REF TO cl_gui_alv_grid,
  go_grid2         TYPE REF TO cl_gui_alv_grid,
  gs_layout        TYPE lvc_s_layo.
DATA:
  gs_knb1          TYPE knb1,
  gt_knb1          TYPE STANDARD TABLE OF knb1,
  gt_knvv          TYPE STANDARD TABLE OF knvv.
*       CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
  PUBLIC SECTION.
    CLASS-METHODS:
      handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
        IMPORTING
          e_row
          e_column
          es_row_no
          sender.
ENDCLASS.                    "lcl_eventhandler DEFINITION
*       CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
  METHOD handle_double_click.
*   define local data
    DATA:
      ls_knb1      TYPE knb1.
    CHECK ( sender = go_grid1 ).
    READ TABLE gt_knb1 INTO ls_knb1 INDEX e_row-index.
    CHECK ( ls_knb1-kunnr IS NOT INITIAL ).
    CALL METHOD go_grid1->set_current_cell_via_id
      EXPORTING
*        IS_ROW_ID    =
*        IS_COLUMN_ID =
        is_row_no    = es_row_no.
*   Triggers PAI of the dynpro with the specified ok-code
**  CALL METHOD cl_gui_cfw=>set_new_ok_code( 'DETAIL' ). " not on 4.6c
    CALL METHOD cl_gui_cfw=>set_new_ok_code
      EXPORTING
        new_code = 'DETAIL'
*      IMPORTING
*        RC       =
  ENDMETHOD.                    "handle_double_click
ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
PARAMETERS:
  p_single  RADIOBUTTON  GROUP radi,  " single screen
  p_double  RADIOBUTTON  GROUP radi.  " two screens
START-OF-SELECTION.
  SELECT        * FROM  knb1 INTO TABLE gt_knb1
         WHERE  bukrs  = '1000'.
  " Add dummy customer without any master sales data
  CLEAR: gs_knb1.
  gs_knb1-kunnr = 'DUMMY'.
  gs_knb1-bukrs = '1000'.
  INSERT gs_knb1 INTO gt_knb1 INDEX 1.
* Create docking container
  CREATE OBJECT go_docking
    EXPORTING
      parent                      = cl_gui_container=>screen0
      ratio                       = 90
    EXCEPTIONS
      OTHERS                      = 6.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
  IF ( p_single = abap_true ).
    PERFORM create_splitter_container.
  ELSE.
*   Create 2nd docking container
    CREATE OBJECT go_docking2
      EXPORTING
        parent                      = cl_gui_container=>screen0
        ratio                       = 90
      EXCEPTIONS
        OTHERS                      = 6.
    IF sy-subrc <> 0.
*     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
  ENDIF.
  IF ( p_single = abap_true ).
*   Create ALV grids
    CREATE OBJECT go_grid1
      EXPORTING
        i_parent          = go_cell_top
      EXCEPTIONS
        OTHERS            = 5.
    IF sy-subrc <> 0.
*     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CREATE OBJECT go_grid2
      EXPORTING
        i_parent          = go_cell_bottom
      EXCEPTIONS
        OTHERS            = 5.
    IF sy-subrc <> 0.
*     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
  ELSE.
*   Create ALV grids
    CREATE OBJECT go_grid1
      EXPORTING
        i_parent          = go_docking
      EXCEPTIONS
        OTHERS            = 5.
    IF sy-subrc <> 0.
*     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CREATE OBJECT go_grid2
      EXPORTING
        i_parent          = go_docking2
      EXCEPTIONS
        OTHERS            = 5.
    IF sy-subrc <> 0.
*     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
  ENDIF.
* Set event handler
  SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid1.
* Display data
  gs_layout-grid_title = 'Customers'.
  CALL METHOD go_grid1->set_table_for_first_display
    EXPORTING
      i_structure_name = 'KNB1'
      is_layout        = gs_layout
    CHANGING
      it_outtab        = gt_knb1
    EXCEPTIONS
      OTHERS           = 4.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
  gs_layout-grid_title = 'Customers Details (Sales Areas)'.
  CALL METHOD go_grid2->set_table_for_first_display
    EXPORTING
      i_structure_name = 'KNVV'
      is_layout        = gs_layout
    CHANGING
      it_outtab        = gt_knvv  " empty !!!
    EXCEPTIONS
      OTHERS           = 4.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
* Link the docking container to the target dynpro(s)
  gd_repid = syst-repid.
  IF ( p_single = abap_true ).
    CALL METHOD go_docking->link
      EXPORTING
        repid                       = gd_repid
        dynnr                       = '0100'
*        CONTAINER                   =
      EXCEPTIONS
        OTHERS                      = 4.
    IF sy-subrc <> 0.
*     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
  ELSE.
    CALL METHOD go_docking->link
      EXPORTING
        repid                       = gd_repid
        dynnr                       = '0100'
*        CONTAINER                   =
      EXCEPTIONS
        OTHERS                      = 4.
    IF sy-subrc <> 0.
*     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL METHOD go_docking2->link
      EXPORTING
        repid                       = gd_repid
        dynnr                       = '0200'
*        CONTAINER                   =
      EXCEPTIONS
        OTHERS                      = 4.
    IF sy-subrc <> 0.
*     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
  ENDIF.
* NOTE: dynpro does not contain any elements
  CALL SCREEN '0100'.
* Flow logic of dynpro (does not contain any dynpro elements):
*PROCESS BEFORE OUTPUT.
*  MODULE STATUS_0100.
*PROCESS AFTER INPUT.
*  MODULE USER_COMMAND_0100.
  " NOTE: screen '0200' uses same flow logic as '0100'
END-OF-SELECTION.
*&      Module  STATUS_0100  OUTPUT
*       text
MODULE status_0100 OUTPUT.
  SET PF-STATUS 'STATUS_0100'.  " contains push button "DETAIL"
*  SET TITLEBAR 'xxx'.
* Refresh display of detail ALV list
  CALL METHOD go_grid2->refresh_table_display
*    EXPORTING
*      IS_STABLE      =
*      I_SOFT_REFRESH =
    EXCEPTIONS
      OTHERS         = 2.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDMODULE.                 " STATUS_0100  OUTPUT
*&      Module  USER_COMMAND_0100  INPUT
*       text
MODULE user_command_0100 INPUT.
  CASE gd_okcode.
    WHEN 'BACK' OR
         'EXIT'  OR
         'CANC'.
      IF ( syst-dynnr = '0100' ).
        SET SCREEN 0. LEAVE SCREEN.
      ELSE.
        SET SCREEN 100.
      ENDIF.
*   User has pushed button "Display Details"
    WHEN 'DETAIL'.
      PERFORM entry_show_details.
      IF ( p_single = abap_true ).
      ELSE.
        SET SCREEN 200.
      ENDIF.
    WHEN OTHERS.
  ENDCASE.
  CLEAR: gd_okcode.
ENDMODULE.                 " USER_COMMAND_0100  INPUT
*&      Form  ENTRY_SHOW_DETAILS
*       text
*  -->  p1        text
*  <--  p2        text
FORM entry_show_details .
* define local data
  DATA:
    ld_row      TYPE i,
    ls_knb1     TYPE knb1.
  CALL METHOD go_grid1->get_current_cell
    IMPORTING
      e_row = ld_row.
  READ TABLE gt_knb1 INTO ls_knb1 INDEX ld_row.
  CHECK ( syst-subrc = 0 ).
  SELECT        * FROM  knvv INTO TABLE gt_knvv
         WHERE  kunnr  = ls_knb1-kunnr.
ENDFORM.                    " ENTRY_SHOW_DETAILS
*&      Form  CREATE_SPLITTER_CONTAINER
*       text
*  -->  p1        text
*  <--  p2        text
FORM create_splitter_container .
* Create splitter container
  CREATE OBJECT go_splitter
    EXPORTING
      parent            = go_docking
      rows              = 2
      columns           = 1
*      NO_AUTODEF_PROGID_DYNNR =
*      NAME              =
    EXCEPTIONS
      cntl_error        = 1
      cntl_system_error = 2
      OTHERS            = 3.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
* Get cell container
  CALL METHOD go_splitter->get_container
    EXPORTING
      row       = 1
      column    = 1
    RECEIVING
      container = go_cell_top.
  CALL METHOD go_splitter->get_container
    EXPORTING
      row       = 2
      column    = 1
    RECEIVING
      container = go_cell_bottom.
ENDFORM.                    " CREATE_SPLITTER_CONTAINER
Regards
  Uwe

Similar Messages

  • How to delete the selected rows in a JTable on pressing a button?

    How to delete the selected rows in a JTable on pressing a button?

    You are right. I did the same.
    Following is the code where some of them might find it useful in future.
    jTable1.selectAll();
    int[] array = jTable1.getSelectedRows();
    for(int i=array.length-1;i>=0;i--)
    DefaultTableModel model = (DefaultTableModel)jTable1.getModel();
    model.removeRow(i);
    }

  • How to identify the Selected row number or Index in the growing Table

    Hi,
    How to find the selected Row number or Row Index of growing  Table using Javascript or Formcalc in Interactive Adobe forms
    Thanks & Regards
    Srikanth

    After using bellow script it works fine
    xfa.resolveNode("Formname.Table1.Row1["this.parent.index"].fieldname").rawValue;

  • How to delete the selected rows with a condition in alv

    dear all,
    i am using the code in object oriented alv.
    WHEN 'DEL'.
    PERFORM delete_rows.
    FORM delete_rows.
    DATA : lv_rows LIKE lvc_s_row.
    data : wa_ROWs like LVC_S_ROW.
    FREE : gt_rows.
    CALL METHOD alv_grid->get_selected_rows
    IMPORTING
    et_index_rows = gt_rows.
    IF gt_rows[] IS INITIAL.
    MESSAGE s000 WITH text-046.
    EXIT.
    ENDIF.
    loop at gt_rows into wa_ROWs .
    if sy-tabix ne 1.
    wa_ROWs-INDEX = wa_ROWs-INDEX - ( sy-tabix - 1 ).
    endif.
    delete gt_sim INDEX wa_ROWs-INDEX .
    endloop.
    the rows to be deleted from int.tab gt_sim not in the alv display.
    all the rows should not be deleted if one of the field in gt_sim eq 'R'.
    how to check this condition

    dear jayanthi,
            ok if i am coding like that as u mentioned ,
              it will exit the loop when first time the field value is 'R'.
      if any of  the selected rows contains  field value 'R'. it shold not delete all the selected rows.
    as u suggested it will not delete after first time the field value is r.
    i am deleting it by tab index so,
    suppose if i am selecting the row without field value R say its tabix is 1.
      the next row with tabix 2 with field value R.
      it deletes the first row and exits , it should not delete the first row also.

  • How to get the selected rows & columns in the table?

    hi everybody,
                         In my application the table is kept inside the event structure.I select the cells  in the table (using mouse) on running time.How to get the selected number of rows & columns in that table?

    Hello,
    You can fill selected values of the table by writing to it or the corresponding property using a property node - the table is just a 2D array of strings.  I think for your "disable" question you are referring to the shortcut menu (when you right click).  If you are using LabVIEW 8.x, you can edit or disable that shortcut menu - just right click on your table at edit time and choose Advanced >> Run-Time Shortcut Menu.
    Best Regards,
    JLS
    Best,
    JLS
    Sixclear

  • [UIX-ADF] How to get the selected row in my ViewObjImpl.java

    Hi,
    I have a uix table with a select column. I dragged my method from my ViewObjImpl
    and dropped it on the select column (radiobutton) as a submitbutton.
    If I run my application and select a row and press my button it always reads the first
    row. Why?
    I also tried including a param in my method, for the record id, but I dont know what to
    pass to my action binding as a param, where can I find the selected row?
    This is what I want, my method in ViewObjImpl.java
    public void doDelete() {
      ViewObjRowImpl pRow = (ViewObjRowImpl)this.getCurrentRow();
      try {
        pRow.setIsDeleted("Y");
        //this.executeQuery();
        this.getDBTransaction().commitAndSaveChangeSet();
        //this.validate();
      } catch(Exception e) { System.out.println("ERROR doDelete" + e);  }
    }It should set the IsDeleted field to 'Y' for the selected row. Perhaps im not doing the
    right thing for this?
    Can anyone give me some pointers?
    Thanks in advance
    Ido

    Thanks. So even if you select a row and then press the button, your method still only finds the first row?!
    Are you sure that the selection mechanism of your table is working? Your tableSelection fires a select event and your page contains a select handler?
    When you wire your page using drag and drop the binding should always use the default iterator of the ViewObject. And getCurrentRow() should always give you the current row of that iterator. So my feeling is that the selection doesn't take place.
    Or could it be that something resets the currency in the ViewObject from another place?
    Sascha

  • Check box als column in a standard table, how to get the selected row

    Dear experts,
    I habe standard tablt with check box as column. Now I want to get the current selected row structure and do some changes. How could I solve this problem? till now I just know to get the structure via lead selection.
    lo_node->get_element().
    lo_element = lo_node->get_static_attributes ( static_attributes = ls_row).
    How could I get the element through check-box in stead of lead selection. Many thanks!

    check this code
    To get the selected row number
    data: lr_element type ref to if_wd_context_element,
              lv_index type i.
      lr_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT'  ).
      lv_index = lr_element->get_index( ).
    Thanks
    Bala Duvvuri

  • How to get the selected rows in a table

    Hi,
    How to get the ids of all the selected rows. On Page load a query is executed that shows the data in a table with a checkbox in the first column to select the rows and delete. Now if a user select multiple rows how do I get the ids of selected rows in the backend code.
    Thanks

    Please search the forum before posting questions.
    refer following thread for table selection.
    Re: Record selection with MessageCheckBox and print the selected record.
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                           

  • How to populate the selected row details of table in the next view?

    hi,
    Im having a table, on selecting a particular row of a table by clicking on a radio button. i need that row details to be passed on(populated) to the next view when i navigate to that view by clicking on a button?
    Thanks & Regards,
    Suresh

    Hi Suresh,
    Your scenario is simple. Just follow the ex as shown below
    (Assuming you want default selection view provided by table itself.)
    1>Create 2 views (Ex:A and B)
    2>Create a Context with a node and attributes(For Ex:Person as node and Fname and Last Name as attributes
    2>In A view create a table with F name and L Name(map to context as well) and a action button to navigate to B view when you selected a particualr row o.k
    3>In B view, create a TextView with mapping to LastName(or all the data if you want from input selection) from the context
    If you want you can add back action button from B view to A view for easy navigation.
    4>Execute the application and select any row in the table appeared, press next action button,you can see that the selected row details will be shown in second(B) view.
    If you do the above example, I think you can easily find the solution for navigation issue.. try it out.
    In case if you are not able to ...let me know..I have that example.
    Hope that helps
    Regards
    Praveen

  • How to obtain the selected rows in the model with af:Table using selectMany

    Hi ,
    I am using multi select af:Table and it is based on a programmatically populated view. When the table is single select I can use the getCurrentRow at the view implementation. I wonder whether there is a way to get list of selected rows within the view implementation for the multi-select scenario.
    I saw some ways of doing it in the page's backing bean but it will be more appropriate if I could do it at the model project.
    Thanks
    My environment is JDeveloper 10.1.3.3 and jdk 1.4

    Thanks for your reply.
    What you say makes sense. I thought there might be way of setting the selected rows in the model also as we do woth the current row.
    But looks like these two different things.
    Anyway I am doing it by passing the values through the backing bean.
    Thanks

  • How to save the selected row number to NSUserDefaults

    I am trying to save the indexpath.row of the selected row to NSUserDefaults temporarily until my detail view controller can load its UITextFields based on which row is tapped. First of all is this good? I chose this design because the detail view controller cannot access the master view controller so I can't find out which row its tapped. To save to NSUSerDefaults, I did the following code, and the NSLog is always returning row 0 no matter what row I tap. Plus the title is not being set: its still blank.
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
        [patientList deselectRowAtIndexPath:indexPath animated:YES];
        [[NSUserDefaults standardUserDefaults] setInteger:indexPath.row forKey:@"rowSelected"];
        NSLog(@"The selected row saved is row %d"), [[NSUserDefaults standardUserDefaults] integerForKey:@"rowSelected"];
        if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
            PatientDetailViewController *detailViewController = [[PatientDetailViewController alloc] initWithNibName:@"PatientDetailViewController" bundle:nil];
            detailViewController.title = [patientDisplayName objectAtIndex:[[NSUserDefaults standardUserDefaults] integerForKey:@"rowSelected"]];
            // Pass the selected object to the new view controller.
            [self.navigationController pushViewController:detailViewController animated:YES];
            [detailViewController release];

    I have also tried setting the title differently (I also added comments to explain each line what it does, the rest is the same), but neither methods work
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
        // Deselect the row
        [patientList deselectRowAtIndexPath:indexPath animated:YES];
        // Save to memory the row selected
        [[NSUserDefaults standardUserDefaults] setInteger:indexPath.row forKey:@"rowSelected"];
        // Show saved row to make sure it saved correctly
        NSLog(@"The selected row saved is row %d"), [[NSUserDefaults standardUserDefaults] integerForKey:@"rowSelected"];
        // Check if user is using iPhone
        if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
            // Load the view
            PatientDetailViewController *detailViewController = [[PatientDetailViewController alloc] initWithNibName:@"PatientDetailViewController" bundle:nil];
            // Set the title of the detail view controller based on row selected
            detailViewController.title = [patientDisplayName objectAtIndex:indexPath.row];
            // Push the detail view controller
            [self.navigationController pushViewController:detailViewController animated:YES];
            // Release the detail view controller
            [detailViewController release];

  • How to reference the selected row on a report by click a radiobox

    I created a report with a column displayed as a radiobox.The report source is like "select htmldb_item.radiogroup(1,.....),rec_id,....from .... where ....",after click one radiobox,i want to get other column's value in the selected row in the after submit process ,can anyone help me?????? how to reference "rec_id" of the selected row?

    Hello,
    First, please tell us your first name, and update your forum handle. It’s make it easier to track your threads, and help you.
    >> apex_application.g_f01(1)" only return the first record's rec_id,if i click radiobox in other rows,it returns the same result as click radiobox in the first row?
    The ‘G_F01’ is an array of values, so apex_application.g_f01(1) will always bring you the first element of this array. If you want to retrieve other values from this array, which will include the values of the radiogroup value of the other lines, you need to use a loop. Something like that should work:
    for i in 1.. apex_application.g_f01.count loop
    … apex_application.g_f01(i) …
    end loop;
    >> after click one radiobox,i want to get other column's value in the selected row in the after submit process
    That means that the value of your radiogroup item should include some indication to the line you are on. If, like in Andy’s example, you can retrieve your record from a table, based on a PK, your radiogroup can return this kind of information. However, if the data on the other columns of the select raw, were just entered/updated by the user (like in a tabular form), the radiogroup item should include information about the row you are in, in order for you to be able to access the corresponding array elements – other G-Fxx arrays – of the other columns in the row. In this case, I believe using checkboxes is preferable.
    Regards,
    Arie.

  • How to disply the selected row in dataTabe in JSF

    Hello Team,
    I have one datatable.& in that table i have one coloumn (checkBox are present in that coloumn).when i first go on that page i select some particular row.& submit the page.but when i again revisit that page i show some selected & not selected rows.& i done print functionality on that page.
    but when i am printing that page whole row is disply to print but i want to print only that row which is selected.
    Please help me in this functionality.

    Is your print functionality opening up on a new pop up? If not, you will get all the rows. The Print button should open a pop up through a Backing bean in which you would pick up only the selected rows for display. Once the pop up is shown, onload you would fire the javascript print.
    For any JSF related queries, please use the JSF forum.

  • How to read the selected row value of a table node

    hi
    i have a node of table type, displaying few records & with each record a  NEXT button is there.
    now i want to read the values of the selected row of the table & want to process next with NEXT button.
    pls tell me how to read the values of the selected row only.
    reds.

    data : lo_nd type ref to if_wd_context_node,
      lo_nd1 type ref to if_wd_context_node,
      lt_temp type wdr_context_element_set,
      wa_temp type ref to if_wd_context_element,
      ls_node1 type sflight,
      lt_node1 type STANDARD TABLE OF sflight.
    lo_nd = wd_context->get_child_node('CN_MAIN').
      CALL METHOD lo_nd->get_selected_elements
       RECEIVING
           set = lt_temp.
      loop at lt_temp INTO wa_temp.
          CALL METHOD wa_temp->get_static_attributes
          IMPORTING
            static_attributes = ls_node1.
        APPEND ls_node1 TO lt_node1.
        CLEAR ls_node1.
      ENDLOOP.
    'CN_MAIN' is the node whose selected values are to be picked and stored in internal table lt_node1.
    Other option by Thomas :
    DATA lo_nd_cn_main TYPE REF TO if_wd_context_node.
      DATA lt_temp TYPE wdr_context_element_set.
      FIELD-SYMBOLS <wa_temp> LIKE LINE OF lt_temp.
      DATA lt_node1 TYPE wd_this->elements_cn_main.
      FIELD-SYMBOLS <ls_node1> LIKE LINE OF lt_node1.
      lo_nd_cn_main = wd_context->get_child_node( name = wd_this->wdctx_cn_main ).
      lt_temp = lo_nd_cn_main->get_selected_elements( ).
      LOOP AT lt_temp ASSIGNING <wa_temp>.
        APPEND INITIAL LINE TO lt_node1 ASSIGNING <ls_node1>.
        <wa_temp>->get_static_attributes( IMPORTING STATIC_ATTRIBUTES = <ls_node1> ).
      ENDLOOP.

  • How to save the  selected rows from Advance table into database

    Hi
    I have requirement like..
    In custom page , Manager Search the Candidates and selects the candidate ROWS from advance table.
    The reqt is how to save the selected multiple rows into the database.

    hi Reetesh,
    In Custom page
    Supoose the Recruiter Search is for Position Finance Mangager , it retrieves 100 rows , out of which Recruiter select 10 rows .
    So in Such scenario how to save this 10 rows against Recruiter
    , i mean , Is i need to create custom table, to save Recruiter , these selected 10 rows.
    I hope u understand my question

Maybe you are looking for

  • SEPA tree: how to add new fields?

    Hello @all, I tried to add some fields to the SEPA tree in DMEE. The technical adding migt not be the problem, but in the output file the new added fields are not shown. Can somebody give me hint, how to maintain the new fields that they are shown in

  • Iphoto i can't see my albums

    I have lost all my iphoto albums... im using iphoto 08 with osx lion. is it a view thing which i can change in the menus or something more involved. ipod have kept all albums previously in iphoto. i have restored my library from recent backup and has

  • What are the commands in smartforms

    hi gurus can anyone suggest me what are the commands in smartforms thank you regards kals.

  • Error message in Creating order without Partner Function ER(CSR)

    Hi All , My client want a error message to be appeared when we are creating sales order for customers where partner function CSR (ER ) is missing ...Can u just help where the congiguration is to be done . Bala

  • Chicago blues style drum track shuffle

    I want to find some chicago style drum tracks for garage band. Style like Elmore James, Howlin Wolf. Where can I find drum fills and beats for this style?