How to disable selective cells in a column of a table?

Hi
I have a Table UI element having 5 columns. 4 of this are non-editable and only one is editable i.e. having input field . The data is picked from the backend. The 5th column also gets default data from the backend, which the user can later on change.
But there is a condition, that only the input fields from that row onwards should remain enabled whose month field matches the current month. Rest all should become disabled or invisible.
I worte the code in the wdModifyView() which picks the current date, and then in a loop it checks all the rows for the condition. If it matches the condition, it comes out of the loop, else it sets the enable property of input field to false.
But when i run this application, all the cells become disabled, not selective cells.
Is there a way in which I can sort this problem, any API using which i can access each cell by its row number and column number and then disable it.
If anybody could please help, it is urgent.
Thanks & regards,
Anupreet

Anupreet,
Create a subnode with cardinality 1..1 and boolean attribute IsEnabled right under your data node. Write a supply function for this subnode, and set boolean attribute value depending on month in parentElement (parameter of supply function). Then bind InputField "enabled" property to this boolean attribute.
VS

Similar Messages

  • How set disable select matrix column header

    How set disable select matrix column header same Inventory-->Pick List Form
    Thanks Advance.

    Hi ,
    do u mean Price List Form Header...
    If Yes Means Try the Following,
    select case pVal.FormType
    case "155"
    Select Case pVal.Before_Action
    case True
    select case pval.ItemUid
    case "3"
    Select Case pVal.EventType
    Case SAPbouiCOM.BoEventTypes.et_CLICK
    if pval.row = 0  Then BubbleEvent = False : Exit Sub
    End Select
    End Select
    End Select
    Regards,
    Ganesh k

  • How to outline selected cells during drag and drop in the jtable

    Hi,
    I have spent a lot of time to find out how to outline selected cells during drag in the jtable, but I did not find the answer.
    Can anybody give me a tip, where to read more about this problem or even better, give an example...
    I have the following situation:
    1.Table has 10 rows and 10 columns
    2.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION) and setCellSelectionEnabled(true)
    3.user select 5 cells in 4th row (for example cell45,cell46,cell47,cell48 and cell49)
    4.user starts dragging. During dragging an outline should be drawn. Outline should be a rectangular with width of 5 cells and height of one cell. Outline should move according to the mouse position.
    5.rectangular disappears when dropped
    Regards,
    Primoz

    In "createTransferable" you can create a drag image
    which you can paint in "dragOver" and clear in "drop" method of DropTarget :
    package dnd;
    * DragDropJTableCellContents.java
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.swing.table.*;
    import java.awt.*;
    import java.awt.datatransfer.*;
    import java.awt.dnd.*;
    import java.awt.event.*;
    import java.awt.image.BufferedImage;
    import java.io.IOException;
    public class DragDropJTableCellContents extends JFrame {
        public DragDropJTableCellContents() {
            setTitle("Drag and Drop JTable");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            getContentPane().add(createTable("JTable"), BorderLayout.CENTER);
            setSize(400, 300);
            setLocationRelativeTo(null);
        private JPanel createTable(String tableId) {
            DefaultTableModel model = new DefaultTableModel();
            for (int i = 0; i < 10; i++) {
                model.addColumn("Column "+i);
            for (int i = 0; i < 10; i++) {
                String[] rowData = new String[10];
                for (int j = 0; j < 10; j++) {
                    rowData[j] = tableId + " " + i + j;
                model.addRow(rowData);
            JTable table = new JTable(model);
            table.getTableHeader().setReorderingAllowed(false);
            table.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
            table.setCellSelectionEnabled(true);
            JScrollPane scrollPane = new JScrollPane(table);
            table.setDragEnabled(true);
            TableTransferHandler th = new TableTransferHandler();
            table.setTransferHandler(th);
            table.setDropTarget(new TableDropTarget(th));
            table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
            JPanel panel = new JPanel(new BorderLayout());
            panel.add(scrollPane);
            panel.setBorder(BorderFactory.createTitledBorder(tableId));
            return panel;
        public static void main(String[] args) {
            new DragDropJTableCellContents().setVisible(true);
        abstract class StringTransferHandler extends TransferHandler {
            public int dropAction;
            protected abstract String exportString(JComponent c);
            protected abstract void importString(JComponent c, String str);
            @Override
            protected Transferable createTransferable(JComponent c) {
                return new StringSelection(exportString(c));
            @Override
            public int getSourceActions(JComponent c) {
                return COPY;
            @Override
            public boolean importData(JComponent c, Transferable t) {
                if (canImport(c, t.getTransferDataFlavors())) {
                    try {
                        String str = (String) t.getTransferData(DataFlavor.stringFlavor);
                        importString(c, str);
                        return true;
                    } catch (UnsupportedFlavorException ufe) {
                    } catch (IOException ioe) {
                return false;
            @Override
            public boolean canImport(JComponent c, DataFlavor[] flavors) {
                for (int ndx = 0; ndx < flavors.length; ndx++) {
                    if (DataFlavor.stringFlavor.equals(flavors[ndx])) {
                        return true;
                return false;
        class TableTransferHandler extends StringTransferHandler {
            private int dragRow;
            private int[] dragColumns;
            private BufferedImage[] image;
            private int row;
            private int[] columns;
            public JTable target;
            @Override
            protected Transferable createTransferable(JComponent c) {
                JTable table = (JTable) c;
                dragRow = table.getSelectedRow();
                dragColumns = table.getSelectedColumns();
                createDragImage(table);
                return new StringSelection(exportString(c));
            protected String exportString(JComponent c) {
                JTable table = (JTable) c;
                row = table.getSelectedRow();
                columns = table.getSelectedColumns();
                StringBuffer buff = new StringBuffer();
                for (int j = 0; j < columns.length; j++) {
                    Object val = table.getValueAt(row, columns[j]);
                    buff.append(val == null ? "" : val.toString());
                    if (j != columns.length - 1) {
                        buff.append(",");
                return buff.toString();
            protected void importString(JComponent c, String str) {
                target = (JTable) c;
                DefaultTableModel model = (DefaultTableModel) target.getModel();
                String[] values = str.split("\n");
                int colCount = target.getSelectedColumn();
                int max = target.getColumnCount();
                for (int ndx = 0; ndx < values.length; ndx++) {
                    String[] data = values[ndx].split(",");
                    for (int i = 0; i < data.length; i++) {
                        String string = data;
    if(colCount < max){
    model.setValueAt(string, target.getSelectedRow(), colCount);
    colCount++;
    public BufferedImage[] getDragImage() {
    return image;
    private void createDragImage(JTable table) {
    if (dragColumns != null) {
    try {
    image = new BufferedImage[dragColumns.length];
    for (int i = 0; i < dragColumns.length; i++) {
    Rectangle cellBounds = table.getCellRect(dragRow, i, true);
    TableCellRenderer r = table.getCellRenderer(dragRow, i);
    DefaultTableModel m = (DefaultTableModel) table.getModel();
    JComponent lbl = (JComponent) r.getTableCellRendererComponent(table,
    table.getValueAt(dragRow, dragColumns[i]), false, false, dragRow, i);
    lbl.setBounds(cellBounds);
    BufferedImage img = new BufferedImage(lbl.getWidth(), lbl.getHeight(),
    BufferedImage.TYPE_INT_ARGB_PRE);
    Graphics2D graphics = img.createGraphics();
    graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f));
    lbl.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY));
    lbl.paint(graphics);
    graphics.dispose();
    image[i] = img;
    } catch (RuntimeException re) {
    class TableDropTarget extends DropTarget {
    private Insets autoscrollInsets = new Insets(20, 20, 20, 20);
    private Rectangle rect2D = new Rectangle();
    private TableTransferHandler handler;
    public TableDropTarget(TableTransferHandler h) {
    super();
    this.handler = h;
    @Override
    public void dragOver(DropTargetDragEvent dtde) {
    handler.dropAction = dtde.getDropAction();
    JTable table = (JTable) dtde.getDropTargetContext().getComponent();
    Point location = dtde.getLocation();
    int row = table.rowAtPoint(location);
    int column = table.columnAtPoint(location);
    table.changeSelection(row, column, false, false);
    paintImage(table, location);
    autoscroll(table, location);
    super.dragOver(dtde);
    public void dragExit(DropTargetDragEvent dtde) {
    clearImage((JTable) dtde.getDropTargetContext().getComponent());
    super.dragExit(dtde);
    @Override
    public void drop(DropTargetDropEvent dtde) {
    Transferable data = dtde.getTransferable();
    JTable table = (JTable) dtde.getDropTargetContext().getComponent();
    clearImage(table);
    handler.importData(table, data);
    super.drop(dtde);
    private final void paintImage(JTable table, Point location) {
    Point pt = new Point(location);
    BufferedImage[] image = handler.getDragImage();
    if (image != null) {
    table.paintImmediately(rect2D.getBounds());
    rect2D.setLocation(pt.x - 15, pt.y - 15);
    int wRect2D = 0;
    int hRect2D = 0;
    for (int i = 0; i < image.length; i++) {
    table.getGraphics().drawImage(image[i], pt.x - 15, pt.y - 15, table);
    pt.x += image[i].getWidth();
    if (hRect2D < image[i].getHeight()) {
    hRect2D = image[i].getHeight();
    wRect2D += image[i].getWidth();
    rect2D.setSize(wRect2D, hRect2D);
    private final void clearImage(JTable table) {
    table.paintImmediately(rect2D.getBounds());
    private Insets getAutoscrollInsets() {
    return autoscrollInsets;
    private void autoscroll(JTable table, Point cursorLocation) {
    Insets insets = getAutoscrollInsets();
    Rectangle outer = table.getVisibleRect();
    Rectangle inner = new Rectangle(outer.x + insets.left,
    outer.y + insets.top,
    outer.width - (insets.left + insets.right),
    outer.height - (insets.top + insets.bottom));
    if (!inner.contains(cursorLocation)) {
    Rectangle scrollRect = new Rectangle(cursorLocation.x - insets.left,
    cursorLocation.y - insets.top,
    insets.left + insets.right,
    insets.top + insets.bottom);
    table.scrollRectToVisible(scrollRect);
    Edited by: Andre_Uhres on Nov 18, 2007 10:03 PM

  • How to print selected cells in numbers

    Does anyone know how to print selected cells in a Numbers spreadsheet, rather than printing the entire sheet?
    Also, how to save the selected cells as a pdf file without saving the irrelevant cells?

    Hi nmygs,
    How about this?
    Cell A1 is a Pop-Up Menu containing names of the various "Departments"
    Other cells contain formulas to find a match for whatever is chosen in A1 from the Very Big Data Table.
    Reusable Print Me table.
    Regards,
    Ian.

  • How to disable "Selection Security" in a correct way?

    hi experts!
    how to disable "Selection Security" in a correct way?
    !http://img689.imageshack.us/img689/2748/28668107.png!
    thanks!

    Hi...
    Open "Catalog Manager" and
    navigate to Shared -> "Shared Folder Name" (ex: Sample Sales) -> _Portal.
    Here you find all dashboards. Open the dashboard that you already enabled selection. In that dashboard folder you find one more folder with name: _selections*
    Delete the _selections* folder.
    You will get Enable option again in front end.
    All the best

  • How to disable drill option for one column in the WebI Report

    Hi,
    How to disable drill option in a column in WebI?
    When the Drill option is enabled by default all the column in the report will have that enabled,
    I ahve added Hierarchy in the Custom hierarhcy list in Universe.
    I am using BOXI3.1 WebI Reports.
    But I wanted only the hierarchy column to have that drill option enabled, rest all column should display text data.
    PLease let me know if you have any idea.
    Thanks in advance.
    Regards

    Cretae the variable at the report level (may be with the same definiton) and then use that variable in the table
    to disable the drill. It will be displayed as normal text object.
    Drill functionality is enabled only on the objetcs coming from the universe.
    Regards,
    Rohit
    Edited by: rohit12 on Mar 11, 2010 10:12 AM

  • How to disable selection parameter for a particular radio button

    hi experts,
    How to disable selection parameter(bukrs) for a particular radio button 'radio1'.

    hi,
    Check This Code (copy paste and run it ).
    U have to use MODIF ID along with the parameter.
    *----------------Option
    *---Background
    *---Summary Report
    PARAMETERS       : p_backgd RADIOBUTTON GROUP rad1
                       USER-COMMAND radio DEFAULT 'X'.
    PARAMETERS       : p_sumrep RADIOBUTTON GROUP rad1 .
    *----------------File
    PARAMETERS       : p_sumfl TYPE char255 modif id ABC  .
    PARAMETERS       : p_detfl TYPE char255 modif id ABC.
    *---------------Activate & Deactivate Screen Fields--------------------*
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF p_sumrep = 'X'.
          IF screen-group1  = 'ABC'.
            screen-input  = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDIF.
      ENDLOOP.
    <b>Please Reward Points & Mark Helpful Answers</b>
    To mark Helpful Answers ;click radio Button next to the post.
    RadioButtons
    <b>o</b> Helpful Answer
    <b>o</b> Very helpful Answer
    <b>o</b> Problem Solved.
    Click any of the above button next to the post; as per the anwers
    <b>To close the thread; Click Probelm solved Radio Button next to the post ,
    which u feel is best possible answers</b>

  • Grant select privilege to specific columns on a table to user in Oracle 9i

    Can anyone tell me how to grant select privilege to a user for specific columns in a table?
    I have tried the following statement
    GRANT SELECT (EMP_ID) ON EMP TO USER1
    But it's not working and I am getting this error "Missing ON Keyword".
    Please anyone tell me how to grant select privilege for specific columns.
    Edited by: 899045 on Nov 24, 2011 7:03 AM

    899045 wrote:
    Can anyone tell me how to grant select privilege to a user for specific columns in a table?
    I have tried the following statement
    GRANT SELECT (EMP_ID) ON EMP TO USER1
    But it's not working and I am getting this error "Missing ON Keyword".
    Please anyone tell me how to grant select privilege for specific columns.
    Edited by: 899045 on Nov 24, 2011 7:03 AMFrom the 9.2 SQL Reference manual, found at tahiti.oracle.com (http://docs.oracle.com/cd/B10501_01/server.920/a96540/statements_912a.htm#2062456)
    *"You can specify columns only when granting the INSERT, REFERENCES, or UPDATE privilege. "*

  • CPY-0007: Select list has fewer columns than destination table

    hello, I need your help, here is my problem is summarized in my example below
    Exemple
    SQL> copy from XX/X@BD1 to YY/Y@BD2 insert TABL1(COL1,COL2)-
    using select COL1,COL2 from TABL1
    Array fetch/bind size is 15. (arraysize is 15)
    Will commit when done. (copycommit is 0)
    Maximum long size is 80. (long is 80)
    CPY-0007: Select list has fewer columns than destination table
    DESC TABL 1
    COL1, COL2 DESC
    thank u.

    bahan wrote:
    hello, I need your help, here is my problem is summarized in my example below
    Exemple
    SQL> copy from XX/X@BD1 to YY/Y@BD2 insert TABL1(COL1,COL2)-
    using select COL1,COL2 from TABL1
    Array fetch/bind size is 15. (arraysize is 15)
    Will commit when done. (copycommit is 0)
    Maximum long size is 80. (long is 80)
    CPY-0007: Select list has fewer columns than destination table
    DESC TABL 1
    COL1, COL2 DESC
    thank u.
    00007,0, "Select list has fewer columns than destination table\n"
    // *Cause: On an APPEND operation or INSERT (when the table
    //          exists), the number of columns in the SELECT
    //          command is less than the number of columns in the
    //          destination table.
    // *Action: Re-specify the COPY command, making sure that the
    //          number of columns being selected agrees with the
    //          number in the destination table.

  • CPY0007: Select list has fewer columns than destination table

    Hi,
    I have two table TB in both Database A and Database B. TB in Database A has 100 columns, TB in Database B appended one more column which is nullable. I'm copy TB data from A to B using something like:
    insert into TB select * from TB@A where ...
    And I got error:
    CPY0007: Select list has fewer columns than destination table.
    Besides specify the 100 columns plus one new column, any better ways to handle this?
    Thanks a lot.

    This is kind of dangerous genarally but if you know the additional column is on the end this might work.
    insert into TB select a.*, null from TB@A a where ...If this is a regular operation, I would strongly suggest biting the bullet and specifying the column names. Using desc or all_tab_columns and a simple text editor it should take no more than five minutes, which is at least 12 hours less than you have been waiting for a workaround.

  • How to eliminate  select message  after Radio button in ADF tables

    how to eliminate select message after Radio button in ADF tables
    example <f:facet name="selection">
    <af:tableSelectOne>
    </af:tableSelectOne>
    </f:facet>
    output:
    radobutton select
    radiobutton select
    please help me regarding this issue.

    Hi,
    this usually has a text String in the header saying "Select and .." which can be changed through the property inspector for the TableSelectOne component
    Frank

  • How to disable single cell in table control.

    Hi my requirement is to disable single cell in the table control. Please let me know How to do this.
    If possible please provide good module pool examples.
    Harish

    Hi,
    I´m not quite sure if this is gonna work. You have to make a loop over the screen and then you can change some characteristics of it, which includes the Input option:
      LOOP AT SCREEN.
        IF screen-group1 = 'ABC'.
          screen-input = '0'.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    I´ve used this code for selection screens but could help you. Check in SE11 all options for SCREEN.

  • How to disable the cell from being edited

    how to make a column in a jtable ineditable .i.e when i click on a column in a table the cell is highlighted and the caret is show .
    due to this i am unable to use the double click on the left button coz as soon as i click once the left button the cell becomes editable and the caret appears.
    i wanna make it in editable / disable the editable option of the cell can anyone tell me how

    That's no problem if you're using DefaultTreeModel, you just rewrite the isCellEditable(col,row) function.
    For example here, you can only edit cells of the first column (but you can test each cell separately if you really want ;-) ):
    public boolean isCellEditable(int paramRow, int paramCol)
    if (paramCol == 0)
    return true;     
    return false;

  • Function that returns currently selected cell address or column

    Is there a function that returns the address (or just the column) of the currently selected cell? Simply put, something like =selectedcolumn.
    Background: I want to display help text in a cell, and I want that help text to change according to which cell (actually, which column) the user has selected. I have put the help texts in a hidden row. They take up too much space to be displayed all the time. I want one cell to contain the help text of the column of the currently selected cell.
    Trying to not use Filemaker for this project if possible
    Thanks for any help /Matt

    The Numbers method, using comments as Barry showed, is probably the best method.  An alternate method which is more complex would be to use an Applescript running in the background.  The Applescript can scan in the background for which cell/column is currently selected and write that cell/column address into a cell in your table. A formula in your table (most likely a lookup formula) can use that address to serve up the correct help text in a diffrerent cell in the table or in another table.
    Some problems with this methodare
    The script is not part of the document. It is a separate entity.
    The script must be started manually. It will not automatically start when the Numbers document is opened.
    If the Numbers document is to be used on other Macs, each would also need the script installed.

  • How to disable 'select display' on screen sharing?

    One improvement in Lion is Screen Sharings 'asking' of the current logged in user as to whether or not it is ok to share the screen.  While I understand the need for this in a multi-user environment, this is a unnecessary level of feature for most home users.  In fact, it's been a total pain and I'd like to know how to disable it.  Trying to remote support parents has become virtually impossible as they are unsure as to what it means to allow screen sharing when I attempt to connect.
    Anyone know how to disable this feaute and let Screen Sharing work as it did pre-lion?

    Apple menu > System Preferences > Sharing > Screen Sharing > Allow access for: account you want to log into
    Connect as that user.

Maybe you are looking for