CheckBox with DefaultTRable

Hi,
It is possible to use CheckBox (for boolean value) with DefaulTableModel.
I can do it with AbstractTableModel but the problem is that cannot add any new row.
Thanks if you got example
Herve

Sure you can. The secret is to override the getColumClass() method of either JTable or the TableModel. This thread shows an example:
http://forum.java.sun.com/thread.jsp?forum=57&thread=419688

Similar Messages

  • How to checking my checkbox with a listbox

    I have a new form where I would like to check automatically my checkbox with a choice from listbox.
    I have a listbox with three values in french "Utilisateur" - "Comptable" and "Membre direction".
    I would like when the user has selected "Utilisateur", my checkbox with value "OJV_OFFICE_UTILISATEURS" has checked or "Comptable" checkbox with value "OJV_OPF Caissiers"
    Can you help me.
    Thanks

    Look at this previous post:
    https://forums.adobe.com/thread/1506686
    To modify the script to your form, you could try this as the custom validation script for your combo box:
    if (event.value=="Utilisateur") {
    this.getField("OJV_OFFICE_UTILISATEURS").value = "Yes"; 
    this.getField("OJV_OPF Caissiers").value = "No";}
    else if (event.value=="Comptable") {
    this.getField("OJV_OFFICE_UTILISATEURS").value = "No"; 
    this.getField("OJV_OPF Caissiers").value = "Yes";}
    Make sure you have the "Commit selected value immediately" option selected.

  • Checkbox with JTree

    hai,
    i added checkbox to each tree node and my coding is
    import java.awt.BasicStroke;
    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.awt.ComponentOrientation;
    import java.awt.Dimension;
    import java.awt.FlowLayout;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.GridLayout;
    import java.awt.Insets;
    import java.awt.Point;
    import java.awt.Rectangle;
    import java.awt.RenderingHints;
    import java.awt.Toolkit;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.FocusEvent;
    import java.awt.event.FocusListener;
    import java.awt.event.InputEvent;
    import java.awt.event.KeyEvent;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseMotionListener;
    import java.util.Arrays;
    import java.util.HashSet;
    import java.util.Iterator;
    import java.util.Set;
    import javax.swing.AbstractAction;
    import javax.swing.AbstractButton;
    import javax.swing.Icon;
    import javax.swing.ImageIcon;
    import javax.swing.JButton;
    import javax.swing.JCheckBox;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import javax.swing.JTree;
    import javax.swing.KeyStroke;
    import javax.swing.SwingUtilities;
    import javax.swing.UIManager;
    import javax.swing.UnsupportedLookAndFeelException;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.tree.DefaultTreeCellRenderer;
    import javax.swing.tree.TreeCellRenderer;
    import javax.swing.tree.TreePath;
    /** Provides checkbox-based selection of tree nodes. Override the protected
    * methods to adapt this renderer's behavior to your local tree table flavor.
    * No change listener notifications are provided.
    public class CheckBoxTreeCellRenderer implements TreeCellRenderer {
    public static final int UNSELECTABLE = 0;
    public static final int FULLSELECTED = 1;
    public static final int NOTSELECTED = 2;
    public static final int PARTIALSELECTED = 3;
    private TreeCellRenderer renderer;
    public static JCheckBox checkBox;
    private Point mouseLocation;
    private int mouseRow = -1;
    private int pressedRow = -1;
    private boolean mouseInCheck;
    private int state = NOTSELECTED;
    private Set checkedPaths;
    private JTree tree;
    private MouseHandler handler;
    /** Create a per-tree instance of the checkbox renderer. */
    public CheckBoxTreeCellRenderer(JTree tree, TreeCellRenderer original) {
    this.tree = tree;
    this.renderer = original;
    checkedPaths = new HashSet();
    checkBox = new JCheckBox();
    checkBox.setOpaque(false);
    System.out.println(checkBox.isSelected());
    checkBox.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
              trace(checkBox);
    // ActionListener actionListener = new ActionListener() {
    // public void actionPerformed(ActionEvent actionEvent) {
    // AbstractButton abstractButton = (AbstractButton) actionEvent.getSource();
    // boolean selected = abstractButton.getModel().isSelected();
    // System.out.println(selected);
    // // abstractButton.setText(newLabel);
    // checkBox.addActionListener(new ActionListener(){
    //               public void actionPerformed(ActionEvent actionEvent) {
    //                    Checkbox cb = actionEvent.getSource();
    //     boolean selected = abstractButton.getModel().isSelected();
    //     System.out.println(selected);
    checkBox.setSize(checkBox.getPreferredSize());
    private static void trace(JCheckBox cb) {
         if (cb.isSelected())
              System.out.println(cb.getText()+" is " + cb.isSelected());
         else
              System.out.println(cb.getText()+" is " + cb.isSelected());
    protected void installMouseHandler() {
    if (handler == null) {
    handler = new MouseHandler();
    addMouseHandler(handler);
    protected void addMouseHandler(MouseHandler handler) {
    tree.addMouseListener(handler);
    tree.addMouseMotionListener(handler);
    private void updateMouseLocation(Point newLoc) {
    if (mouseRow != -1) {
    repaint(mouseRow);
    mouseLocation = newLoc;
    if (mouseLocation != null) {
    mouseRow = getRow(newLoc);
    repaint(mouseRow);
    else {
    mouseRow = -1;
    if (mouseRow != -1 && mouseLocation != null) {
    Point mouseLoc = new Point(mouseLocation);
    Rectangle r = getRowBounds(mouseRow);
    if (r != null)
    mouseLoc.x -= r.x;
    mouseInCheck = isInCheckBox(mouseLoc);
    else {
    mouseInCheck = false;
    protected int getRow(Point p) {
    return tree.getRowForLocation(p.x, p.y);
    protected Rectangle getRowBounds(int row) {
    return tree.getRowBounds(row);
    protected TreePath getPathForRow(int row) {
    return tree.getPathForRow(row);
    protected int getRowForPath(TreePath path) {
    return tree.getRowForPath(path);
    public void repaint(Rectangle r) {
    tree.repaint(r);
    public void repaint() {
    tree.repaint();
    private void repaint(int row) {
    Rectangle r = getRowBounds(row);
    if (r != null)
    repaint(r);
    public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
    installMouseHandler();
    TreePath path = getPathForRow(row);
    state = UNSELECTABLE;
    if (path != null) {
    if (isChecked(path)) {
    state = FULLSELECTED;
    else if (isPartiallyChecked(path)) {
    state = PARTIALSELECTED;
    else if (isSelectable(path)) {
    state = NOTSELECTED;
    checkBox.setSelected(state == FULLSELECTED);
    checkBox.getModel().setArmed(mouseRow == row && pressedRow == row && mouseInCheck);
    checkBox.getModel().setPressed(pressedRow == row && mouseInCheck);
    checkBox.getModel().setRollover(mouseRow == row && mouseInCheck);
    Component c = renderer.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
    checkBox.setForeground(c.getForeground());
    if (c instanceof JLabel) {
    JLabel label = (JLabel)c;
    // Augment the icon to include the checkbox
    Icon customOpenIcon = new ImageIcon("browse.gif");
    label.setIcon(new CompoundIcon(label.getIcon()));
    return c;
    private boolean isInCheckBox(Point where) {
    Insets insets = tree.getInsets();
    int right = checkBox.getWidth();
    int left = 0;
    if (insets != null) {
    left += insets.left;
    right += insets.left;
    return where.x >= left && where.x < right;
    public boolean isExplicitlyChecked(TreePath path) {
    return checkedPaths.contains(path);
    /** Returns whether selecting the given path is allowed. The default
    * returns true. You should return false if the given path represents
    * a placeholder for a node that has not yet loaded, or anything else
    * that doesn't represent a normal, operable object in the tree.
    public boolean isSelectable(TreePath path) {
    return true;
    /** Returns whether the given path is currently checked. */
    public boolean isChecked(TreePath path) {
    if (isExplicitlyChecked(path)) {
    return true;
    else {
    if (path.getParentPath() != null) {
    return isChecked(path.getParentPath());
    else {
    return false;
    public boolean isPartiallyChecked(TreePath path) {
    Object node = path.getLastPathComponent();
    for (int i = 0; i < tree.getModel().getChildCount(node); i++) {
    Object child = tree.getModel().getChild(node, i);
    TreePath childPath = path.pathByAddingChild(child);
    if (isChecked(childPath) || isPartiallyChecked(childPath)) {
    return true;
    return false;
    private boolean isFullyChecked(TreePath parent) {
    Object node = parent.getLastPathComponent();
    for (int i = 0; i < tree.getModel().getChildCount(node); i++) {
    Object child = tree.getModel().getChild(node, i);
    TreePath childPath = parent.pathByAddingChild(child);
    if (!isExplicitlyChecked(childPath)) {
    return false;
    return true;
    public void toggleChecked(int row) {
    TreePath path = getPathForRow(row);
    boolean isChecked = isChecked(path);
    removeDescendants(path);
    if (!isChecked) {
    checkedPaths.add(path);
    setParent(path);
    repaint();
    private void setParent(TreePath path) {
    TreePath parent = path.getParentPath();
    if (parent != null) {
    if (isFullyChecked(parent)) {
    removeChildren(parent);
    checkedPaths.add(parent);
    } else {
    if (isChecked(parent)) {
    checkedPaths.remove(parent);
    addChildren(parent);
    checkedPaths.remove(path);
    setParent(parent);
    private void addChildren(TreePath parent) {
    Object node = parent.getLastPathComponent();
    for (int i = 0; i < tree.getModel().getChildCount(node); i++) {
    Object child = tree.getModel().getChild(node, i);
    TreePath path = parent.pathByAddingChild(child);
    checkedPaths.add(path);
    private void removeChildren(TreePath parent) {
    for (Iterator i = checkedPaths.iterator(); i.hasNext();) {
    TreePath p = (TreePath) i.next();
    if (p.getParentPath() != null && parent.equals(p.getParentPath())) {
    i.remove();
    private void removeDescendants(TreePath ancestor) {
    for (Iterator i = checkedPaths.iterator(); i.hasNext();) {
    TreePath path = (TreePath) i.next();
    if (ancestor.isDescendant(path)) {
    i.remove();
    /** Returns all checked rows. */
    public int[] getCheckedRows() {
    TreePath[] paths = getCheckedPaths();
    int[] rows = new int[checkedPaths.size()];
    for (int i = 0; i < checkedPaths.size(); i++) {
    rows[i] = getRowForPath(paths);
    Arrays.sort(rows);
    return rows;
    /** Returns all checked paths. */
    public TreePath[] getCheckedPaths() {
    return (TreePath[]) checkedPaths.toArray(new TreePath[checkedPaths.size()]);
    protected class MouseHandler extends MouseAdapter implements MouseMotionListener {
    public void mouseEntered(MouseEvent e) {
    updateMouseLocation(e.getPoint());
    public void mouseExited(MouseEvent e) {
    updateMouseLocation(null);
    public void mouseMoved(MouseEvent e) {
    updateMouseLocation(e.getPoint());
    public void mouseDragged(MouseEvent e) {
    updateMouseLocation(e.getPoint());
    public void mousePressed(MouseEvent e) {
    pressedRow = e.getModifiersEx() == InputEvent.BUTTON1_DOWN_MASK
    ? getRow(e.getPoint()) : -1;
    updateMouseLocation(e.getPoint());
    public void mouseReleased(MouseEvent e) {
    if (pressedRow != -1) {
    int row = getRow(e.getPoint());
    if (row == pressedRow) {
    Point p = e.getPoint();
    Rectangle r = getRowBounds(row);
    p.x -= r.x;
    if (isInCheckBox(p)) {
    toggleChecked(row);
    pressedRow = -1;
    updateMouseLocation(e.getPoint());
    public void mouseClicked(MouseEvent e){
         if(checkBox.isSelected()){
              System.out.println(checkBox.getName());
    /** Combine a JCheckBox's checkbox with another icon. */
    private final class CompoundIcon implements Icon {
    private final Icon icon;
    private final int w;
    private final int h;
    private CompoundIcon(Icon icon) {
    if (icon == null) {
    icon = new Icon() {
    public int getIconHeight() { return 0; }
    public int getIconWidth() { return 0; }
    public void paintIcon(Component c, Graphics g, int x, int y) { }
    this.icon = icon;
    this.w = icon.getIconWidth();
    this.h = icon.getIconHeight();
    public int getIconWidth() {
    return checkBox.getPreferredSize().width + w;
    public int getIconHeight() {
    return Math.max(checkBox.getPreferredSize().height, h);
    public void paintIcon(Component c, Graphics g, int x, int y) {
    if (c.getComponentOrientation().isLeftToRight()) {
    int xoffset = checkBox.getPreferredSize().width;
    int yoffset = (getIconHeight()-icon.getIconHeight())/2;
    icon.paintIcon(c, g, x + xoffset, y + yoffset);
    if (state != UNSELECTABLE) {
    paintCheckBox(g, x, y);
    else {
    int yoffset = (getIconHeight()-icon.getIconHeight())/2;
    icon.paintIcon(c, g, x, y + yoffset);
    if (state != UNSELECTABLE) {
    paintCheckBox(g, x + icon.getIconWidth(), y);
    private void paintCheckBox(Graphics g, int x, int y) {
    int yoffset;
    boolean db = checkBox.isDoubleBuffered();
    checkBox.setDoubleBuffered(false);
    try {
    yoffset = (getIconHeight()-checkBox.getPreferredSize().height)/2;
    g = g.create(x, y+yoffset, getIconWidth(), getIconHeight());
    checkBox.paint(g);
    if (state == PARTIALSELECTED) {
    final int WIDTH = 2;
    g.setColor(UIManager.getColor("CheckBox.foreground"));
    Graphics2D g2d = (Graphics2D)g;
    g2d.setStroke(new BasicStroke(WIDTH, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
    g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    int w = checkBox.getWidth();
    int h = checkBox.getHeight();
    g.drawLine(w/4+2, h/2-WIDTH/2+1, w/4+w/2-3, h/2-WIDTH/2+1);
    g.dispose();
    finally {
    checkBox.setDoubleBuffered(db);
    private static String createText(TreePath[] paths) {
    if (paths.length == 0) {
    return "Nothing checked";
    String checked = "Checked:\n";
    for (int i=0;i < paths.length;i++) {
    checked += paths[i] + "\n";
    return checked;
    public static void main(String[] args) {
    try {
    final String SWITCH = "toggle-componentOrientation";
    try {
                   UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
              } catch (ClassNotFoundException e1) {
                   e1.printStackTrace();
              } catch (InstantiationException e1) {
                   e1.printStackTrace();
              } catch (IllegalAccessException e1) {
                   e1.printStackTrace();
              } catch (UnsupportedLookAndFeelException e1) {
                   e1.printStackTrace();
    JFrame frame = new JFrame("Tree with Check Boxes");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    final DefaultMutableTreeNode a = new DefaultMutableTreeNode("Node 1");
    for(int i =0 ; i<3; i++ ){
         DefaultMutableTreeNode b = new DefaultMutableTreeNode("ChildNode "+i);
         a.add(b);
    DefaultMutableTreeNode e = new DefaultMutableTreeNode("Node 2");
    for(int i =0 ; i<3; i++ ){
         DefaultMutableTreeNode f = new DefaultMutableTreeNode("ChildNode "+i);
         e.add(f);
    DefaultMutableTreeNode al = new DefaultMutableTreeNode("Sample");
    al.add(a);
    al.add(e);
    final JTree tree = new JTree(al);
    final CheckBoxTreeCellRenderer r =
    new CheckBoxTreeCellRenderer(tree, tree.getCellRenderer());
    tree.setCellRenderer(r);
    int rc = tree.getRowCount();
    tree.getActionMap().put(SWITCH, new AbstractAction(SWITCH) {
    public void actionPerformed(ActionEvent e) {
    ComponentOrientation o = tree.getComponentOrientation();
    if (o.isLeftToRight()) {
    o = ComponentOrientation.RIGHT_TO_LEFT;
    else {
    o = ComponentOrientation.LEFT_TO_RIGHT;
    tree.setComponentOrientation(o);
    tree.repaint();
    int mask = InputEvent.SHIFT_MASK|Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
    tree.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_O, mask), SWITCH);
    final JTextArea text = new JTextArea(createText(r.getCheckedPaths()));
    text.setPreferredSize(new Dimension(200, 100));
    tree.addMouseListener(new MouseAdapter() {
    public void mouseReleased(MouseEvent e) {
    // Invoke later to ensure all mouse handling is completed
    SwingUtilities.invokeLater(new Runnable() { public void run() {
    text.setText(createText(r.getCheckedPaths()));
    JScrollPane pane = new JScrollPane(tree);
    frame.getContentPane().add(pane);
    // frame.getContentPane().add(new JScrollPane(text), BorderLayout.SOUTH);
    frame.pack();
    frame.setSize(600,400);
    frame.setVisible(true);
    catch(Exception e) {
    e.printStackTrace();
    System.exit(1);
    now i need to get nodes names which has been selected, how can i do this
    can anyone help me ...
    regards,
    shobi

    Also, use code tags and post a SSCCE -- I'm sure more of your posted code is irrelevant to your question and few people are going to look at a code listing that long.
    [http://mindprod.com/jgloss/sscce.html]

  • Using checkboxes with JOption Pane

    Hi, I having abit of trouble trying to implement a search utility into my swing based program. What I want is something also the lines of the "Find" feature available in MS Word and IE. Hence I want a message, input dialog box but also a checkbox to check does the user what to search for case sensitive material. So far I've been using JOptionPane and my code is as follows...
    String userInput = (String) JOptionPane.showInputDialog(null,"Enter Search Criteria:\n",     "Search Dialog",JOptionPane.QUESTION_MESSAGE,null,null,"");
    However it seems I cannot use checkboxes with this. Any idea how I could go about doing this using JOptionPane or if not would someone care to shed some light on how I might accomplish it?
    Thanks in advance,
    Simon

    JOptionPanes can be extended, but you would rather want to make a JDialog.
    Because you might also offer regular expression search (free in java 1.4),
    or search-and-replace.
    A google search will give examples like at the koders site.
    In general it pays to have all those little dialogs really user-friendly, say saving the last N sought terms + whether case-sensitive or not.
    Joop

  • Checkbox with 3 states?

    Hi,
    is there any way in jsf to create checkboxes with more than two states?
    Something like
    -true (e.g. value 2)
    -false (e.g. value 0)
    -something in between (e.g. value 1)
    You need those when you select a group of features and deselect one of the features (e.g. installation of software, see installshield). The checkbox usually is still selected, but with a shady gray background. You can see if the whole group of features is selected, if the whole group is deselected or if some features of the group are selected.
    Is there a way to get those components without having to create them manually? I can't believe nobody else needs those.
    Greetings, jimbo

    Hi Paul,
    It adds the value, how would I (add enter) so the text are seperate lines.
    Example 1:
    The dog is in the dog house. The cat is in a tree. (bad)
    Example 2:
    The dog is in the dog house.
    The cat is in the tree
    Viewing the text as in Example 2 is easier to read.
    Thank You,
    Arnold

  • Checkbox with submit

    Hi,
    Is there checkboxes with submit/redirect in APEX 3.2 / 4.0? I'm using 3.0 and there's no option :(
    Is there an alternative I can do? Maybe something like Form Element Option Attributes - onclick=refresh()/reload() except I need it to recognise in the session that the checkbox is selected (it remains selected with some options but item conditions dont occur and it doesnt recognise the checkbox's value in the session section.
    Mike
    Edited by: Dird on May 7, 2010 2:38 PM

    Hi Mike
    onclick=doSubmit('YOUR_REQUEST_VALUE');In the HTML Form Element Attributes should do it.
    I don't know about 4.0 but it's not in 3.2.1.
    Cheers
    Ben

  • Checkbox with vertical label - FB mobil app

    How can I create in Flash Builder a checkbox with a vertical label. Has someone an example code?
    The label should be under the checkbox (but in center):
    CheckBox
    L
    A
    B
    E
    L
    Great thanks, M.

    I think the whole reason that this post was even necesary was because the original Check box wasn't written properly (see my comments on this page http://livedocs.adobe.com/flex/3/html/help.html?content=cellrenderer_4.html ).  Note that mx checkbox implements IDataRenderer, so you should be able to use it as a renderer with this tweak, as long as the Spark DataGrid allows you to set column alignment as MX data grid (or you don't need it centered).
    In Flex 4, ItemRenderer is really just a Group with a couple of extra bells and whistles.  At the simplest level, you can just bind its selected property to some boolean field on the data object if you know its format in advance.  However, that's not going to give you a reusable check box.  To do that, you need to either write code that can translate the string label field into a Boolean, or something that can combine the DefaultDataGridRenderer's data property with the dataField property on DefaultDataGridRenderer's column object and again come up with a Boolean.
    You can either make this Boolean a Bindable variable or, if you're comfortable with the component life cycle, you can do the getter/setter + commitProperties to set it more directly on a custom Check Box skinPart.
    HTH;
    Amy

  • Do I not get the "open file after publishing" checkbox with the trial version?

    I owned the Adobe Acrobat 8 Professional version on my pc, and recently bought a Mac. Do I not have the option to "Open file after publishing" checkbox with the trial version? Do I have to repurchase the whole program to get that?

    uninstall.
    download from prodesigntools.com.
    if you follow all 7 steps you can directly download a trial here:  New Adobe Lightroom 6 (CC) Direct Download Links – Free Trials | ProDesignTools
    and activate with your serial number.
    if you have a problem starting the download, you didn't follow all 7 steps, or your browser does not accept cookies. 
    the most common problem is caused by failing to meticulously follow steps 1,2 and/or 3 (which adds a cookie to your system enabling you to download the correct version from adobe.com). 
    failure to obtain that cookie results in an error page being displayed after clicking a link on prodesigntools.com or initiates the download of an incorrect (eg, current) version.

  • How to retrive data from selected checkboxes with fieldnames

    hi experts,
    how to retrive data from selected checkboxes with fieldnames into another alv grid report.(here the fieldnames selected from  table names is dynamically).
    thankx in advance
    rani.k.

    Hi,
    Use user_command in the alv grid and then
    do the follwoing code
    FORM user_command1 USING lv_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    Declaration of local Variables
      DATA : lv_ref1 TYPE REF TO cl_gui_alv_grid.
      DATA lv_cnt TYPE i.                                    "+INS SUHESH 12.07.2008
    Check function code
      CASE lv_ucomm.
        WHEN 'ONLI'.
          CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
            IMPORTING
              e_grid = lv_ref1.
          CALL METHOD lv_ref1->check_changed_data.
    now loop ur final internal table where check = 'X'.
    now pass data to other internal table..Now the internal table will be having values that the user selcetd on the screen.
    Hope this helps.
    Regards,
    Nagaraj

  • Binding Checkboxes with Data Fields

    hi again , one question, is it possible to link a user-added checkbox with a data field from a table to show a stored state?, i tried using the valon and valoff properties to set whether it must or not be checked (depending on the values of some field) but it's not working, could someone help me with this please? thanks

    Hi Oscar,
    here is my sample, how to connect user's checkbox with DB value.
    Dim oCheckBox As SAPbouiCOM.CheckBox
    Dim oDBds As SAPbouiCOM.DBDataSource
    Set oCheckBox = frm.Items("ckDispp").Specific
    Set oDBds = frm.DataSources.DBDataSources.Add("@ABC_DISP")
    oCheckBox.DataBind.SetBound True, "@ABC_DISP", "U_Display"
    The ValidValues in DB field "U_Display" are 'Y' when checkbox is checked, and 'N' when unchecked.
    Hope, this helps.
    Regads
    Libor.

  • Create Checkbox with Attributes from XML file

    Hi
    I have some problem. I want to create some checkbox with attribute from a XML file
    my Xml file look like this:
    <group type="Content Relation" color="255, 255, 255" active="true">
    so I want to create for example a check box with name as Content Relation, Background color is RGB(255, 255, 255) and it's checked. All of these Attribute I have readed and save them as String. My question, how can I create a Color object with the color Attribute from the XML file?
    Is it better if I define my XML file like this:
    <group>
    <type>Content Relation</type>
    <color>
    <red>255</red>
    <green>255</green>
    <blue>255</blue>
    </color>
    <active>true</active>
    </group>

    IMO attributes are much easier to parse then textnodes
    altho
    <color red='255' green='255' blue='255'/>
    might be easier

  • Mixing multiple checkboxes with grades

    I'm looking for a way to mix checkboxes with grades that these checkboxes have scored.
    To give an example, say a report has the topics "sustainability" and "durability" and have been scored by clients. I would like to have the option to state that these topics are in the report, as well as how high they scored. This would
    enable my to filter for reports that contained the topics "durability" that scored above e.g. "8". Currently I need to create additional fields for every elements, making my database highly unwieldy.
    How can I go about creating this kind of database?
    Kind Regards,
    Nick
    Ps: it should be noted that I have limited rights for programming/importing parts. So I'm looking for a out-of-the-box solution.

    Hi NLeone,
    I don't think you'll be able to achieve what you're looking for in a single column, unfortunately.
    You could create a choice column for every potential topic:
    Give it a single choice of "N/A"
    Display choices using radio buttons
    Allowing 'Fill-in' choices
    Use column validation to make sure the field value is either "N/A" or a number

  • Is it possible to use Checkboxes with Table Views?

    Hi,
    I need help with adding checkbox. Here is the detail of what I have.
    In my application page, I have the Region Definition:
    Type - SQL Query (PL/SQL Function body Returning SQL Query)
    Region Source -
    DECLARE
    l_sql VARCHAR2(50);
    BEGIN
    Call Function_One(arg1, arg2 ..) ;
    IF ( :P11_REQ = Value1 ) THEN
    l_sql := ' SELECT Col1, Col2, Col3 FROM View1 ' ;
    ELSE
    l_sql := ' SELECT Col1, Col2, Col3 FROM View2 ' ;
    END IF;
    RETURN l_sql;
    END;
    Please note:
    1. ' View1 ' and ' View2 ' are views on two tables.
    2. The checkboxes are needed to select rows from these views to be inserted into another table for further processing.
    Questions:
    1. Can Checkboxes be added to views also, or, to tables only?
    2. If checkboxes can be added to views, How can I do that to each of the rows that will be returned?
    3. Is there a way to use ' Select * FROM View1 ', and be able to add the checkbox to each of the rows ?
    Would appreciate your help.
    Vasan

    Vasan,
    I usually call a plsql function to generate the HTML when I need a custom component like that. ie: create a procedure in a package. this should give you the idea. I usually create a dynamic plsql region to call the below procedure like this
    begin
    printTableWithCheckboxes();
    endl;
    procedure printTableWithCheckboxes is
    begin
    htp.p('<table>');
    for rec in (select id, name from test) loop
    htp.p('<tr>');
    htp.p('<td><input type="checkbox" name="' || rec.name || '" value="' || rec.id || '" /> </td>');
    htp.p('</tr>');
    end loop;
    end printTableWithCheckBoxes;

  • Unexpected behavior of checkbox with help text

    Hi everyone.
    I'm using a checkbox to achieve a yes/no user input and I've noticed something strange. Whenever the user clicks on the help text (label) associated with the checkbox, the help text pops up and the checkbox changes state.
    For example, if the checkbox is unchecked, if the user clicks on the label / help text, when they close the popup, the box is checked.
    It's not the end of the world or anything, but could be confusing for end users and so is undesirable. Is this a known issue? Maybe something that could be changed in a future release?
    regards,
    Kieran

    Change this -
    <div id="Layer1" style="position:absolute; width:296px;
    to this -
    <div id="Layer1" style="position:relative; width:296px;
    and reposition the div.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "kc41082" <[email protected]> wrote in
    message
    news:ebi7s4$5bp$[email protected]..
    > Can somebody please help me? I would appreciate it more
    than you know. I
    > am not
    > all that good at writing code -- in fact, I know very
    little about it.
    > However,
    > I love to design. Therefore, I periodically build
    websites for small
    > businesses
    > pro bono.
    >
    > I built a site in Dreaamweaver using table cells. In one
    of my table
    > cells, I
    > would like scrolling text. However, I do not want the
    text to fill up the
    > entire cell (margins on each side of text so it does not
    extend to edges
    > of
    > table cell). To do this, I inserted a layer and set it
    on top of the table
    > cell, where I want the text. I told it to scroll when
    the text overflows.
    > However, although it looks fine on screen, the text
    moves over to the left
    > when
    > I load it in my browser. I cannot figure it out!!! I
    want to change it
    > (maybe)
    > RELATIVE (instead of absolute) to my table cell, but
    can't get that to
    > work. I
    > have seen the code you have suggested to people , but
    don't understand
    > where to
    > insert the code into my website.
    >
    > Will somebody check it out for me and offer me a
    suggestion? It can't be
    > too
    > difficult to fix. Please visit kaycee.mutpup.com and
    click on the link
    > provided. It will take you to the temporary site I have
    posted.
    >
    > THANK YOU!
    >

  • Filling checkboxes with data from database

    Hello.
    I need help setting a checkbox value to checked if the corresponding field has "Yes" saved in the database.
    I can do this with textboxes, but haven't figured out how to do it with checkboxes or drop down lists.
    If you can help, please do.
    Thanks.

    In all honesty, problems like this is why programmers tend to make more money than web developers. :) You more or less need to figure out what you want to happen, and then write the code to make that happen. Let me give you an example...
    Let's say we're building a web site that requires people to register and then log in. When they register, they get a checkbox where they can opt in for spam. We've decided to store the user's preference in a database, essentially a field called spam which contains either a "yes" or a "no" value. When the time comes to send out those emails, we simply select all records in the database where that spam field is set to "yes".
    So far, so good.
    If the user decides to check that opt-in checkbox, then we want to set the spam field to "yes". If he already exists in the database, we can use an SQL update statement to set the field. If he doesn't exist, we'll have to create a record for him and set all relevant fields with an insert statement. If he unchecks the box (or leaves it unchecked), then we want to do the same thing but make sure the spam field is set to "no".
    When the user clicks on the submit button, the checkbox is submitted (or not) to the server as one of the parameters. We simply parse the parameters, see if the checkbox was checked or not, then write a little bit of JSP (or Java) code that sends the appropriate SQL statement as above, to the database.
    That's the basic concept.
    There are many slight variations. For example, several web sites will fill in that opt-in checkbox by default every time you visit their site, and you have to uncheck it if you don't want spam. The logic remains the same - just write a little bit of code that sees if the form passed you the checkbox filled in, and then either fill in, or erase the corresponding field in the database.
    (I'm not bothering to add code here because there are many ways to do this, and which way is best really depends on what code college_amy has written so far.)

Maybe you are looking for

  • How to calculate the rotation degree of tick marks

    Hello Again, Thanks to so much help that I received here, I've been able to move right along in learning how to perform my job digitally instead of with an old camera.  In my last discussion, I learned out to make the tick marks using copies and rota

  • How to modify my password on my current account?

    I need to reinitiate my password on my current account [email protected] but because I have changed of supplier, when the system sent an email to reinitiate the password because it has been desactivated by the company, I am not able to indicate anoth

  • Error in RKM SAP BW importing a cube with 15 dimensions.

    Hi All, We have a error in the RKM SAP BW. It work's fine for infocubes with few dimensions (4-5). When we try to reverse engeneer of a cube with 15 dimensions, that fails in step "Get InfoCubes" with that error in Operator tab. org.apache.bsf.BSFExc

  • How to make the calculation or formula in bottom of the coloum

    How to make the calculation or formula in bottom of the coloum in Discoverer report. Regadrs Manikandan

  • How to retrieve the user id that is visiting my web page

    Hello, I wonder if somebody could help... I have an applet in one of my web pages. I would like to control who is visiting that applet , and with "who" I mean the user id that he/she used to logon to the PC. So what I want is to keep in a file , all