Preventing check-box selection/de-selection

Hi
How can I prevent a user from selecting/de-selecting a check-box. I do not want to disable it.
Thanks
Sangeetha

I was able to stop selection with a mouse by removing the MouseListeners from the checkBox.
The same approach didn't work for removing KeyListeners, so I ended up adding a KeyListener and consuming the KeyStroke:
MouseListener[] actions = (MouseListener[])checkBox.getListeners(MouseListener.class);
for (int i = 0; i < actions.length; i++)
     checkBox.removeMouseListener( actions[i] );
// KeyListener[] keys = (KeyListener[])checkBox.getListeners(KeyListener.class);
// for (int i = 0; i < keys.length; i++)
//     checkBox.removeKeyListener( keys[i] );
checkBox.addKeyListener( new KeyAdapter()
     public void keyPressed(KeyEvent e) { e.consume(); }
});Does anybody know why I couldn't remove the KeyListener?

Similar Messages

  • Re- Single click in the check box ensure to select all check boxes

    Hi All,
    I have an issue to notify the urgency of the cart to the buyer while creating the cart.For that scenario we have a check box in the Basic data of shopping cart.I added the check box in the basic data. Now the  quote check box is available for all the line items.
    The requestor can select any check box in any line items,so whenever he selects the check box- automatically all the check box should get selected , if any of the check box get deselected then imediatelely all the check box in different line items also should get deselected.

    Hi Batchu,
    Thanks for your reply, See if you add any custom field it will come one by one in the basic data section. Adding one more check box doesnot work for this case.
    Moreover the problem is change to any particular line item can be captured in DOC_CHANGE_BADI but i cannot bring the same change to all line items (ie) If 3 rd line item check box is marked then immediately rest of the line item also should get marked.
    In the case of DOC_CHECK_BADI to identify the line on which the change happens is tough.
    SO thats is the problem for me to bring the logic in the code.
    Please if any one come across similar kind of issue please give your suggestion.
    Thanks,
    Sibi

  • How to get a check box on the selection screen

    Hi all
    can any body tell me how to get a check box on the selection screen

    parameter: pa_check   as checkbox.
    To define the input field of a parameter as a checkbox, you use the following syntax:
    PARAMETERS <p> ...... AS CHECKBOX ......
    Parameter <p> is created with type C and length 1. In this case, you may not use the additions TYPE and LIKE. Valid values for <p> are ' ' and 'X'. These values are assigned to the parameter when the user clicks the checkbox on the selection screen.
    If you use the TYPE addition to refer to a data type in the ABAP Dictionary of type CHAR and length 1 for which 'X' and ' ' are defined as valid values in the domain, the parameter automatically appears as a checkbox on the selection screen.
    REPORT DEMO.
    PARAMETERS: A AS CHECKBOX,
    B AS CHECKBOX DEFAULT 'X'.

  • Check Box On Standrad Selection-screen

    Hi Friends
    I am working on HR ABAP .I added 4 check boxes On Standrad Selection-screen. Its working on Development but its not working on production.can anyone suggest how its happend.

    Hello,
    A few questions.
    - what exactly is not working in production? 
    - do the check boxes appear at all?
    - did the changes get recorded on a change request and transported?
    - was the transport successful?
    - do the checkboxes 'work' in the QA envirionment?
    Regards
    Greg Kern

  • Handling Check Boxes in the selection screen

    Hi All,
    I have defined 3 Check Boxes in the selection screen and one box will be ticked as 'X" by default.
    I need to put restriction so that only any one should be selected as 'X' whenever user wish to select.
    Hence any time, when user selects a box, other two should be unchecked.
    How to put this kind of control?
    Regards
    Pavan

    I think you should go for 'Radiobutton'
    But if U want check box then
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF cb_option1 = 'X'.
          CLEAR cb_option2.
          MODIFY SCREEN.
        ELSEIF cb_option2 = 'X'.
          CLEAR cb_option1.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.

  • Uncheck one check box when we select other check boxes

    Hi All,
    This might be very simple question for experts. I just want to unselect one check box (this check box is to select 'ALL' and this will be selected by default) when we select any other check box (for individual categories) on same region. Can any one please suggest me how to implement this?
    Thanks in advance.
    Regards,
    Hari

    Hi Shijesh,
    Thanks for you reply.
    I'm using two items (check boxs), like P1_ALL and P1_TEST. I want to unselect P1_ALL when we select P1_TEST check box.Both the check boxes contains single value in List of values. For this I wrote script like
    <script type="text/javascript">
    function uncheckAll(pthis)
    elm = document.getElementsByName('P1_ALL');
    if(pthis.checked)
    elm.checked = false;
    </script>
    And in HTML form element attribute of P1_TEST, I have 'onclick=uncheckAll(this)'. But for some reason when I select 'P1_TEST', P1_ALL check box not getting un-selected.
    I would be grateful if you suggest what needs to correct in this one.
    Regards,
    Hari

  • Can you grey out/lock a certain part of a form you created after a check box has been selected?

    In Acrobat Pro 9 can I set up the form that I created to allow customers to select a check box and after they have selected the check box, the form will grey out/lock all of the information that they don't need to fill out and keep the rest of the information that needs to be filled out open?

    You can do this through scripting (if you are a JavaScripter). Check out this article by Thom Parker on Conditional Execution: http://acrobatusers.com/tutorials/conditional-execution
    Also, check out his website: http://www.pdfscripting.com

  • Problem in PRD to display check box parameter on selection screen

    hi ,
            i had one problem, i created one report which will show customer advances, for this report i created one selection screen, i transport req to QAS and PRD it shows fine. after that i need to add one more check box to that report selection screen. i transport reqt to QAS and PRD, in QAS it is woking fine but in PRD i am not able to see the check box which i was enterd. transport was perfect. i am saw the report coding in PRD that has the Check box statement. but it not comming,
    1, why the selection screen is not showing that check box parameter ?
    2, i had 19 selection fields is their any restriction to display the selection screen ?
    please try to solve it for me,
    thanq,
    rajesh.k

    Hello Rajesh,
    First check the Log of your TR. whether it is transported properly without any error or with error.
    again delete your Checkbox statement and write code again then try to transport again.
    there is no any limitation to provide option on selection screen. you can give as per your requirement.
    Regards,
    Sujeet

  • How to create check boxes dynamically in selection screen

    Hi Experts,
    I have a requirement of creating dynamic check boxes based on the number of records that are retrieved from a database table.
    Can you please suggest me how to achieve it.
    Regards
    RP.

    Hey RP,
    Try this way.
    REPORT ztest_program .
    DATA: it_data TYPE TABLE OF t001.
    DATA:check    TYPE char3.
    DATA:sy_index TYPE char2.
    DEFINE checkbox.
      parameters:&1 as checkbox.
    END-OF-DEFINITION.
    CHECKbox:c01,c02,c03,c04,c05,c06,c07,c08,c09,c10,
             c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,
             c21,c22,c23,c24,c25,c26,c27,c28,c29,c30,
             c31,c32,c33,c34,c35,c36,c37,c38,c39,c40.
    AT SELECTION-SCREEN OUTPUT.
      DESCRIBE TABLE it_data LINES sy-tfill.
      sy-tfill = 39. "This will be changed based on the itab records. I just hardcoded the value
      sy_index = 1.
      LOOP AT SCREEN.
        CONCATENATE 'C' sy_index INTO check.
        IF screen-name = check.
          IF sy_index GT sy-tfill.
            screen-active = '0'.
            MODIFY SCREEN.
            sy_index = sy_index + 1.
            CONTINUE.
          ENDIF.
          sy_index = sy_index + 1.
        ENDIF.
      ENDLOOP.
    Thanks
    Venkat.O

  • Check box in ALV selection screen

    Hi to all
              I like to know how to create a checkbox in the input screen of an ALV.

    What do you mean by ALV check box selection screen?
    ALV and selection screen check box( you are mixing two cases in your Question).
    You need use the Function moduel in the user command to get the updated data.
    in fieldcatalog you have to use INPUT = 'X' and EDIT = 'X' for the columns which ever you want edit.
    GET_GLOBALS_FROM_SLVC_FULLSCR
    follow the sample code.
    REPORT ZTEST_ALV_CHECK MESSAGE-ID ZZ .
    TYPE-POOLS: SLIS.
    DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
    IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
    L_LAYOUT TYPE SLIS_LAYOUT_ALV,
    X_EVENTS TYPE SLIS_ALV_EVENT,
    IT_EVENTS TYPE SLIS_T_EVENT.
    DATA: BEGIN OF ITAB OCCURS 0,
    VBELN LIKE VBAK-VBELN,
    POSNR LIKE VBAP-POSNR,
    CHK(1),
    color(4),
    END OF ITAB.
    SELECT VBELN
    POSNR
    FROM VBAP
    UP TO 20 ROWS
    INTO TABLE ITAB.
    X_FIELDCAT-FIELDNAME = 'CHK'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS = 1.
    X_FIELDCAT-INPUT = 'X'.
    X_FIELDCAT-EDIT = 'X'.
    X_FIELDCAT-CHECKBOX = 'X'.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    X_FIELDCAT-FIELDNAME = 'VBELN'.
    X_FIELDCAT-SELTEXT_L = 'VBELN'.
    X_FIELDCAT-HOTSPOT = 'X'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS = 2.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    X_FIELDCAT-FIELDNAME = 'POSNR'.
    X_FIELDCAT-SELTEXT_L = 'POSNR'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS = 3.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    L_LAYOUT-info_fieldname = 'COLOR'.
    *L_LAYOUT-ZEBRA = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    IS_LAYOUT = L_LAYOUT
    I_CALLBACK_PF_STATUS_SET = 'STATUS'
    I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
    IT_FIELDCAT = IT_FIELDCAT
    TABLES
    T_OUTTAB = ITAB
    EXCEPTIONS
    PROGRAM_ERROR = 1
    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.
    *& Form STATUS
    text
    -->P_EXTAB text
    FORM STATUS USING P_EXTAB TYPE SLIS_T_EXTAB.
    Pf status
    SET PF-STATUS 'STATUS'.
    ENDFORM. " STATUS
    *& Form USER_COMMAND
    text
    -->R_UCOMM text
    -->RS_SELFIELD text
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
    RS_SELFIELD TYPE SLIS_SELFIELD.
    DATA: GD_REPID LIKE SY-REPID, "Exists
    REF_GRID TYPE REF TO CL_GUI_ALV_GRID.
    IF REF_GRID IS INITIAL.
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
    E_GRID = REF_GRID.
    ENDIF.
    IF NOT REF_GRID IS INITIAL.
    CALL METHOD REF_GRID->CHECK_CHANGED_DATA .
    ENDIF.
    loop at itab where chk = 'X'.
    itab-color = 'C300'.
    modify itab index sy-tabix transporting color.
    endloop.
    RS_SELFIELD-refresh = 'X'.
    break-point.
    ENDFORM. "USER_COMMAND
    Regards
    Vijay Babu Dudla

  • Dynamic check box creation in selection screen

    Hello,
    I am trying to put up some check boxes dynamically in a selection screen. The number: of check boxes required and the 'checkbox label text' is to be retrieved from a database table. I have retrieved all these values in AT SELECTION-SCREEN OUTPUT event. But, I dont know how to create check box parameters using these dynamic values.  Please help..

    hi Giffin,
    Create a program with name 'Z_13317_DYN_CHKBOX' and paste the following code in it. Also make ensure that an include with name 'Z_13317_DYN_INCL' is not existing earlier because this program will be overwritten each and everytime.
    Z_13317_DYN_CHKBOX will take an integer as an input. After giving input, click on the button on selection screen.
    Suppose, if you have given 3 as input and if you have clicked the button, then 3 checkboxes will be generated on your selection screen.
    REPORT  Z_13317_DYN_CHKBOX.
    types :begin of t_itab1,
            line(72),
           end of t_itab1.
    data: incl type table of t_itab1 with header line.
    parameters: p_tab type i,
                p_frst type c no-display.
    selection-screen begin of line.
    selection-screen: pushbutton 2(20) but1 user-command cli1.
    selection-screen end of line.
    include z_13317_dyn_incl if found.
    initialization.
    at selection-screen output.
      if p_frst = ' '.
        p_frst = 'X'.
        perform crt_dyn_incl.
      endif.
    at selection-screen.
      case sy-ucomm.
        when 'CLI1'.
        perform crt_dyn_incl.
      endcase.
    *&      Form  crt_dyn_incl
    *       text
    form crt_dyn_incl .
      perform populate_incl.
      perform del_incl.
      insert report 'Z_13317_DYN_INCL' from incl.
      commit work.
      submit z_13317_dyn_chkbox via selection-screen with p_frst = p_frst.
    endform.                    " crt_dyn_incl
    *&      Form  del_incl
    *       text
    form del_incl .
      call function 'RS_DELETE_PROGRAM'
        exporting
         program                          = 'Z_13317_DYN_INCL'
         suppress_checks                  = 'X'
         suppress_popup                   = 'X'
         with_cua                         = ' '
         with_documentation               = ' '
         with_dynpro                      = 'X'
         with_includes                    = ' '
         with_textpool                    = ' '
         with_variants                    = ' '
      if sy-subrc <> 0.
      endif.
    endform.                    " del_incl
    *&      Form  populate_incl
    *       text
    form populate_incl .
      data: v_cnt type n.
      do p_tab times.
        v_cnt = v_cnt + 1.
        incl-line = 'parameters: '.
        concatenate incl-line 'p_chk' v_cnt into incl-line.
        concatenate incl-line 'as checkbox.' into incl-line separated by space.
        append incl.
        clear incl.
      enddo.
    endform.                    " populate_incl
    Regards,
    Sailaja.

  • Changing the Check Box color when selected/deselected

    How do I do this using the Action tab in Check Box Properties within Acrobat 7.0 (NOT DESIGNER)?
    I added the check boxes to the .PDF using the check box tool (Box Only-No Text).
    I am trying to fill the box green when selected and yellow when not selected via ACTION>Mouse Up>Run a JavaScript>Add and enteringthe javasript below with no success:
    if (this.rawValue == "1") {this.fillColor="0,255,0";} else {this.fillColor="255,255,0";}
    PLEASE HELP!!!

    If you are in AcroForm and not LiveCycle Designer, you not use LiveCycle Designer FormCalc syntax or LiveCycle Designer references.
    With a single check box:
    if(event.target.isBoxChecked(0)) {
       event.target.fillColor  = color.green;
    } else {
    event.target.fillColor = color.yellow;

  • Mulitible check boxes but only select one in each row who I do it with Acrobat Pro X?

    Dear Forum Readers
    First, if I should post my entry in the wrong forum, forgive me but I didn’t found the right place!
    I start to learn about the Adobe Pro X to create a form with different checkboxes, everything goes very well but now I decide it would be better if I could only check one checkbox in each row (see picture) .
    Each checkbox in each row has its own value from 1-4 (left checkbox=1 and right checkbox=4) and on the end of the form “Sub Total” all the value in each column who are checked I accounting together.
    1.  1. First I change the check boxes into radio button and give them a different value. Now I can only select one radio button in each row like I want it. But if I go to the field “Sub Total” (properties > calculate > pick) to account the value from each column together then I only can select the whole radio button group and not a single radio button. So my idea doesn’t work because the result is wrong.
    2.  
    2.T2. Then I got back and change the radio button again into check boxes. In each row I give the 4 check boxes the same name (so they act like radio buttons) and this works fine as well but with the same result as you read above. I could only “Pick” (properties > calculate > pick) the whole group of the check boxes and not only one and therefore my result at “Sub Total” is wrong again.
    I search the internet as well but I couldn’t found any working solution.
    Now I like to ask you kindly, is there somebody who can help me with the problem?
    I need the form as you can see at the picture but it should be only possible to check one checkbox in each row. But on the time I should be able to calculate each single column together.
    I would appreciate every idea (as simple as possible) because I am a beginner with Adobe Pro X.
    Thank you very much in advance!!!
    Nice regards
    Klaus

    Dear Gkaiseril
    Thank you very much for your answer!
    This I fears already J
    With JavaScript I have even less an idea than with the program Acrobat Pro XI. Is there not a other solution to solve this problem.
    Is it may possible that’s you can show me how such a JavaScript could look like or you know may a existing script?
    Anyway, thank your help.
    Nice regards
    Klaus

  • If radio button is checked then check box will be selected withoutexecuting

    hi,
    i have one doubt,
    is it possible if i select a radio button i want to check the check box at the same time and vice versa with out executing (f8) .
                       plz provide the solution,
                           thanks, in advance.

    REPORT  ZTEST_CHECK                             .
    parameters: r1 radiobutton group g1 default 'X' user-command ABC,
                r2 radiobutton group g1,
                p_check as checkbox.
    at selection-screen output.
    if r1 = 'X'.
    p_check = 'X'.
    endif.
    if r2 = 'X'.
    p_check = ' '.
    endif.
    Check this code,,
    Regards
    vijay

  • How to get System status Check Boxes into Query selection screen

    Dear experts,
    Pleas help in knowing how to get System status Check Boxes into quick view query (SQVI), selectionscreen.
    Regards
    Jogeswara Rao
    Edited by: K Jogeswara Rao on Jul 6, 2010 7:26 PM

    Problem solved through other Forum
    (Checkboxes not possible, some alternative solution to my requirement found)

Maybe you are looking for

  • How do I contact corporate about Verizon Wireless store scamming me?

    Hi all, On September 8th, I signed up for a MiFi 2-year contract that came along with a free Jetpack device. I specifically told the salesman to tell me about all of the charges in advance, so I wouldn't be surprised when the bill came. He told me it

  • Bc4j.xcfg, database connections and deploying ADF apps to oc4j

    I'm trying to understand how to enable custom database connections on a JDeveloper ADF application deployed to a stand-alone instance of OC4J. All entity objects were created as ADF Business Components. I looks like the db connection information used

  • How to Hide adress of the form from adress bar

    Hi all , i want to ask that is it possible to hide or change the adress of the form from the adress bar.....like when we run the form it shows the adress like http://develoment:8888/forms90/f90servlet?form=C:\GMS\Forms\GMS_SHIPMENT.fmx&userid=GMS/GMS

  • ASM Instance high availability.

    what woululd be the best practice to keep the ASM instance high available, Right now i have 3 dbs running on one ASM instance, i am wondering if this ASM instance has problem all the 3 dbs will be down....

  • I have lost my iphone,how to get

    Respected Sir, Requested to you that my iphone 5 with imei no:013421007288494 has been lost, So how to get my iphone back please do best support us.