How can I restrict the column dragging of JTable?

I have a requirement like, if we have any editable cell in the JTable, we should not allow the user to drag the columns at all. I tried with setDragEnabled(false) ..but its not giving the proper out put..... can any one come up with a solution for this?

table.getTableHeader().setReorderingAllowed(false)

Similar Messages

  • How can we restrict the type of components that can be dragged and dropped from the sidekick CQ

    how can we restrict the type of components that can be dragged and dropped from the sidekick CQ

    Generally drop the components at parasys. The components allowed on the parsys is control via the design mode of the page.So restrict components at the design of the parsys. http://dev.day.com/docs/en/cq/current/wcm/working_with_cq_wcm/using_edit_designandpreviewm odes.html#Design%20Mode

  • How can i  change the column label text in a alv table display

    how can i change the column label text in a alv table display??
    A similar kinda of question was posted previuosly where the requirement was the label text was needed and following below code was given as solution :
    <i>*  declare column, settings, header object
    DATA: lr_column TYPE REF TO cl_salv_wd_column.
    DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
    DATA: lr_column_header type ref to CL_SALV_WD_COLUMN_HEADER.
    get column by specifying column name.
    lr_column = lr_column_settings->get_column( 'COLUMN_NAME1' ).
    set Header Text as null
    lr_column_header = lr_column->get_header( ).
    lr_column_header->set_text( ' ' ).</i>
    My specific requirement is i have an input field on the screen and i want reflect that value as the column label for one of the column in the alv table. I have used he above code with slight modification in the MODIFYVIEW method of the view since it is a process after input. The component gets activated without any errors but while run time i get an error stating
    <i>"The following error text was processed in the system CDV : Access via 'NULL' object reference not possible."</i>
    i have checked in debugging and the error occured at the statement :
    <i>lr_column = lr_column_settings->get_column( 'CURRENT_YEAR' ).</i>Please can you provide me an alternative for my requirement or correct me if i have done it wrong.
    Thanks,
    Suri

    I found it myself how to do it. The error says that it is not able to find the reference object i.e  it is asking us to refer to the table. The following piece of code will solve this problem. Have to implement this in WDDOMODIFYVIEW method of the view. This thing works comrades enjoy...
      DATA : lr_cmp_usage TYPE REF TO if_wd_component_usage,
             lr_if_controller  TYPE REF TO iwci_salv_wd_table,
             lr_cmdl   TYPE REF TO cl_salv_wd_config_table,
             lr_col    TYPE REF TO cl_salv_wd_column.
      DATA : node_year  TYPE REF TO if_wd_context_node,
             elem_year  TYPE REF TO if_wd_context_element,
             stru_year  TYPE if_alv_layout=>element_importing,
             item_year  LIKE stru_year-i_current_year,
             lf_string    TYPE char(x),
      DATA: lr_column TYPE REF TO cl_salv_wd_column.
      DATA: lr_column_header TYPE REF TO cl_salv_wd_column_header.
      DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
    Get the entered value from the input field of the screen
    node_year  = wd_context->get_child_node( name = 'IMPORTING_NODE' ).
    elem_year  = node_year->get_element( ).
      elem_year->get_attribute(
       EXPORTING
        name = 'IMPORT_NODE-PARAMETER'
       IMPORTING
        value = L_IMPORT_PARAM ).
      WRITE L_IMPORT_PARAM TO lf_string.
    Get the reference of the table
      lr_cmp_usage  =  wd_this->wd_cpuse_alv( ).
      IF lr_cmp_usage->has_active_component( ) IS INITIAL.
        lr_cmp_usage->create_component( ).
      ENDIF.
      lr_if_controller  = wd_this->wd_cpifc_alv( ).
      lr_column_settings = lr_if_controller->get_model( ).
    get column by specifying column name.
      IF lr_column_settings IS BOUND.
        lr_column = lr_column_settings->get_column( 'COLUMN_NAME').
    set Header Text as null
        lr_column_header = lr_column->get_header( ).
        lr_column_header->set_text( lf_string ).
    endif.

  • How can i restrict the Expenditure Type values at a specific OU ?

    Dear Guys,
    I would like to ask about the Expenditure Types,
    I have implemented two projects for different Operating Units ,
    when navigating to any Projects responsibilty,and navigating the Expenditure Type field
    the values exist are all the values implemented across the OU not the values entered at this OU
    How can i restrict the Expenditure Type values at a specific OU
    Regards
    Amr Hussien

    Hello
    When you set up a project there is an option called Transaction Control.
    This option allow you to list the allowed or restricted elements of costs for the project.
    You may enter the transaction control on a project template and that will be copied to any new project.
    The cost elements may be expenditure types, expenditures categories, suppliers, employees, etc.
    In your case, I suggest to set up specific project templates for each operating units. On each template enter the list of allowed expenditures types for that OU.
    Doing so, the system restricts users from entering any expenditure item, supplier invoice, purchase cost etc, against an expenditure type, which is not allowed.
    Dina

  • How can i restrict the qty/value at the time of invoice

    Hi,
    Can you plesae tell me at the time of MIRO how can i restrict the user not to enter the qty more than in MIGO & PO
    Thanx

    You cannot restrict the qty in MIRO. because it is used for partial invoice receipt.
    E.g  in some cases 100 nos of qty might have received in one GR. But the supplier may give 3 invoices for this. that is the reason u cant restict this
    reward if useful
    SK

  • How can I restrict the total no. of recs. per physical page

    Hi !
    I have created a report and I am saving that in a text file. The
    problem is that when I try to take the output on the printer
    then the total no of records overflows to the next pages and the
    next page heading comes much below to it's designated place.
    Max.no of records property in the repaeting frame is for the
    logical page.
    How can I restrict the max. number of records per physical page ?
    Any pointer will be welcome,
    Thanks in advance,
    Shobhit
    null

    Just for fun (and in case this wasn't done to death in the other thread), the rule posted here states:
    Most years have 365 days, but a leap year has 366 days. That adds up to 52 weeks (where each week is exactly 7 days) PLUS 1 or 2 additional days. The year 2012 has exactly 366 days.Now if the year starts on a Sunday in a non-leap year, you end up with 53 Sundays. Or if either of the first two days lands on a Sunday during a leap year, then you can also get 53 Sundays.>
    which allows a calculation like this:
    with test_data as
         ( select rownum + 1999 as test_year from dual
           connect by rownum <= 15 )
    select test_year
         , case
              when first_day = 'SUN'
              or ( first_day = 'SAT' and leap_year = 'Y' )
                 then 53
              else 52
           end as sundays
    from   ( select test_year
                  , to_char(to_date(d.test_year||'-01-01','YYYY-MM-DD'),'DY', 'NLS_DATE_LANGUAGE=ENGLISH') first_day
                  , case extract(day from last_day(to_date(d.test_year||'-02','YYYY-MM'))) when 29 then 'Y' else 'N' end as leap_year
             from   test_data d );
    TEST_YEAR    SUNDAYS
          2000         53
          2001         52
          2002         52
          2003         52
          2004         52
          2005         52
          2006         53
          2007         52
          2008         52
          2009         52
          2010         52
          2011         52
          2012         53
          2013         52
          2014         52
    15 rows selected.

  • How can I restrict the usage of a iPhone 5c?  I would only like my daughter to be able to use her phone between 7am and 10pm central.  Any ideas how to do this or an app to use?

    How can I restrict the usage of a iPhone 5c?  I would only like my daughter to be able to use her phone between 7am and 10pm central.  Any ideas how to do this or an app to use?

    Hi! i believe there is no preinstalled app than can do that for you, however you can use a third party software, such as this: http://www.bitworks-engineering.co.uk/Apps/TimeLock_App/Welcome.html or this https://itunes.apple.com/us/app/parental-timelock-time-limit/id689577280?mt=8

  • How can i restrict the selecting file type to XML and TXT in file upload..

    Hi,
    I am using Struts Upload Bean. I am also using html:file tag in the JSP. Now when i click on the browse button, A file dialogue window appears. The problem id the i want to show only text and xml files in the dialog box. Now the files of type combo box in the dialogue box is showing *.*, *.html, *.pictures (jpg/gif) options. In place of this i need to show only txt and xml files. How can i restrict the file type to XML and TXT
    Regards,
    Sudheesh...

    Hi,
    the demo doesn't keep track of this. If you want then this feature isn't implemented. You will also see that the document is uploaded in a directory without changing the file name (e.g. adding the SR number). This however can be done and would be the way to do it
    Frank

  • How Can I Restrict the times my BT Homehub 2.0 is ...

    How Can I Restrict the times my BT Homehub 2.0 is used?
    i want to make sure that the kids dont go back online on their wireless laptops after i have gone to bed!!!
    how can i restrict the useage times (say 11am - 11pm) for the hub/individual users - WITHOUT taking the plug out when I go to bed!!!
    thanks in advance
    Paul

    belial wrote:
    @meaga-byte: the second of those two options can be achieved by using the "BT Powersave" function. This does mean that *everyone* will lose wifi accessibility, so no watching iPlayer be for _you_ drift off! PowerSave will turn all your wifi off and back on between particular times.
    This seems a more user friendly option for thoes who are not ofay with IP addresses etc.
    Unless Paul wants to use wifi while in bed
    If I've helped, just click the Star - Every little bit helps
    If you can't fix it with a hammer, you've got an electrical problem.

  • How can we restrict the objects..?

    Hi it was a question asked in an interview.
    How can we restrict the object..?
    is it with RSSM and PFCG settings..?
    Correct me if I am wrong..!
    Cheers,
    Vasu

    hi Vasu,
    if the question is restriction in reporting by authorization, then you are right. take a look some bw authorization docs
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/adeac294-0501-0010-5a97-9ac5d562b1be
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1b439590-0201-0010-ea8e-cba686f21f06
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/39f29890-0201-0010-1197-f0ed3a0d279f
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/a6329790-0201-0010-b4a1-fdd384045fdb
    hope this helps.

  • How can we restrict the other user to add their user id's to the user group created in SQ03?

    Hello All,
    How can we restrict the other user to add their user id's to the user group created in SQ03?
    When we enter the user group name and click on "Assign users and Infosets" button in the attached pic "User Group" .
    I was able to enter my user id in other user groups. How to Grey out the other rows in the attached pic "User Group 1".

    How strange I answered (or at least helped) this very same question earlier today. Here the link to my previous answer then:
    http://scn.sap.com/thread/3536135

  • How can we restrict the users/planners for a planning book?

    Hi experts,
    How can we restrict the users/planners for a planning book?
    Thanks,
    Naga.

    Hi Naga,
    we describe this in our SAP Demand and Supply Network Planning rapid-deployment solution.
    Access this area directly via
    http://service.sap.com
    /rds-dpa
    In the configuration guide Demand Planning Settings, Macros and Chart
    Engine (DP3) read Appendix: Setting up Roles and
    Authorizations.
    BR Frank

  • How can we restrict the absence status (Which are not yet to be approved)in team calendar(MSS)

    How can we restrict the absence status (Which are not yet to be approved)in team calendar(MSS)

    Hi user570596,
    I think there is no method to actually restrict the date picker popup, but you can use the ApexLib Framework (http://apexlib.sourceforge.net/) to define a min/max value for your date field. This will prevent the user from submitting the page when the date value is outside the defined range.
    See http://inside-apex.blogspot.com/2007/03/min-max-value-validation-in-browser.html
    for details.
    Patrick
    Check out my APEX-blog: http://inside-apex.blogspot.com
    Check out the ApexLib Framework: http://apexlib.sourceforge.net

  • How can i know the Column Position in a table

    Dear all
    How can i know the Column position in a table ..
    For example :-
    I have a table
    Desc EMPLOYEES
    Empid
    Ename
    Sal
    I want to know the Empid is in 1st position , ename is in 2nd position and sal is in 3rd position .
    is it possible ?

    Hi
    SELECT * FROM ALL_TAB_COLUMNS WHERE
    TABLE_NAME ='EMPLOYEES' AND owner=<OwNeR nAmE> ;)

  • How can i restrict the change of serial number in delivery document ?

    how can i restrict the manual change of serial number in delivery document ?

    I can tell you that you are observing standard program behavior.       
    By using a reference document for a return delivery, you are only      
    receiving proposal values for a new document. The posting will not     
    create a permanent link between the referred document and the return   
    delivery document.                                                                               
    Hence it is allowed to change various fields. This applies not only    
    to serial numbers, but to storage location, quantity and other fields.

Maybe you are looking for

  • Need to convert ajp video file to quicktime

    Need to convert ajp video file to quicktime any ideas?

  • How to add Short cut to DISCONNECT and LOGOFF

    We have an App that requires Remote Desktop Services Having installed & configured it. We asked the software company to setup App. This work fine in Desktop session i.e users login via mstsc and get presented with a desktop. But unfortunately not as

  • How to make pdf files smaller

    Hello, is there a simple way to make a pdf file smaller. E.g. to convert 2Mb file into 100-200Kb file in one or 2 steps? And is there a program to make it for several files - folder - in one action?

  • Itunes podcast conversion to iphone

    I downloaded a bunch of Bernina podcasts and then synced them to my iphone. Itunes tells me that some of them aren't in a format for the iphone and didn't sync. So I selected one of them and clicked on the itunes option to make it available for the i

  • Cisco PCA contacts not importing all of them

    Trying to get contacts imported into Cisco PCA (Cisco Unity Personal Communications Assistant) so we have certain users call by voice command... I am able to get most of the contacts in, but only about 50% will import from Exchange.  I cannot figure