JRadioButton grouped in a table cell. Help Needed.

Hello...
I am looking for code samples or exaples of how to implement a group of 3 radio buttons in a column of each row i create. I have not been able to find anything and I would appreciate any leads or code samples.
basically i have 4 or 5 columns and one of the colums will take 3 radio buttons but only 1 of the 3 can be selected at a time.
this is kind of what my table looks like.
ListTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {"000000000061", "05/05/2005", "this is where the 3 radio buttons will be grouped","05/05/2004"},
                {null, null, null, null}
            new String [] {
                "List ID", "Expiration Date", "Status", "Date Created"
            Class[] types = new Class [] {
                java.lang.Object.class, java.lang.Object.class, java.lang.Boolean.class, java.lang.Object.class
            boolean[] canEdit = new boolean [] {
                false, false, true, false
            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
        jPanel2.add(ListTable, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 44, 440, 130));Thanks very much.
S

Hope this helps :import javax.swing.*;
import javax.swing.table.*;
import java.util.Date;
import java.util.Vector;
import java.awt.*;
import java.awt.event.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
public class TableTestPanel extends JPanel {
     private static final String[] COLUMN_NAMES = {"List ID", "Expiration Date", "Status", "Date Created"};
     private static final DateFormat DATE_FORMAT = new SimpleDateFormat("dd/MM/yyyy");
     private static class StatusPanel extends JPanel {
          private JRadioButton theSingleOption;
          private JRadioButton theMarriedOption;
          private JRadioButton theDivorcedOption;
          public StatusPanel() {
               super(new GridLayout(3, 1));
               setOpaque(true);
               ButtonGroup buttonGroup = new ButtonGroup();
               theSingleOption = new JRadioButton("Single");
               theSingleOption.setOpaque(false);
               add(theSingleOption);
               buttonGroup.add(theSingleOption);
               theMarriedOption = new JRadioButton("Married");
               theMarriedOption.setOpaque(false);
               add(theMarriedOption);
               buttonGroup.add(theMarriedOption);
               theDivorcedOption = new JRadioButton("Divorced");
               theDivorcedOption.setOpaque(false);
               add(theDivorcedOption);
               buttonGroup.add(theDivorcedOption);
          public Status getStatus() {
               if (theMarriedOption.isSelected()) {
                    return Status.MARRIED;
               } else if (theDivorcedOption.isSelected()) {
                    return Status.DIVORCED;
               } else {
                    return Status.SINGLE;
          public void setStatus(Status status) {
               if (status == Status.MARRIED) {
                    theMarriedOption.setSelected(true);
               } else if (status == Status.DIVORCED) {
                    theDivorcedOption.setSelected(true);
               } else {
                    theSingleOption.setSelected(true);
     private static class Status {
          static final Status SINGLE = new Status("Single");
          static final Status MARRIED = new Status("Married");
          static final Status DIVORCED = new Status("Divorced");
          private final String myName; // for debug only
          private Status(String name) {
               myName = name;
          public String toString() {
               return myName;
     private static class TableEntry {
          private static int instanceNumber;
          private Long theId;
          private Date theExpirationDate;
          private Status theStatus;
          private Date theCreationDate;
          public TableEntry() {
               instanceNumber++;
               theId = new Long(instanceNumber);
               theExpirationDate = new Date();
               theStatus = Status.SINGLE;
               theCreationDate = new Date();
          public TableEntry(Long anId, Date anExpirationDate, Status aStatus, Date aCreationDate) {
               theId = anId;
               theExpirationDate = anExpirationDate;
               theStatus = aStatus;
               theCreationDate = aCreationDate;
          public Long getId() {
               return theId;
          public Date getExpirationDate() {
               return theExpirationDate;
          public Status getStatus() {
               return theStatus;
          public Date getCreationDate() {
               return theCreationDate;
          public void setId(Long anId) {
               theId = anId;
          public void setExpirationDate(Date anExpirationDate) {
               theExpirationDate = anExpirationDate;
          public void setStatus(Status aStatus) {
               theStatus = aStatus;
          public void setCreationDate(Date aCreationDate) {
               theCreationDate = aCreationDate;
     private static class MyTableModel extends AbstractTableModel {
          private Vector theEntries;
          public MyTableModel() {
               theEntries = new Vector();
          public void add(TableEntry anEntry) {
               int index = theEntries.size();
               theEntries.add(anEntry);
               fireTableRowsInserted(index, index);
          public void remove(int aRowIndex) {
               if (aRowIndex < 0 || aRowIndex >= theEntries.size()) return;
               theEntries.removeElementAt(aRowIndex);
               fireTableRowsDeleted(aRowIndex, aRowIndex);
          public int getRowCount() {
               return theEntries.size();
          public String getColumnName(int column) {
               return COLUMN_NAMES[column];
          public Class getColumnClass(int columnIndex) {
               switch (columnIndex) {
                    case 0:
                         return Long.class;
                    case 1:
                         return Date.class;
                    case 2:
                         return Status.class;
                    case 3:
                         return Date.class;
               return Object.class;
          public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
               TableEntry entry = (TableEntry) theEntries.elementAt(rowIndex);
               switch (columnIndex) {
                    case 0:
                         try {
                              entry.setId(new Long(Long.parseLong(aValue.toString())));
                         } catch (NumberFormatException nfe) {
                              return;
                         break;
                    case 1:
                         entry.setExpirationDate((Date)aValue);
                         break;
                    case 2:
                         entry.setStatus((Status)aValue);
                         break;
                    case 3:
                         entry.setCreationDate((Date)aValue);
                         break;
                    default :
                         return;
               fireTableCellUpdated(rowIndex, columnIndex);
          public boolean isCellEditable(int rowIndex, int columnIndex) {
               return true;
          public int getColumnCount() {
               return 4;
          public Object getValueAt(int rowIndex, int columnIndex) {
               TableEntry entry = (TableEntry) theEntries.elementAt(rowIndex);
               switch (columnIndex) {
                    case 0:
                         return entry.getId();
                    case 1:
                         return entry.getExpirationDate();
                    case 2:
                         return entry.getStatus();
                    case 3:
                         return entry.getCreationDate();
               return null;
     private static class DateRenderer extends DefaultTableCellRenderer {
          public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
               super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
               if (!(value instanceof Date)) return this;
               setText(DATE_FORMAT.format((Date) value));
               return this;
     private static class DateEditor extends AbstractCellEditor implements TableCellEditor {
          private JSpinner theSpinner;
          protected Object value;
          public DateEditor() {
               theSpinner = new JSpinner(new SpinnerDateModel());
               theSpinner.setOpaque(true);
               theSpinner.setEditor(new JSpinner.DateEditor(theSpinner, "dd/MM/yyyy"));
          public Object getCellEditorValue() {
               return theSpinner.getValue();
          public Component getTableCellEditorComponent(JTable table, Object value,
                                                                  boolean isSelected,
                                                                  int row, int column) {
               theSpinner.setValue(value);
               if (isSelected) {
                    theSpinner.setBackground(table.getSelectionBackground());
               } else {
                    theSpinner.setBackground(table.getBackground());
               return theSpinner;
     private static class StatusEditor extends AbstractCellEditor implements TableCellEditor {
          private StatusPanel theStatusPanel;
          public StatusEditor() {
               theStatusPanel = new StatusPanel();
          public Object getCellEditorValue() {
               return theStatusPanel.getStatus();
          public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
               theStatusPanel.setStatus((Status)value);
               if (isSelected) {
                    theStatusPanel.setBackground(table.getSelectionBackground());
               } else {
                    theStatusPanel.setBackground(table.getBackground());
               return theStatusPanel;
     private static class StatusRenderer extends StatusPanel implements TableCellRenderer {
          public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
               setStatus((Status)value);
               if (isSelected) {
                    setBackground(table.getSelectionBackground());
               } else {
                    setBackground(table.getBackground());
               return this;
     private MyTableModel theTableModel;
     private JTable theTable;
     public TableTestPanel() {
          super(new BorderLayout(0, 5));
          setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
          theTableModel = new MyTableModel();
          theTable = new JTable(theTableModel);
          theTable.setDefaultEditor(Date.class, new DateEditor());
          theTable.setDefaultRenderer(Date.class, new DateRenderer());
          theTable.setDefaultEditor(Status.class, new StatusEditor());
          theTable.setDefaultRenderer(Status.class, new StatusRenderer());
// comment out the two preceding lines and uncomment the following one if you want a more standard editor
//          theTable.setDefaultEditor(Status.class, new DefaultCellEditor(new JComboBox(new Status[]{Status.SINGLE, Status.MARRIED, Status.DIVORCED})));
          add(new JScrollPane(theTable), BorderLayout.CENTER);
          JToolBar toolBar = new JToolBar();
          toolBar.setFloatable(false);
          toolBar.add(new AbstractAction("Add new") {
               public void actionPerformed(ActionEvent e) {
                    theTableModel.add(new TableEntry());
                    packTable();
          toolBar.add(new AbstractAction("Remove") {
               public void actionPerformed(ActionEvent e) {
                    theTableModel.remove(theTable.getSelectedRow());
          add(toolBar, BorderLayout.NORTH);
     private void packTable() {
          TableColumnModel columnModel = theTable.getColumnModel();
          int columnCount = theTable.getColumnCount();
          int rowCount = theTable.getRowCount();
          int[][] preferredHeights = new int[columnCount][rowCount];
          TableCellRenderer renderer;
          Component comp;
          for (int col = 0; col < columnCount; col++) {
               renderer = columnModel.getColumn(col).getCellRenderer();
               if (renderer == null) {
                    renderer = theTable.getDefaultRenderer(theTableModel.getColumnClass(col));
               for (int row = 0; row < rowCount; row++) {
                    comp = renderer.getTableCellRendererComponent(theTable, theTableModel.getValueAt(row, col), false, false, row, col);
                    preferredHeights[col][row] = (int) comp.getPreferredSize().getHeight();
          for (int row = 0; row < rowCount; row++) {
               int pref = 0;
               for (int col = 0; col < columnCount; col++) {
                    pref = Math.max(pref, preferredHeights[col][row]);
               theTable.setRowHeight(row, pref);
     public static void main(String[] args) {
          final JFrame frame = new JFrame("TestRadioButtonRenderer");
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setContentPane(new TableTestPanel());
          SwingUtilities.invokeLater(new Runnable() {
               public void run() {
                    frame.setSize(400, 300);
                    frame.show();
}

Similar Messages

  • Grouping Rules in PL/SQL Help needed

    Hi I have a requirement where I wan to group based on the below scenario
    I have a Table_A
    Table_A strcuture:
    create table table_a
    code number,
    name varchar2 (100),
    city varchar2 (100),
    dept varchar2 (100));;
    insert into table_a
    values
    1,'ABC','EA','A');
    insert into table_a
    values
    1,'ABC','EA1','A');
    insert into table_a
    values
    2,'BCD','EA2','A');
    insert into table_a
    values
    2,'ABC','EA3','A'');
    insert into table_a
    values
    3,'KBC','EA,'A');
    insert into table_a
    values
    3,'ABC','EA,'A');
    wan to group the above table data based on name,city,dept
    I wan the data  as
    1           ABC             EA1    A
                 BCD            EA2     A
    2           BCD            EA2     A
                 ABC            EA3     A
    3           KBC            EA      A
                 BCD            EA      A
    Kindly any help will be needful for me

    This is more of a presentation layer problem I would not handle it in SQL. For example if the presentation layer is SQL Plus you can use BREAK command, like this.
    SQL> select * from table_a;
          CODE NAME       CITY       DEPT
             1 ABC        EA         A
             1 ABC        EA1        A
             2 BCD        EA2        A
             2 ABC        EA3        A
             3 KBC        EA         A
             3 ABC        EA         A
    6 rows selected.
    SQL> break on code
    SQL>
    SQL> select * from table_a order by code;
          CODE NAME       CITY       DEPT
             1 ABC        EA         A
               ABC        EA1        A
             2 BCD        EA2        A
               ABC        EA3        A
             3 KBC        EA         A
               ABC        EA         A
    6 rows selected.
    But if you still wish to do it in SQL the right way is to use ROW_NUMBER like this.
    SQL> clear breaks
    breaks cleared
    SQL>
    SQL> select * from table_a;
          CODE NAME       CITY       DEPT
             1 ABC        EA         A
             1 ABC        EA1        A
             2 BCD        EA2        A
             2 ABC        EA3        A
             3 KBC        EA         A
             3 ABC        EA         A
    6 rows selected.
    SQL> select decode(rno, 1, code) code
      2       , name
      3       , city
      4       , dept
      5    from (
      6           select row_number() over(partition by code order by name) rno
      7                , t.*
      8             from table_a t
      9         )
    10  /
          CODE NAME       CITY       DEPT
             1 ABC        EA         A
               ABC        EA1        A
             2 ABC        EA3        A
               BCD        EA2        A
             3 ABC        EA         A
               KBC        EA         A
    6 rows selected.

  • Robohelp HTML 9 hyperlinks in table cells help

    Hi,
    I'm creating a table in robohelp html 9 and adding hyperlinks in the table cells. If the hyperlink is the first word in that cell robohelp is adding styling code to the link eg <td><a href="#" style="color: #0000ff; text-decoration: underline; ">test</a></td>.
    If I add a link to the second word in a table cell the styling does not appear or even if I add a space before the link the code does not appear eg <td>&#160;<a href="#">test</a> </td>.
    The code appears when I flick between design and HTML views but it does not make any difference in which view I create the link.
    No matter how many times I delete this code is keeps coming back. Can  anyone please help me? Is there some default that gives this the styling  code?Does anyone else get this issue?
    A table with the different examples is below. It was created in design view by clicking table>insert table>OK. Links added by clicking the insert hyperlink button.
    <table style="border-collapse: separate; border-collapse: separate;" cellspacing="0"
             width="33.333%" border="1">
        <col style="width: 100%;" />
        <tr>
            <td><a href="#" style="color: #0000ff; text-decoration: underline; ">test
             that has the added code</a></td>
        </tr>
        <tr>
            <td>&#160;<a href="#">test with space in front of link</a> </td>
        </tr>
        <tr>
            <td><a href="#" style="color: #0000ff; text-decoration: underline; ">test</a></td>
        </tr>
        <tr>
            <td>A <a href="#">test</a> </td>
        </tr>
    </table>
    Thanks in advanced

    I have the same problem with those stupid links in tables - I've been working on this for HOURS and HOURS...... Based on previous experience, I assumed it must only be me and an ill-formed stylesheet. The table/link issue just came to my attention because I am in the process of changing styles/formats to a new company standard (new link color) and thought I really screwed my CSS up as I was changing things!
    My only workaround thusfar has been to rewrite some data in the tables so that text will precede the link (yes, I did).  And where I just couldn't do that, I resigned myself to the problem and forced a different color on the links (changing the #0000ff).  One plus was that RH didn't rewrite the color code once it was changed manually..... but then I realized later that I didn't consider the hover color when I did this, so I now have to go back and correct them. 
    So glad to find your post...........
    I played with the idea of adding hidden text, but was worried that the problem was really a result of an issue with my CSS and doing that wasn't the proper way to fix it.   So, without guilt, I took Rick's suggestion and added an invisible dot/period at the beginning of every link in a table, when that link is the first or only content in the td.  Did the trick!  Now the links assume my declared css style! 
    I submitted a bug report.......
    Thank you!!!

  • GROUP BY and ORDER BY help needed

    I have got an sql query where I have the need to pull out the latest copy of duplicate info, but what is happening is that the first instance is being displayed. The query I have is this:
    SELECT *
    FROM tbl_maincontenttext
    WHERE fld_menusection = 3
    GROUP BY fld_webpage
    ORDER BY fld_timedate DESC
    Basically, I have content that is listed under menu section 3, but within that I will have several copies of content that will relate to a specific webpage (eg: about us). What is currently happening is that GROUP BY is obviously grouping the similarly named 'about us', but it is pulling the first record it comes across out of the database rather than the latest updated record.
    As you can see, I am trying to get the query to order by fld_timedate which is a CURRENT_TIMESTAMP, but it's not working!
    I'm hoping that there is some sort of SQL that I am unaware of that will help me group by and display the latest update/content.
    Thanks.
    Mat

    It would help if you could show us the table definition. Your SQL statement is ambigous because you are selecting all table columns, yet only including one column in the group by clause.  A SQL statement must contain all selected columns that are not aggregates. Most DBMS will return an error for this statement. Others that don't return an error will return unexpected results.

  • SYSTEM PREFERENCES MBP 2008 15" MAC OS X 10.8.2 USERS & GROUPS PREFS CRASH BUG. HELP NEEDED

    For some reason System Preferences "Unexpectedly Quits" every time I try to go to the users preferences.
    Here is a link to a video to it: http://youtu.be/bw2erpe0B8s
    Also here is a link to the debug info: http://www.mediafire.com/view/?peju2065ktrphqn
    THANKS!

    For some reason System Preferences "Unexpectedly Quits" every time I try to go to the users preferences.
    Here is a link to a video to it: http://youtu.be/bw2erpe0B8s
    Also here is a link to the debug info: http://www.mediafire.com/view/?peju2065ktrphqn
    THANKS!

  • Mail.app: text in table cells in incoming formatted mail - problems replying

    MacOS 10.9.2
    mail.app  7.2, threading enabled
    Sometimes I receive a formatted email that is really difficult to reply to, when I want to intersperse my reply text among the incoming paragraphs.
    The trouble occurs when multiple incoming paragraphs are grouped. I can’t open up vertical space for my reply  text inside the groups. 
    If I click anywhere in the group, mail.app marks the group with a surrounding rounded-corner grey rectangle, with a X-in-a-circle “close icon” at the upper left corner. 
    When I look at the raw source of the incoming message, I see that the groups correspond to table cells, that is, the sending mail client enclosed the paragraphs within a <td> … </td> pair.
    The sending email client is sending me a table, for no clear reason — the group doesn’t correspond to anything obvious in the message thread.
    I’m guessing we won’t ever know why some email clients group paragraphs like this, but I’d like to do my best to adapt, so I can keep up with my incoming email. 
    Yeah, I can ask my correspondents to use a different email client, or perhaps different settings in the same client, but except for the few tekkies among my correspondents, this isn’t really practical.  I can also ask my clients to use unformatted messages, but THAT is a whole different issue, and frequently isn’t practical, either.
    My questions:
    Q1:  What’s the point of the grey rectangle and the  “close icon”?    (Is this mail.app’s way of saying, “I received this crazy formatting, almost impossible to process, so I’m making it easy for you to just delete the whole mess”?  Or what?)
    Q2:  Is there any SIMPLE way to untangle (modify or remove) these groupings within mail.app?  (I guess I can access the raw html, copy-and-paste it into another app, modify it, and paste the results back into my reply.  Yuck!)
    Q3: Am I missing a really obvious work-around or fix?
    TIA

    In your question, you indicated that you are running Firefox 8. Is that correct? It might be difficult to diagnose issues with that version because most people have moved on to Firefox 12 (plus or minus 1 version). Can you upgrade?
    It's hard to think of a reason that ordinary text or links in ordinary text would not display. For embedded images or videos, one possibility is a difference in the protocol, i.e., HTTP (not secure) versus HTTPS (secure).
    Hopefully someone else will have a better guess (or actual knowledge!).
    Regarding the blue lines in a message, that usually indicates the earlier message was forwarded a few times. I don't know whether Gmail will let you reformat that area or whether you have to clean it in another application (e.g., for plain text, in Notepad) and paste it back in.

  • Problems placing graphic into table cell. It makes the iPad locks up when previewing that page.

    I have 3 table cells that need a jpeg graphic placed into them.
    I can paste a grahic into a table cell, but when i try to preview that page on the iPad, ibook shuts down. I must be placing the graphic wrong or formats are wrong, like object wrap or "inline" "floating" or "anchored". the graphic shows up in the fill once I copy and paste into the cell, but it doesnt show up when I look at the file info in the inspector. Also, once I preview the iBook author project on my iPad, that page will shut down the iBook app.

    Well KT.....I tried that. But it still didnt work. I have 2 pages that have tables. The first page is just a full page with text only with a gradient colored screen in the table column heads. The 2nd page has the graphic illustration in the 3 table cells. Both pages shut down when opened to full screen view. But when i remove the graphic, there is no problem with a shut down. I know its got to be something you have to do but is unwritten in any manual.

  • Need help: checkbox or radiobutton in table cell

    So basically i am looking for code samples or links to where i can find an implementation of 2 or 3 radiobuttons or checkboxes in a table cell/column, so that for each row, i can have a selection of A, B or C for a particular string in the first column. I can create a table with one checkbox, but i cant figure out 2 or more inside the same cell.
    thanks :)

    The JTable tutorial has a section titled "Using a Combo Box as an Editor". Take a look at their example for how to do this.
    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

  • Search help in case of a table cell editor

    Hi
    I need a search help in case of a table cell editor as well as the the other requirement is that it shld be a reusable one.
    could anyone of u suggest me some methods
    regards
    Nikhil Tapkir

    There are several ways of doing this.
    1. Use OVS
    2. Create a Search help in R3. Call the function module.
    3. Create a Jar file which would provide the result .
    It is upto you on which ever way you want to provide
    Kumar

  • Need content in table cell to scroll

    I Need content in table cell to scroll, so the window stays a constant height. Help.

    Google for 'scrollable DIV' or 'iframe'. Scrollable DIVs are better.

  • I need a text field in a table cell to expand dynamically

    When I say expand I mean the whole cell has to grow as the content is entered into it, not just have a scroll bar present to contain the content, every new line should expand the table cell vertically. I've been looking all over and I can't seem to figure this one out, help?

    Turns out I just needed to search the forums better, here's a link to the thread with my solution:
    http://forums.adobe.com/thread/450522

  • Help Needed Tagging Complex Tables

    I am often asked to create accessible versions of PDFs for clients that contain complex tables -- e.g., merged and/or blank cells, multiple levels of subcategory headings. Are there any online resources that might help me understand (a) IF it is possible to create accessible versions of these tables and, if so, (b) HOW to tag them. In the ideal world, we would go back to the original document and revise the table, but that's not always possible.
    For example, a document I am working on currently includes a table that looks something like this:
    Category
    Period 1
    Period 2
    FTE
    $
    FTE
    $
    A. First Heading
        1. First Subhead
            a. Topic A
    34
    45
            b. Topic B
    54
    63
    Subtotal
    108
       2. Second Subhead
           a. Topic A
    etc.
    I understand how to tag the "Period 1" and "Period 2" headings as column headings that span 2 columns, but I'm not clear on how to handle the blank cells and/or the subheadings. Sorry for such an open-ended questions, but I'm not sure where to look - all the documentation I've seen seems to address fairly simple tables. I am using Acrobat XI for Mac.
    Any guidance would be greatly appreciated. Thank you!

    Yes, it is possible to create accessible versions of the these tables. There are several possible solutions.  In the example above, you are correct that Period 1 and Period 2 need to be tagged as <TH> with Span = 2 Column. Scope also needs to be set to Column.  FTE and $ also need to be tagged as TH with Scope = Column. All the cells in Column 1 (A. First Heading, 1. First Subhead, etc.) are <TH> with Scope = Row. 
    Because this is a complex table you need to Associate the table content with these headings using <ID> tags. 
    This is unfortunately where things can get a little time consuming.  The process can be done within Acrobat using the Touch Up Reading Order (TOR) tool (Accessibility Tool Panel). To briefly summarize -- Select the TOR, select the Table, and click the Table Button on the TOR Menu to open up the Table Editor.  The TOR Menu will disappear, and the table will be visible. You can click on individual cells, right click and select Cell Properties. 
    Select one of the header cells, right click and then select Table Cell Properties. There you will see the ID, which is usually something memorable like TD_08934_121.  Changes this to something meaningful like PERIOD_1 and P1_FTE. The name must be unique within the file. 
    Click OK to save and exit the Table Cell Properties window.
    Using the TOR select all of the content cells beneath that header and right click to open the Cell Properties.  Acrobat will let you select more than one cell by using the Shift Key, if there are no conflicting values in Cell Properties. Note: At times you may need to work one cell at a time.
    Once the Table Cell Properties is open, click the plus next to Associate Header Cell IDs and select the appropriate Heading ID that you defined above.
    Repeat until all the content cells are associated with their appropriate column headings, subheadings and row headings.
    That's method 1. 
    Method 2 would be to use the CommonLook plug-in.  Adding Table Cell IDs is CommonLook's strong point, but the price is high and there is a learning curve. And I've experienced some troublesome issues involving borders and shading in some files.  Still if you have Commonlook available it can be a REAL timesaver for tagging complex tables.
    Lastly, there are some tricks and workarounds that would make the structure of this table simple and therefore accessible without all of this.  If you are experienced  working in the Tags Panel in Acrobat. In the example above you could convert the first row of content  Headings Period 1 and Period 2 to Artifacts and then entirely delete that row from the table within the tags panel,  Then add alternative text to the second row of headings so FTE will always read as "Period 1 FTE" or Period 2 FTE" and so forth. Some purists may object to this method, but it would work.
    NOTE: Any of these methods require further checking with a screen reader to ensure the tables are recognized by tables and no mistakes were made in assigning the headings to the cells and I would also check to make sure any blank cells read as "Blank" as they may be mistagged in the tags panel by the authoring application (e.g., MS Word). 

  • Table Cell Contents Disappears Please HELP!!!!

    PROBLEM: I have a different tables within different table cells in the Master table. One table per Master cell. Once I click on a table cell (0,0) and click on another table cell (1,1) the cell (0,0) blanks out. Likewise with other cells so that if I've click on all the cells in the Master Table and then clicked somewhere else all cell contents have disappeared.
    QUESTION: Do I need to call some UI refresh procedure????? I have a cell renderer which returns the table for each Master's Cell.
    I don't if this is clear but please help!
    Thanks

    Hi,
    the problem is that the DefaultCellEditor can't handle tables.
    So you have to write your CellEditor, which returns another table as Editor.
    class YourTableCellRenderer implements  TableCellRenderer{
        private  JTable table = new JTable();
        public Component getTableCellRendererComponent(JTable table,
                                                       Object value,
                                                       boolean isSelected,
                                                       boolean hasFocus,
                                                       int row,
                                                       int column){
             // set Data and Layout
             return table;
    }then set the Editor to your MasterTable (master) with.
    master.setCellEditor(TableCellEditor anEditor) or
    master.setDefaultEditor(Class columnClass,
                                 TableCellEditor editor);Hope this Helps.
    Michael

  • How to highlight the table cell color in respective colors as needed per the requirements??

    var aData = [
        {notificationNo: "10000000", description: "Maintenance for boiler", location: "G001-STG-UTLR-BLR", equipmentNo: "100000053", orderStatus: "ordered"},
        {notificationNo: "10000010", description: "Genreal Maintenance for boiler", location: "G001-STG-UTLR-BLR", equipmentNo: "100000053", orderStatus: "notordered"},
        {notificationNo: "10000011", description: "boiler Maintenance", location: "G001-STG-UTLR-BLR", equipmentNo: "100000053", orderStatus: "ordered"},
        {notificationNo: "10000012", description: "Pump breakdown", location: "G001-STG-UTLR-BLR", equipmentNo: "100000053", orderStatus: "ordered"},
        {notificationNo: "10000013", description: "External service boiler", location: "G001-STG-UTLR-BLR", equipmentNo: "100000053", orderStatus: "notordered"},
    jQuery.sap.require("sap.ui.model.json.JSONModel");
    var oEnterpriseAsset_NotificationConsole;
    sap.ui.model.json.JSONModel.extend("EAM_Notification_Console", {
        CreateNotificationConsole:function(){
            oEnterpriseAsset_NotificationConsole = this;
                var oTable = new sap.ui.table.Table({
                //title: "Table Example",
                visibleRowCount: 7,
                firstVisibleRow: 3,
                selectionMode: sap.ui.table.SelectionMode.Single,
            /*    toolbar: new sap.ui.commons.Toolbar({items: [
                    new sap.ui.commons.Button({text: "Button in the Toolbar", press: function() { alert("Button pressed!"); }})
                extension: [
                    new sap.ui.commons.Button({text: "Button in the Extension Area", press: function() { alert("Button pressed!"); }})
            }).addStyleClass("tableform");;
            oTable.addColumn(new sap.ui.table.Column({
            label: new sap.ui.commons.Label({text: "Notification"}),
            template: new sap.ui.commons.Link().bindProperty("text", "notificationNo").bindProperty("href", "href",
                    function(aValue)
            //    sortProperty: "notificationNo",
                //filterProperty: "notificationNo",
                width: "200px"
            oTable.addColumn(new sap.ui.table.Column({
                label: new sap.ui.commons.Label({text: "Description"}),
                template: new sap.ui.commons.Link().bindProperty("text", "description").bindProperty("href", "href"),
                //sortProperty: "notificationNo",
                //filterProperty: "notificationNo",
                //width: "200px"
            var oModel = new sap.ui.model.json.JSONModel();
            oModel.setData({modelData: aData});
            oTable.setModel(oModel);
            oTable.bindRows("/modelData");
        var idForTable= "DimTable"
            //alert("id of tbale " + idForTable);
            var htmlOutput = '<table id=' + idForTable + ' name="DimTab" style="border: 1px solid black;margin-left:15px;" cellpadding=6 cellspacing=0><tr style="background-color:#E5E5E5"><td><b>Dimension</b></td><td><b>Value</b></td></tr>';
            for(var i=0;i<aData.length;i++)
             alert(aData[i].notificationNo);
            htmlOutput += '<tr style="display:none;"><td style="border-right:1px solid #e5e5e5;">Contract No</td><td>'+ aData[i].notificationNo+'</td></tr>';
            htmlOutput += '<tr style="display:none;"><td  style="border-right:1px solid #e5e5e5;">Unit No</td><td>'+ aData[i].description+'</td></tr>';
            htmlOutput += '</table>';   
             var html2 = new sap.ui.core.HTML({
                 // static content
                 //content : "<div style='position:relative;background-color:white;'>Weather</div><script src='//www.gmodules.com/ig/ifr?url=http://www.google.com/ig/modules/builtin_weather.xml&synd=open&w=320&h=200&title=__MSG_weather_title__&lang=en&country=ALL&border=http%3A%2F%2Fwww.gmodules.com%2Fig%2Fimages%2F&output=js'></script>",
            content : htmlOutput,
                  //2 wrkng sydney content : '<div id="cont_Mzc0NjN8NXwxfDF8NHxlZGY1ZjV8M3xGRkZGRkZ8Y3wx"><div id="spa_Mzc0NjN8NXwxfDF8NHxlZGY1ZjV8M3xGRkZGRkZ8Y3wx"><a id="a_Mzc0NjN8NXwxfDF8NHxlZGY1ZjV8M3xGRkZGRkZ8Y3wx" href="http://www.weather-wherever.co.uk/australia/sydney_v37463/" target="_blank" style="color:#333;text-decoration:none;">Weather forecast</a> © weather</div><script type="text/javascript" src="http://widget.weather-wherever.co.uk/js/Mzc0NjN8NXwxfDF8NHxlZGY1ZjV8M3xGRkZGRkZ8Y3wx"></script></div>',
                  //content : '<div style="margin-left:-10px;margin-top:10px;width:100%;"><LINK rel="StyleSheet" href="http://weatherandtime.net/new_wid/w_5/style.css" type="text/css" media="screen"><div class="ww_5" id="ww_5_2119"><div class="l_b"></div><div class="c_b"><div class="day" id="d_0"><span class="den"></span><br><span class="date"></span><br><span class="temp"></span><div class="pict"></div><span class="press"></span><br><span class="hum"></span><br><span class="vet"></span><br></div><div class="day" id="d_1"><span class="den"></span><br><span class="date"></span><br><span class="temp"></span><div class="pict"></div><span class="press"></span><br><span class="hum"></span><br><span class="vet"></span><br></div><div class="day" id="d_2"><span class="den"></span><br><span class="date"></span><br><span class="temp"></span><div class="pict"></div><span class="press"></span><br><span class="hum"></span><br><span class="vet"></span><br></div><div class="cl"></div><div class="links"><a target="_blank" title="Pune Weather forecast" href="http://weatherandtime.net/en/Asia/India/Pune-weather.html">Pune Weather forecast</a><br><a style="font-size:12px !important;color:#12A0D7 !important;text-decoration:none !important;" href="http://weatherandtime.net/en/widgets-gallery.html" title="weather"></a></div></div><div class="r_b"></div></div><script type="text/javascript" src="http://weatherandtime.net/w_5.js?city=2119&lang=en&type=2&day=3"></script></div>',
              // initially behaves the same as Sample 1
                 preferDOM : false,
                 // use the afterRendering event for 2 purposes
        return     oTable;
    /* In the screen shot as u can see.. I have to highlight the table cell in green color and red color for ordered and unordered status(which is binded to a json data) respectively....anyone please help??

    Hi Abhi,
                   Check this link it may helpHow I made highlight of specific values in Table

  • Help needed for grouping.

    Hi,
        Help needed .
    I have an internal table having 6 .
    Ex :
    f1     f2    f3     f4    f5    f6
    a     aa    11    p1  10    10
    a     aa    12    p1  20    20
    b     aa    11    p2  30    30
    b     aa    12    p2  40    30
    Now i want to sum the fields f5 and f6 individually and need to display based upon the fields f1 and f4.
    To Display :
    f1     f2    f3     f4    f5    f6
    a     aa    11    p1  30    30.
    b     aa    11    p2  70    60.
    can anyone help me.How to do this..?
    Thanks

    Here you go
    DATA:
      BEGIN OF cur_tab OCCURS 0,
        f1        TYPE c,
        f2(2)     TYPE c,
        f3(2)     TYPE c,
        f4(2)     TYPE c,
        f5(2)     TYPE c,
        f6(2)     TYPE n,
      END OF cur_tab.
    DATA:
      BEGIN OF sum_tab OCCURS 0,
        f1        TYPE c,
        f4(2)     TYPE c,
        f5        TYPE p,
        f6        TYPE p,
      END OF sum_tab.
    DATA:
      BEGIN OF final_tab OCCURS 0,
        f1        TYPE c,
        f2(2)     TYPE c,
        f3(2)     TYPE c,
        f4(2)     TYPE c,
        f5(5)     TYPE c,
        f6(5)     TYPE c,
      END OF final_tab.
    START-OF-SELECTION.
      cur_tab-f1 = 'a'.
      cur_tab-f2 = 'aa'.
      cur_tab-f3 = '11'.
      cur_tab-f4 = 'p1'.
      cur_tab-f5 = '10'.
      cur_tab-f6 = '10'.
      APPEND cur_tab.
      cur_tab-f1 = 'a'.
      cur_tab-f2 = 'aa'.
      cur_tab-f3 = '11'.
      cur_tab-f4 = 'p1'.
      cur_tab-f5 = '20'.
      cur_tab-f6 = '20'.
      APPEND cur_tab.
      cur_tab-f1 = 'b'.
      cur_tab-f2 = 'aa'.
      cur_tab-f3 = '11'.
      cur_tab-f4 = 'p2'.
      cur_tab-f5 = '30'.
      cur_tab-f6 = '30'.
      APPEND cur_tab.
      cur_tab-f1 = 'b'.
      cur_tab-f2 = 'aa'.
      cur_tab-f3 = '11'.
      cur_tab-f4 = 'p2'.
      cur_tab-f5 = '40'.
      cur_tab-f6 = '30'.
      APPEND cur_tab.
      LOOP AT cur_tab.
        MOVE-CORRESPONDING cur_tab TO sum_tab.
        COLLECT sum_tab.
      ENDLOOP.
      LOOP AT sum_tab.
        READ TABLE cur_tab WITH KEY f1 = sum_tab-f1
                                    f4 = sum_tab-f4.
        IF sy-subrc NE 0.
          WRITE:/ 'Something went very wrong'.
          CONTINUE.
        ENDIF.
        MOVE-CORRESPONDING cur_tab TO final_tab.
        MOVE-CORRESPONDING sum_tab TO final_tab.
        APPEND final_tab.
      ENDLOOP.
      LOOP AT final_tab.
        WRITE:/1 final_tab-f1,
              AT 5 final_tab-f2,
              AT 10 final_tab-f3,
              AT 15 final_tab-f4,
              AT 20 final_tab-f5,
              AT 25 final_tab-f6.
      ENDLOOP.
    and the output
    a   aa   11   p1     30   30  
    b   aa   11   p2     70   60  

Maybe you are looking for