Disable Checkbox in TableView

Hi,
I am using a HTMLB TableView to visualize data...in the first column of each row theres a Checkbox to select one or more rows... now I want to disable the Checkbox for some rows. Is it possible to achieve this with a custom CellRenderer ? My problem with this approach is, that the method TableView.getValue(...) delivers a String.... I had expected an object or component...in my case a CheckBox...  any suggestions ?
Thanks in advance
Oliver

Hi Oliver,
myTableView.setRowSelectable(i, false);
Hope it helps
Detlev

Similar Messages

  • Disable checkbox in output report

    hi gurus
    I have display checkbox with tick in front of row in output at simple report program. My query is that I want to do disable checkbox whose are on tick in output screen.
    Please suggest me how can I do ?
    Best Regards.
    Pravin

    hey pravin    tryout this code and each time u select checkbox press f8 .
    REPORT  hide_unhide_box
    selection-SCREEN : begin of block b2 with frame.
      PARAMETERS: chk1 as CHECKBOX MODIF ID M1,
                  chk2 as CHECKBOX MODIF ID M1  DEFAULT 'X'.
    SELECTION-SCREEN:END OF BLOCK b2.
    AT SELECTION-SCREEN OUTPUT.
       if  chk1 eq 'X'.
         loop AT SCREEN.
             if screen-group1 = 'M1'.
                screen-invisible = 1.
            endif.
            MODIFY SCREEN.
         ENDLOOP.
        endif.
    If usefull please reward with points .
    thanks and regards
    Anoop Gupta

  • After selecting the value from the list box, want to disable checkbox

    hi guru,
    After selecting the value from the list box, want to disable checkbox and custom control textbox(container) in module pool.
    so please help me on this.
    thanx,
    man

    in PBO,
    loop at screen.
      if screen-name = your textbox's name.
        screen-input = 0.
        modify screen.
      endif.
    endloop.

  • Disable checkbox for some records in a datasource

    Hi,
    I am having a datatable which is binded to a datasource. There is a check box for every record in the list. Check on some records and click the submit button. After that i want the records i have already submitted to be disabled(checkbox disabled) when the page is refreshed. Is there any way to do it. plz help. Thanks in advance

    I would have a table field to store the submitted items, so that when you open the page you can compare with that field and use <html:checkbox disabled="true"....> for the submitted records. I think it will work out. Is this only just for that session?

  • Bug : Datatable with disabled checkboxes

    Hello,
    I was able to implement a datatable with modify, delete links for each row.
    The following code works:
    <h:data_table id="DataTable" value="#{DataScreen.records}" var="record">
      <h:column>
         <f:facet name="header"><h:output_text value=" " /></f:facet>
         <h:command_link action="#{DataScreen.modifyAction}">
           <h:output_text value="#{DataScreen.modifyLabel" />
         </h:command_link>
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value=" " /></f:facet>
         <h:command_link action="#{DataScreen.deleteAction}">
           <h:output_text value="#{DataScreen.deleteLabel" />
         </h:command_link>
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value="Column1_Header" /></f:facet>
         <h:output_text value="#{DataScreen.column1}" />
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value="Column2_Header" /></f:facet>
         <h:output_text value="#{DataScreen.column2}" />
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
    </h:data_table>But, I added a third column of type boolean, which is displayed as a disabled checkbox.
    The table is displayed properly in the browser. But, when I click on the modify, delete links,
    the corresponding action method (DataScreen.modifyAction() or DataScreen.deleteAction())
    is not called.
    <h:data_table id="DataTable" value="#{DataScreen.records}" var="record">
      <h:column>
         <f:facet name="header"><h:output_text value=" " /></f:facet>
         <h:command_link action="#{DataScreen.modifyAction}">
           <h:output_text value="#{DataScreen.modifyLabel" />
         </h:command_link>
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value=" " /></f:facet>
         <h:command_link action="#{DataScreen.deleteAction}">
           <h:output_text value="#{DataScreen.deleteLabel" />
         </h:command_link>
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value="Column1_Header" /></f:facet>
         <h:output_text value="#{DataScreen.column1}" />
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value="Column2_Header" /></f:facet>
         <h:output_text value="#{DataScreen.column2}" />
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value="Column3_Header" /></f:facet>
         <h:selectboolean_checkbox value="#{DataScreen.column3}" disabled="true" />
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
    </h:data_table>I would be glad to know if there is any workaround.
    Thanks,
    Ajay

    I forgot to mention that there is no error message in the log file. The same page is displayed again
    after clicking on the Modify or Delete Link.
    If I remove the third column (disabled checkbox), the modify and delete links work fine.

  • Setting the color of a disabled checkbox...

    Hi,
    how do I set the color of a (disabled) JCheckBox because the following code does not work for me:
    jCheckBox1.setForeground(Color.BLACK);The background is that I don't want to have the checkbox in this grey (disabled) style, instead it should look like a "normal" checkbox (but disabled).
    Any ideas?
    Best regards
    - Stephan

    WindowsLookAndFeel uses native APIs to draw most of the controls. So, a disabled checkbox under Windows LAF will use the same API as the native disabled checkbox. You can install a custom JXLayer on that checkbox to prevent all the events from being passed to it - not the cleanest solution, but it will get you there (and make your users annoyed that they can't click on that checkbox).

  • ALV Grid - Hiding the values of a feild and disabling checkboxs

    Hello,
    I have a report that requires the need to hide certain fields in an ALV report as well as checkbox in certain rows.
    So example I want to turn the ALV's output from ....
    PO Number
    PO Item
    450000001
    001
    450000001
    002
    450000001
    003
    450000002
    001
    450000002
    002
    [   ] = checkbox
    to the desired output below ...
    PO Number
    PO Item
    450000001
    001
    002
    003
    450000002
    001
    002
    so baically I want to do 2 things
    1. Hide the values of certain fields if the value from the previous row is identital and ...
    2. .... only include checkboxes for each new value of that column by either hiding (preferable) or disabling them.
    Hope to hear from all of you soon.
    Thank you all and good day.

    Hi Chad Cheng,
    U have a variable IT_SORT in the FM REUSE_ALV_GRID_DISPLAY.
    IT_SORT -fieldname = ur fieldname 1.
    IT_SORT-up = 'X' or IT_SORT-Down = 'X'.
    Append it_sort.
    IT_SORT -fieldname = ur fieldname 2.
    IT_SORT-up = 'X' or IT_SORT-Down = 'X'.
    Append it_sort.
    awrd points if helpful
    Bhupal

  • How to Disable CheckBox for a Particular Condition

    Hi All,
    In my application, iam using one table having 5rows , with checkboxes,
    based on one condition i want to  make few checkboxes as default disable in the same table, and some checkboxes i shud make it as enable, so experts please help me how to disable some checkboxes.
    disable means even if we select it shud not get selected, like that is it possible,

    Hi Sushma,
    You can have one more attribute in the same node from where you are populating the table and bind this boolean attribute to the enabled property of your CheckBox.
    and by looping thriugh the table you can check for conditions and based on it set the Enability of the checkbox.
    for (int iRowsCount =0;iRowsCount < wdContext.node<name>().size();iRowsCount++)
    if (condition)
    // Disabling the Checkbox based on the condition
    wdContext.node<name>().get<name>ElementAt(iRowsCount).set<BooleanAttributeName>(false);
    Hope this helps!!
    Cheers,
    Arafat

  • Automatic Marking of a row Checkbox in tableview MULTISELECT

    Dear all,
    We are using a tableview with iterator and selectedrow-table in MULTISELECTMODE . The tableview gives back the table of the selected rows which have to be processed .
    After a users action and a fired event we have to store possible changed data out of the tableview into a internal memory table ( Export/Import to INDX database ).
    Therefore the user has to mark all rows with changed data to prevent that we have to check all rows (max. 20000 )out of the tableview for differences between the data in the memeory table and the tableview ( performance !! )
    Is ther any possibility to mark the checkbox on the left border of the data row automatically ( by event ? ) if one of the editable inputfields is changed by the user ? Otherwise the user has to scroll up to 40 columns to the left only to mark the row for saving the changed data .
    It would be great to get a hint !! Thanks in advance .

    Hi Craig,
    Yes this is clear .
    We already use that pattern tabid_row_cell for the cell identification in a javascript function.
    But how can I adress to the automaticly in MULTISELECTMODE added checkbox ( or the PrevSelectedtable ) which is not part of my columndefinitions table ? What is the name of that field ?
    The background of our problem with rowmarking is the fact that all data of an internal table are lost in event OnInputProcessing if we fill that table ( 45 columns )for the first time in OnInitialization and not in OnCreate like in most of the mentioned examples ( for instance with table sflight ) .
    On the other hand the OnCreate event will be proceeded after every click event , no matter if we use a stateful or stateless mode . And we want to read the database table for filling the internal table only once if we proceed the OnInit for the first time . 
    We have to select the data out from a ODS table with searchcriteria ( 4 values of table-keys ) from a pre-called start page . And the validation of automatic page attributes in OnCreate seems to fail in general , so all the needed attributes are empty in OnCreate.
    That's why we have to refill the internal table ( from INDX database ) everytime we proceed the OnInitialization event ( also after a simple pageDown ), so data changes inside the tableview object would have been overwritten without storing changes into the memory area of the internal table . This is an unwished emergency exit but we don't know how to deal with this on a better and easier way .
    I tried to save the internal table as a hidden page attribute in OnLayout getting an conversion error after syntax check - this worked very well in other cases .
    If there is a way to get a persistant existing internal table ( during all events ) and the tableview hold it's data changes we could forbear from the rowmarking .
    Best regards and hope that you can help
    Dirk Läufer

  • Disable checkbox in multiple record block with form personalization in r12

    hi
    i try to personalized form 'Autocreate Document' in purchasing super user responsibility in R12
    i want to disable some checkbox in block REQ_LINES that meet some criteria
    but why when personalized run, it disable all checkbox in all record in block REQ_LINES
    --Condition--
    Event trigger     : WHEN-VALIDATE-RECORD
    Trigger object    : REQ_LINES
    --Action--
    Type               : property
    Language         : all
    Object type     : item
    Target Object     : REQ_LINES.SELECT_LINE
    Properti name     : enabled
    value               : false
    please give me advice about this
    thank you very much for help

    I recommend you these forums for your question:
    Forums Home » Oracle Technology Network (OTN) » Products » Database » JVM
    Java in the Oracle Database
    Forums Home » Oracle Technology Network (OTN) » Technologies » Java » Java Server Pages (JSP)
    Java Server Pages (JSP)
    Forums Home » Oracle Technology Network (OTN) » Technologies » Java
    http://forums.oracle.com/forums/index.jsp?cat=24
    Joel Pérez

  • Disable checkbox in hirarichal ALV

    In my report I am displaying hirarichal ALV (without OOPS) with checkboxes at both header level and item level. Processing is like user select a header row and few of its items rows by selecting the respective checkboxes and hits a button which does some functionality.
    What I need is after hitting that button those selected checkbox( both header and item rows) should become disable. I am able to disable header level checkox by changing its value to '0' . But the same '0' value when I am passing to Item row checkboxes, they are not getting disabled. I have tried values like '-' but still item level checkboxes are not getting disabled. Kindly help.
    Regards,
    Rajneesh

    Hi Weishan,
    I think that you are forgetting to update your main data table.
    You are building new style tables, but you have to reapply these style tabs to the corresponding rows of your internal table, and <i>then</i> call refresh_table_display.
    Hope this helps...
    Phil

  • Disable Checkbox in OO ALV

    hi experts,
    after some processing of my alv, for records that are flagged, i will need to diable the checkbox.
    LOOP AT gt_rec_item INTO ls_alv WHERE locked_flag = 'X'.
          l_tabix = sy-tabix.
          REFRESH lt_celltab.
          ls_celltab-fieldname = 'CHECKBOX'.
          ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
          INSERT ls_celltab INTO TABLE lt_celltab.
          INSERT lines of lt_celltab INTO TABLE ls_alv-celltab.
          MODIFY gt_rec_item FROM ls_alv.
        CALL METHOD g_grid->refresh_table_display.
    by using the above codes, it does change the checkbox to be disabled, but it doesnt show in my alv.

    Hi Weishan,
    I think that you are forgetting to update your main data table.
    You are building new style tables, but you have to reapply these style tabs to the corresponding rows of your internal table, and <i>then</i> call refresh_table_display.
    Hope this helps...
    Phil

  • Keeping text intact in disabled checkbox

    hi all,
    If I disable a checkbox, I want to keep it's name/text not disabled
    (normal) would it be possible?
    Thanks

    You could probably get into overriding paint methods or creating a new UI delegate for the checkbox, but both of those are going to be fairly daunting. One solution would be to just create a label and place it next to a 'blank' checkbox. Change the foreground color to the same color you would expect the checkbox to use (I did it the sloppy way, I hardcoded it) and your set. If you run this little app you'll notice that the label doesn't quite line up like it would with a real checkbox, but it won't be noticeable as long as you don't have any other checkboxes nearby.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class CheckBoxTestFrame extends JFrame
       private JCheckBox _chkDummy;
       private JCheckBox _chkDisablingCheckbox;
       public CheckBoxTestFrame()
          super("Checkbox test frame");
          Container content = getContentPane();
          content.add(getCheckboxComponent(), BorderLayout.NORTH);
          content.add(getButtonPanel(), BorderLayout.SOUTH);
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          pack();     
          setVisible(true);
       private Component getCheckboxComponent()
          JPanel panel = new JPanel(new GridBagLayout());
          GridBagConstraints gbc = new GridBagConstraints();
          _chkDisablingCheckbox = new JCheckBox();
          _chkDisablingCheckbox.setMnemonic('n');
          gbc.anchor = gbc.WEST;
          panel.add(_chkDisablingCheckbox, gbc);
          JLabel lblNonDisablingLabel = new JLabel("Non disabling label");
          lblNonDisablingLabel.setForeground(Color.black);
          lblNonDisablingLabel.setLabelFor(_chkDisablingCheckbox);
          lblNonDisablingLabel.setDisplayedMnemonic(_chkDisablingCheckbox.getMnemonic());
          gbc.gridx = 1;
          gbc.weightx = 1.0;
          gbc.weighty = 1.0;
          panel.add(lblNonDisablingLabel, gbc);
          _chkDummy = new JCheckBox("Dummy checkbox for comparison");
          gbc.gridy = 1;
          gbc.gridx = 0;
          gbc.gridwidth = 2;
          gbc.weightx = 0.0;
          gbc.weighty = 0.0;
          panel.add(_chkDummy, gbc);
          return panel;     
       private Component getButtonPanel()
          JPanel panel = new JPanel();
          final JButton btnDisableEnable = new JButton("Disable");
          btnDisableEnable.setMnemonic('a');
          btnDisableEnable.addActionListener(new ActionListener()
             public void actionPerformed(ActionEvent e)
                boolean isDisable = btnDisableEnable.getText().startsWith("Dis");
                _chkDisablingCheckbox.setEnabled(!isDisable);
                _chkDummy.setEnabled(!isDisable);
                btnDisableEnable.setText(isDisable ? "Enable" : "Disable");
          panel.add(btnDisableEnable);
          return panel;
       public static void main(String[] args)
          new CheckBoxTestFrame();
    }

  • Need method to disable checkbox

    Hi,
    My alv Grid report contains checkbox at end of each row, when ever user select the checkbox , I am taking the particular line  to internal Table by using below code.
    DATA cl_gui_alv_grid TYPE REF TO cl_gui_alv_grid.
      CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
           IMPORTING
                e_grid = cl_gui_alv_grid.
      CALL METHOD cl_gui_alv_grid->check_changed_data.
    My problem is whenever user selects the checkbox the checkbox should go Gray(Disabled).
    Is there any method to do this, If so pls give sample code.
    I tried with SET_VISIBLE, but not working
    I am using version 4.6C
    Thanks
    kar
    Edited by: karthik karthik on Jan 9, 2008 7:52 PM

    hi karthik,
    this may be helpful to u
    You have to have in the Output Table:
    Types: begin of lt_io.
    include structure mara. " Your Structure
    Types: style_table type lvc_t_style.
    Types: end of lt_io.
    data: lt_io type table of lt_io,
    ls_layout type lvc_s_layo,
    lt_fcat type lvc_t_fcat,
    lo_grid type ref to cl_gui_alv_grid.
    field-symbols: <io> type lt_io,
    <fcat> type lvc_s_fcat.
    ... fill your output table ....
    ls_layout-stylefname = 'STYLE_TABLE'.
    loop at lt_io assigning <io>.
    PERFORM set_style USING 'CHECKBOX' "Your Filename
    CHANGING <io>.
    endloop.
    ... Fill Your Field Catalog lt_fcat
    read table lt_fcat assigning <fcat>
    where fieldname = 'CHECKBOX'.
    <fcat>-checkbox = 'X'.
    create grid control lo_grid.
    CALL METHOD lo_grid->set_table_for_first_display
    EXPORTING
    is_layout = ls_layout
    CHANGING
    it_fieldcatalog = lt_fcat
    it_outtab = lt_io[].
    FORM set_style
    USING iv_fieldname TYPE lvc_fname
    CHANGING cs_io TYPE io.
    DATA: ls_style TYPE lvc_s_styl,
    lt_style TYPE lvc_t_styl.
    ls_style-fieldname = iv_fieldname.
    if cs_io-checkbox = ' '.
    ls_style-style = cl_gui_alv_grid=>mc_style_enabled.
    else.
    ls_style-style = cl_gui_alv_grid=>mc_style_disabled.
    endif.
    ls_style-maxlen = 2.
    INSERT ls_style INTO TABLE io-style_table.
    ENDFORM. "set_style
    regards,
    sravanthi

  • Disable checkbox lists while clicking Radio button

    Hi ,
    I have a checkbox list come from LOV based on a select from database table.
    I have added a Radiobutton only (not redirect not submit since I have to restrict the option as this is based on requirement).Now I want to disable the checkbox while I am clicking the radio button .
    Is it any way possible .
    Thanks in advance .
    Cheers,
    Debashis.

    ok, I create two radio buttons (Enable and Disable)(P8_RADIO). I created a LOV of users with checkboxes (P8_CHECK). When I click on disable all the checkboxes are disabled and enabled when I click on enable.
    First add this to your radio
    P8_RADIO's HTML Form Element Attributes
    onclick="disable(this)"
    Then, add this to the page HTML Header
    <script language="JavaScript" type="text/javascript">
    <!--
    function disable(pThis)
    var trigger = document.wwv_flow.p_v02.value ;
    var rads = document.wwv_flow.p_v02 ;
    if (pThis.value == 'ENABLE')
    for(var i=0; i<rads.length;i++ )
    { document.wwv_flow.p_v02[i].disabled = false; }
    } //end of if
    else
    for(var i=0; i<rads.length;i++ )
    { document.wwv_flow.p_v02[i].disabled = true; }
    } //end of else
    } //end of disable funtion
    //-->
    </script>
    **note**p_v02 is the name of the checkboxes.
    Hopefully this will help you and i explained it better than I did last time

Maybe you are looking for