How to Add a Checkbox to a databeans.RowSetBrowser

Hello,
I was wondering if anyone knows if you can a checkbox to the Data Web Bean Rowset Browser. I would like to have a checkbox associated with each row that is displayed in the rowset browser. Please let me know if this is possible, and if so any pointers.
Thanks in advance,
Jason

I have the same problem ... when I can change the type of my grid column, exception is thrown. Ia explored this problem and solved it. Problem is really in the SQL query in the naming of SQL columns. Each of SQL columns in SQL query must have the name. If some column has not the name (for example SELECT '', ... or SELECT COALESCE()...), exception is thrown, when you can change the type of the grid column...
Examples:
SELECT cardcode, cardname FROM ocrd ..... is OK, because first column has name "cardcode" and second has name "cardname"
SELECT T0.cardcode, T1.cardname FROM ocrd T0 ..... is OK, because first column has name "cardcode" and second has name "cardname"
SELECT T0.cardcode, COALESCE(T0.cardname, '') FROM ocrd T0 ..... is WRONG, because first column has name "cardcode", but second column has not name!!! (=empty name of second column), and that is why you must name this column with clause AS 'xxxx', for example:
SELECT T0.cardcode, COALESCE(T0.cardname, '') AS 'any_name_of_column' FROM ocrd T0 ..... is OK, because first column has name "cardcode" and second has name "any_name_of_column"
SELECT T0.cardcode, '' FROM ocrd T0 ..... is WRONG, because first column has name "cardcode", but second column has not name!!! (=empty name of second column), and that is why you must name this column with clause AS 'xxxx', for example:
SELECT T0.cardcode, '' AS 'any_name_of_column' FROM ocrd T0 ..... is OK, because first column has name "cardcode" and second has name "any_name_of_column"

Similar Messages

  • How to add a checkbox to dynamic itab  so that i can select some records

    How to add a checkbox to dynamic itab  so that i can select some records in the alv and can display them in another alv using a button
    I have requirement where i have to display the dynamic itab records in an alv ....Some records from this alv output has to be selected through checkbox  provided in the first column .( I will get to know the structure of the itab only at runtime ,so iam using dynamic itab)

    Hi,
       I tried and finally i got it , Just try for it.
    type-pools : slis.
    PARAMETERS : p_tab type dd02l-tabname.
    data : ref_tabletype  type REF TO cl_abap_tabledescr,
           ref_rowtype TYPE REF TO cl_abap_structdescr.
    field-symbols  : <lt_table>  type   standard TABLE ,
           <fwa> type any,
           <field> type abap_compdescr.
    data : lt_fcat type lvc_t_fcat,
           ls_fcat type lvc_s_fcat,
           lt_fldcat type SLIS_T_FIELDCAT_ALV,
           ls_fldcat like line of lt_fldcat.
    data : ref_data type REF TO data,
            ref_wa type ref to  data.
    ref_rowtype ?= cl_abap_typedescr=>DESCRIBE_BY_name( p_name = p_tab ).
    TRY.
    CALL METHOD cl_abap_tabledescr=>create
      EXPORTING
        p_line_type  = ref_rowtype
      receiving
        p_result     = ref_tabletype.
    CATCH cx_sy_table_creation .
    write : / 'Object Not Found'.
    ENDTRY.
    *creating object.
    create data ref_data type handle ref_tabletype.
    create data ref_wa type handle ref_rowtype.
    *value assignment.
    ASSIGN ref_data->* to <lt_table>.
    assign ref_wa->* to <fwa>.
    loop at ref_rowtype->components ASSIGNING <field>.
      ls_fcat-fieldname = <field>-name.
      ls_fcat-ref_table = p_tab.
      append ls_fcat to lt_fcat.
    if lt_fldcat[] is  INITIAL.
        ls_fldcat-fieldname = 'CHECKBOX'.
        ls_fldcat-checkbox = 'X'.
        ls_fldcat-edit = 'X'.
        ls_fldcat-seltext_m = 'Checkbox'.
        append ls_fldcat to lt_fldcat.
      endif.
      clear ls_fldcat.
      ls_fldcat-fieldname = <field>-name.
      ls_fldcat-ref_tabname = p_tab.
      append ls_fldcat to lt_fldcat.
    endloop.
    loop at lt_fldcat into ls_fldcat.
      if sy-tabix = 1.
        ls_fldcat-checkbox = 'X'.
        ls_fldcat-edit = 'X'.
    modify lt_fldcat FROM ls_fldcat
        TRANSPORTING checkbox edit.
    endif.
    endloop.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
      EXPORTING
        it_fieldcatalog           = lt_fcat[]
      IMPORTING
        ep_table                  = ref_data.
    assign ref_data->* to <lt_table>.
    select * FROM (p_tab) into table <lt_table>.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       IT_FIELDCAT                       = lt_fldcat[]
      TABLES
        t_outtab                          = <lt_table>.
    Thanks & Regards,
    Raghunadh .K

  • Please Help: How to add a Checkbox field to a JTable

    Hi,
    I am trying to add a checkbox filed to a JTable with DefaultTableModel.
    I have tried fro hours. Just Does not work.
    Here is my sample code:
    DefaultTableModel model = new DefaultTableModel();
    JTable table = new JTable(model);
    Object[] data;
    data = new Object[2];
    data[0]= "string"
    data[2] = new Boolean(false)
    model.addRow(data);     
    What is missing in here?
    Thanks,
    Tara

    you can do that with the help of DefaultTableModel alone
    if u r so determined to use DefaultTableModel u need to have a subclass of it
    following sample may satisfy u ...
    import javax.swing.*;
    import java.awt.*;
    import java.beans.*;
    import java.awt.event.*;
    import javax.swing.table.*;
    public class MyTable extends JApplet{
         Object o[] = {"Name","Address","city","Vegetarian"};
         Object data[][] = {
              {"a","a","pune",new Boolean(true)},
              {"Alison", "Huml","mumbai",new Boolean(true)}
         class model extends DefaultTableModel
              model(Object[][] data,Object[] cn)
                   super(data,cn);
              public Class getColumnClass(int i)
                   return getValueAt(0,i).getClass();
              public Object getValueAt(int i,int j)
                   return data[i][j];
         model m = new model(data,o);
         JTable t1 = new JTable(m);
         public void init()
              Container c1 = new Container();
              c1 = getContentPane();
              c1.add(t1);
              TableColumn tc = t1.getColumnModel().getColumn(2);
              JComboBox jc = new JComboBox();
              jc.addItem("Pune");
              jc.addItem("Mumbai");
              jc.addItem("Madras");
              tc.setCellEditor(new DefaultCellEditor(jc));
    bye
    Amol

  • How to add a checkbox to PHP in DW4?

    I'm using DW 4 and need to add a check box/tick box in a PHP document.
    Is there an easy way to do it in DW where it inputs the checkbox code & allows you to add text next to the checkbox?

    If your document has the php extension, then you should see the PHP tab group on your toolbar. Click PHP<Forms< then you should see an option for checkbox or checkbox group which will open a wizard dialog window to walk you through the process.

  • How to add a checkbox to an ALV in WDA?

    Hiya,
    I need a table with a column as a checkbox within my web dynpro.
    So I created a structure in the context, where the column for the checkbox is setup as type WDY_BOOLEAN:
    Unfortunately in the ALV it appears as a non-editable checkbox:
    Anyone know what I've done wrong?
    Thanks in advance!

    Hiya,
    I've added the following code and it seems to work. Could you just check and then I can close this discussion.
    DATA:
           lr_alv_usage       TYPE REF TO if_wd_component_usage,
           lr_if_controller   TYPE REF TO iwci_salv_wd_table,
           lr_config          TYPE REF TO cl_salv_wd_config_table,
           lt_columns         TYPE        salv_wd_t_column_ref.
    * Instantiate the ALV Component
       lr_alv_usage = wd_this->wd_cpuse_alv_table( ).
    * Get reference to model
       lr_if_controller = wd_this->wd_cpifc_alv_table( ).
       lr_config        = lr_if_controller->get_model( ).
    *Enable the non-read only fields to be edited.
       lr_config->if_salv_wd_table_settings~set_read_only( value = abap_false ).
    Thanks!

  • How to add a checkbox coulmn to my Data Grid row?

    Dear All ,
    I have a Data Grid which have lets says 6 columns. I want to add anew column which allow the user to select it or not. Meaning if the user select the box a hack will be shown.
    I want to you this coz I have a function which send an email to the user if the line (Invoice line) if selected. Now if there is more than one invoice (Line) I want the user to first select the checkbok and send press the send function button.
    Later on I will create a loop in the Send function which will only send mails if the line check box is checked.
    Would you please help me :)
    Ps: I am using ligth switch 2008   (C#)
    Thanks,
    Zayed

    Hello Zayed
    I would recommend that you read through this brilliant article by
    Paul van Bladel here or even look at a post on
    this forum by Sven Elm. I have looked at and followed these in the past and it works perfectly.
    If you found this post helpful, please mark it as helpful. If by some chance I answered the question, please mark the question as answered. That way you will help more people like me :)

  • How to add selected values from table(selected using checkbox)to table?

    Hi All,
    i have created simple page with search panel with table in table i have created one column as check box for selecting.
    here what my requirement is i need to do search multiple times to add some roles to from some different categories.here whenever i searched i ll get some roles into table there i ll select some role and i ll click add buttion. whenever i click add i need to add those roles into some other table finally i ll submit added roles.
    here i followed one link http://www.oracle.com/technetwork/developer-tools/adf/learnmore/99-checkbox-for-delete-in-table-1539659.pdf
    i used same code and able to see selected row in console, as object array how to add these into table.
    please help me out
    Thanks in advance
    siva shankar

    Thank you for a quick reply
    i used the same thing before i go for table check box concept.here what i observed is when i search i am getting some results i am able to shuttle.but if i search again the shuttle is refreshing with new values even not available list its refreshing selected list. IF dont want refresh selected ones.
    my usecase after make some searches I will select some roles from different categories at finally i ll submit.
    i hope you understand me requirement. please suggest me is this requirement is possible in shuttle component? if yes please guide me.
    thanks
    Siva Sankar

  • How to add checkboxes to frame

    So I have two classes in my package. I am having trouble adding the checkbox group to my frame. I got it to add to my applet but I can not figure out how to add it to my frame. Here is what I have so far. When I run this program it puts the checkboxes in my applet and not in my frame.
    this is my painter class:
    package pt;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2006</p>
    * <p>Company: </p>
    * @author unascribed
    * @version 1.0
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    public class painter extends Applet {
    private int xValue=-10, yValue=-10;
    MyFrame x;
    Checkbox Red, Black, Magenta, Blue, Green, Yellow;
    CheckboxGroup cbg;
    public void init()
    x= new MyFrame("Christie's Window");
    x.show();
    x.resize(250,100);
    cbg = new CheckboxGroup();
           Red = new Checkbox("Red", cbg,true);
           Black = new Checkbox("Black", cbg,false);
           Magenta = new Checkbox("Magenta",cbg,false);
           Blue = new Checkbox("Blue", cbg, false);
           Green = new Checkbox("Green", cbg, false);
           Yellow = new Checkbox("Yellow", cbg, false);
           add(Red);
           add(Black);
           add(Magenta);
           add(Blue);
           add(Green);
           add(Yellow);
         addMouseMotionListener(new MotionHandler(this));
    public void paint(Graphics g)
    g.drawString("Drag the mouse to draw", 10, 20);
    g.fillOval(xValue, yValue, 4,4);
    //Override Component class update method to allow all ovals
    // to remain on the screen by not clearing the background
    public void update(Graphics g)   { paint(g); }
    // set the drawing coordinates and repaint
    public void setCoordinates(int x, int y)
      xValue = x;
      yValue = y;
      repaint();
    // Class to handle only mouse drag events for the Drag applet
    class MotionHandler extends MouseMotionAdapter {
      private painter dragger;
      public MotionHandler(painter d)  { dragger = d; }
      public void mouseDragged( MouseEvent e)
        { dragger.setCoordinates( e.getX(), e.getY() );   }
        } and here is MyFrame class:
    package pt;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2006</p>
    * <p>Company: </p>
    * @author unascribed
    * @version 1.0
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    public class MyFrame extends Frame {
    MyFrame(String x){
       super(x);
        public boolean handleEvent(Event evtObj) {
          if(evtObj.id==Event.WINDOW_DESTROY) {
            hide();
            return true;
          return super.handleEvent(evtObj);
    }

    here's your conversion, with listeners to change the color
    //import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    //public class painter extends Applet {
    class painter extends Frame {
    Color color = Color.RED;
    private int xValue=-10, yValue=-10;
    //MyFrame x;
    Checkbox Red, Black, Magenta, Blue, Green, Yellow;
    CheckboxGroup cbg;
    //public void init()
    public painter()
    //x= new MyFrame("Christie's Window");
    setTitle("Christie's Window");
    //x.show();
    //x.resize(250,100);
    setSize(600,400);
    setLocation(200,100);
    cbg = new CheckboxGroup();
           Red = new Checkbox("Red", cbg,true);
           Red.addItemListener(new ItemListener(){
            public void itemStateChanged(ItemEvent ie){
              if(Red.getState()) color = Color.RED;}});
           Black = new Checkbox("Black", cbg,false);
           Black.addItemListener(new ItemListener(){
            public void itemStateChanged(ItemEvent ie){
              if(Black.getState()) color = Color.BLACK;}});
           Magenta = new Checkbox("Magenta",cbg,false);
           Magenta.addItemListener(new ItemListener(){
            public void itemStateChanged(ItemEvent ie){
              if(Magenta.getState()) color = Color.MAGENTA;}});
           Blue = new Checkbox("Blue", cbg, false);
           Blue.addItemListener(new ItemListener(){
            public void itemStateChanged(ItemEvent ie){
              if(Blue.getState()) color = Color.BLUE;}});
           Green = new Checkbox("Green", cbg, false);
           Green.addItemListener(new ItemListener(){
            public void itemStateChanged(ItemEvent ie){
              if(Green.getState()) color = Color.GREEN;}});
           Yellow = new Checkbox("Yellow", cbg, false);
           Yellow.addItemListener(new ItemListener(){
            public void itemStateChanged(ItemEvent ie){
              if(Yellow.getState()) color = Color.YELLOW;}});
    Panel p = new Panel();
           p.add(Red);
           p.add(Black);
           p.add(Magenta);
           p.add(Blue);
           p.add(Green);
           p.add(Yellow);
    add(p,BorderLayout.NORTH);
         addMouseMotionListener(new MotionHandler(this));
    addWindowListener(new WindowAdapter(){
          public void windowClosing(WindowEvent we) { System.exit(0); }});
    public void paint(Graphics g)
    super.paint(g);
    g.setColor(color);
    g.drawString("Drag the mouse to draw", 10, 75);
    g.fillOval(xValue, yValue, 4,4);
    //Override Component class update method to allow all ovals
    // to remain on the screen by not clearing the background
    public void update(Graphics g)   { paint(g); }
    // set the drawing coordinates and repaint
    public void setCoordinates(int x, int y)
      xValue = x;
      yValue = y;
      repaint();
    // Class to handle only mouse drag events for the Drag applet
    class MotionHandler extends MouseMotionAdapter {
      private painter dragger;
      public MotionHandler(painter d)  { dragger = d; }
      public void mouseDragged( MouseEvent e)
        { dragger.setCoordinates( e.getX(), e.getY() );   }
      public static void main(String[] args){new painter().setVisible(true);}
    }

  • How can we add a checkbox in form (Scripts)

    Hello Experts,
             i want to add a checkbox in the form. how can v add a check box in the form. i tried with sap scripts symbols like sym_checkbox but it's not working.
    and i can print a small box by using Box statement. but i need exactly a check box. how can v create it in scripts.
    thanks in advance.

    Hi,
    Please refer the links,
    Check Box With Tick Mark on Sap Script
    putting tick mark into check box in smartform
    Regards,
    Hema.
    Reward points if it is useful.

  • How to you add a checkbox as database item please?

    I am trying to add a checkbox item as database item , and when I check it e.g , that value should be saved in the database .
    It's not working . I check it but in the database , the value remains unchanged . Any help please ? Thanks.

    To save the value of a CheckBox to a database table, your CheckBox item should be a Base Table Item. Your CheckBox Item type should match your table's column data type. For example, if your CheckBox's Check value is 'Y' and Unchecked value is 'N' then your table's column data type should CHAR(1) or VARCHAR2(1). Also, set the Check Box Mapping of Other Values to Not Allowed if your CheckBox will only be Y or N. Now, when you save your Form, the value of the CheckBox will automatically be saved to your table.
    Can you please clarify what you mean by this please ?You have updated the On-insert and/or On-update triggers with the insert and/or update statements accordingly?>
    My guess is that 987583 is referring to if your CheckBox is NOT a base table item, then you would need to use the On-Insert and On-Update triggers to update your database table correctly.
    It is always best to base your Block objects on Table objects. Then Forms will do most of the work for you so you don't have to write code to perform DML.
    Hope this helps.
    Craig...

  • How to add CheckBoxs to a scrollPane

    I have a file I�m getting user info out of and finding certain information the
    User enters, I�m making a query, I�m taking the found items and making an array of Checkboxes out of them witch is working my problem is adding the Checkboxes to the scroll Pane
    public class Frame1 extends JFrame{
    public static Panel listan = new Panel();
    JCheckBox[] jCheckBox1 ;
    JScrollPane scrollPane1 = new JScrollPane(list);
    //other Window objects
    //first method
    private void jbInit() throws Exception {
    //puts all window objects together
    // Constructs user screen
    list.setLayout(verticalFlowLayout1);
    panel1.add(scrollPane1, new XYConstraints(118, 32, 128, 195));
    // i have a find buttion that takes all infoamtion out of file
    // and puts in an array then finds user enterd infomation
    // this is just example code that just adds CheckBoxs to the scrollPane
    // and is Basically the same way the other program does
    // second method
    void addcheckbox_actionPerformed(ActionEvent e) {
    jCheckBox1 = new JCheckBox[50];
    for (int i = 0; i < 50; i++) {
    String checkboxText = ("Checkbox #: " + (i + 1));
    jCheckBox1[i] = new JCheckBox(checkboxText);
    for (int i = 0; i < 50; i++) {
    list.add(jCheckBox1, null);
    My problem is that I can�t add the checkboxes at the second method but it works in the first, I can add in the first because I initialize in the second.

    If you want something to compile here is all my example code
    I will incorporate it to my 30 page program
    Here is what I want my code to do
    package list;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import com.borland.jbcl.layout.*;
    import java.awt.Checkbox;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2008</p>
    * <p>Company: </p>
    * @author not attributable
    * @version 1.0
    public class Frame1 extends JFrame {
      public static boolean ch=true;
      JPanel contentPane;
      GridLayout gridLayout1 = new GridLayout();
      JPanel panel1 = new JPanel();
      XYLayout xYLayout1 = new XYLayout();
      JButton jButton1;
      JButton jButton2;
      JButton addcheckbox;
      JCheckBox[] jCheckBox1 ;
      JScrollPane scrollPane1 = new JScrollPane();
      JPanel list = new JPanel();
      VerticalFlowLayout verticalFlowLayout1 = new VerticalFlowLayout();
      //Construct the frame
      public Frame1() {
        enableEvents(AWTEvent.WINDOW_EVENT_MASK);
        try {
          jbInit();
        catch (Exception e) {
          e.printStackTrace();
      //Component initialization
    // method one
      private void jbInit() throws Exception {
        contentPane = (JPanel)this.getContentPane();
        jButton1 = new JButton();
        jButton2 = new JButton();
        addcheckbox = new JButton();
        this.setContentPane(contentPane);
        this.setLocale(java.util.Locale.getDefault());
        this.setResizable(false);
        this.setSize(new Dimension(400, 300));
        this.setState(Frame.NORMAL);
        this.setTitle("Frame Title");
        contentPane.setOpaque(true);
        contentPane.setRequestFocusEnabled(true);
        contentPane.setLayout(gridLayout1);
        panel1.setLayout(xYLayout1);
        jButton1.setSelected(false);
        jButton1.setText("Print");
        jButton1.addActionListener(new Frame1_jButton1_actionAdapter(this));
        jButton2.setText("select all/none");
        jButton2.addActionListener(new Frame1_jButton2_actionAdapter(this));
        addcheckbox.setBorderPainted(true);
        addcheckbox.setText("add");
        addcheckbox.addActionListener(new Frame1_addcheckbox_actionAdapter(this));
        scrollPane1.setLocale(java.util.Locale.getDefault());
        list.setLayout(verticalFlowLayout1);
        contentPane.add(panel1, null);
        panel1.add(scrollPane1, new XYConstraints(118, 32, 128, 195));
        scrollPane1.getViewport().add(list, null);
        //scrollPane1.add(listan, null);
        panel1.add(jButton1, new XYConstraints(261, 92, 90, 39));
        panel1.add(jButton2,   new XYConstraints(262, 152, 108, 30));
        panel1.add(addcheckbox, new XYConstraints(25, 49, -1, 35));
      //Overridden so we can exit when window is closed
      protected void processWindowEvent(WindowEvent e) {
        super.processWindowEvent(e);
        if (e.getID() == WindowEvent.WINDOW_CLOSING) {
          System.exit(0);
      void jButton1_actionPerformed(ActionEvent e) {
        String checkprint = "selected:\n";
        for (int x = 0; x < jCheckBox1.length; x++) {
          if (jCheckBox1[x].isSelected()) {
             checkprint = checkprint + jCheckBox1[x].getText()+"\n";
        System.out.println(checkprint);
      void jButton2_actionPerformed(ActionEvent e) {
        for (int x = 0; x < jCheckBox1.length; x++) {
          if (ch == true) {
            jCheckBox1[x].setSelected(true);
          else{
            jCheckBox1[x].setSelected(false);
    if (ch == true)
          ch=false;
        else
          ch=true;
    //method two
      void addcheckbox_actionPerformed(ActionEvent e) {
        jCheckBox1 = new JCheckBox[50];
            for (int i = 0; i < 50; i++) {
              String checkboxText = ("Checkbox #: " + (i + 1));
              jCheckBox1[i] = new JCheckBox(checkboxText);
            for (int i = 0; i < 50; i++) {
             list.add(jCheckBox1, null);
    class Frame1_jButton1_actionAdapter implements java.awt.event.ActionListener {
    Frame1 adaptee;
    Frame1_jButton1_actionAdapter(Frame1 adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.jButton1_actionPerformed(e);
    class Frame1_jButton2_actionAdapter implements java.awt.event.ActionListener {
    Frame1 adaptee;
    Frame1_jButton2_actionAdapter(Frame1 adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.jButton2_actionPerformed(e);
    class Frame1_addcheckbox_actionAdapter implements java.awt.event.ActionListener {
    Frame1 adaptee;
    Frame1_addcheckbox_actionAdapter(Frame1 adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.addcheckbox_actionPerformed(e);
    }doesn�t work but if I take all of method two and put it in one it workspackage list;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import com.borland.jbcl.layout.*;
    import java.awt.Checkbox;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2008</p>
    * <p>Company: </p>
    * @author not attributable
    * @version 1.0
    public class Frame1 extends JFrame {
    public static boolean ch=true;
    JPanel contentPane;
    GridLayout gridLayout1 = new GridLayout();
    JPanel panel1 = new JPanel();
    XYLayout xYLayout1 = new XYLayout();
    JButton jButton1;
    JButton jButton2;
    JButton addcheckbox;
    JCheckBox[] jCheckBox1 ;
    JScrollPane scrollPane1 = new JScrollPane();
    JPanel list = new JPanel();
    VerticalFlowLayout verticalFlowLayout1 = new VerticalFlowLayout();
    //Construct the frame
    public Frame1() {
    enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    try {
    jbInit();
    catch (Exception e) {
    e.printStackTrace();
    //Component initialization
    private void jbInit() throws Exception {
    // this is the same code in method two
    jCheckBox1 = new JCheckBox[50];
    for (int i = 0; i < 50; i++) {
    String checkboxText = ("Checkbox #: " + (i + 1));
    jCheckBox1[i] = new JCheckBox(checkboxText);
    for (int i = 0; i < 50; i++) {
    list.add(jCheckBox1[i], null);
    contentPane = (JPanel)this.getContentPane();
    jButton1 = new JButton();
    jButton2 = new JButton();
    addcheckbox = new JButton();
    this.setContentPane(contentPane);
    this.setLocale(java.util.Locale.getDefault());
    this.setResizable(false);
    this.setSize(new Dimension(400, 300));
    this.setState(Frame.NORMAL);
    this.setTitle("Frame Title");
    contentPane.setOpaque(true);
    contentPane.setRequestFocusEnabled(true);
    contentPane.setLayout(gridLayout1);
    panel1.setLayout(xYLayout1);
    jButton1.setSelected(false);
    jButton1.setText("Print");
    jButton1.addActionListener(new Frame1_jButton1_actionAdapter(this));
    jButton2.setText("select all/none");
    jButton2.addActionListener(new Frame1_jButton2_actionAdapter(this));
    addcheckbox.setBorderPainted(true);
    addcheckbox.setText("add");
    addcheckbox.addActionListener(new Frame1_addcheckbox_actionAdapter(this));
    scrollPane1.setLocale(java.util.Locale.getDefault());
    list.setLayout(verticalFlowLayout1);
    contentPane.add(panel1, null);
    panel1.add(scrollPane1, new XYConstraints(118, 32, 128, 195));
    scrollPane1.getViewport().add(list, null);
    //scrollPane1.add(listan, null);
    panel1.add(jButton1, new XYConstraints(261, 92, 90, 39));
    panel1.add(jButton2, new XYConstraints(262, 152, 108, 30));
    panel1.add(addcheckbox, new XYConstraints(25, 49, -1, 35));
    //Overridden so we can exit when window is closed
    protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if (e.getID() == WindowEvent.WINDOW_CLOSING) {
    System.exit(0);
    void jButton1_actionPerformed(ActionEvent e) {
    String checkprint = "selected:\n";
    for (int x = 0; x < jCheckBox1.length; x++) {
    if (jCheckBox1[x].isSelected()) {
    checkprint = checkprint + jCheckBox1[x].getText()+"\n";
    System.out.println(checkprint);
    void jButton2_actionPerformed(ActionEvent e) {
    for (int x = 0; x < jCheckBox1.length; x++) {
    if (ch == true) {
    jCheckBox1[x].setSelected(true);
    else{
    jCheckBox1[x].setSelected(false);
    if (ch == true)
    ch=false;
    else
    ch=true;
    void addcheckbox_actionPerformed(ActionEvent e) {
    class Frame1_jButton1_actionAdapter implements java.awt.event.ActionListener {
    Frame1 adaptee;
    Frame1_jButton1_actionAdapter(Frame1 adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.jButton1_actionPerformed(e);
    class Frame1_jButton2_actionAdapter implements java.awt.event.ActionListener {
    Frame1 adaptee;
    Frame1_jButton2_actionAdapter(Frame1 adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.jButton2_actionPerformed(e);
    class Frame1_addcheckbox_actionAdapter implements java.awt.event.ActionListener {
    Frame1 adaptee;
    Frame1_addcheckbox_actionAdapter(Frame1 adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.addcheckbox_actionPerformed(e);
    }Edited by: deme on Feb 27, 2008 6:48 AM
    Edited by: deme on Feb 27, 2008 6:51 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Eclipse: How to add checkbox on screen

      Hi,
    I am working on Eclipse, can u please give me example how we can create Checkbox.

    Hi Nishant ,
    Follow the API documentation of SAP UI 5 for all the simple and complex controls.
    Here is the link for the checkbox control - CheckBox - SAPUI5 Demo Kit
    Example :
    // create a simple CheckBox
    var oCB = new sap.ui.commons.CheckBox({
    text : 'I want to receive the newsletter',
    tooltip : 'Newsletter checkbox',
    checked : true,
    change : function() {if(oCB.getChecked()){alert('YES')}else{alert('NO')};}
    // attach it to some element in the page
    oCB.placeAt("sample1");

  • How to add/create additional page in Crystal Report Layout SAP B1

    Hi,
    I wanna ask about How to add/create additional page in Crystal Report Layout SAP B1 ?
    I want when user print Purchase Order then on last page also print some page like Penalty Clause etc.
    Pls help me to find the solution.
    Br,
    Thomas Marsetyo

    Hi,
    In your report footer, set it to create a new page before it is printed (In 'Section Expert', select the Report Footer -> 'Paging' tab -> Check 'New Page Before' checkbox). Throw your Terms & Conditions into the Report Footer section.
    If you already have a Report Footer that you want to keep, just split the footer into two sections (Right-click the Report Footer section -> 'Insert Section Below') and follow the same procedure for the newly created section.
         Check this Link
    http://stackoverflow.com/questions/9232239/adding-an-additional-page-to-end-of-a-crystal-report
    http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=18960
    Regards,
    Manish

  • How to use a checkbox

    I looked at the help for a single checkbox, but there are no examples for it. I have not been able to figure out how to find the state of the box when I submit the page. It is always its default value.
    Help says it can be used as a boolean control. What does this mean? I tried binding a boolean to SelectedValue, escape, but isEscape() does not return the right value. I tried removing this, and then checkbox.getSelectedValue() also does not work.
    Help please.
    Jim

    This shows a demo of checkbox:
    add a textField
    add a checkbox without any change of properties
    add a button - in properties set text to "Change"
    --      doubleclick the button and replace TODO with following code:
         if (checkbox2.isChecked()) {
    checkbox2.setSelected("false");
    } else {
    checkbox2.setSelected("true");
    add another button - in properties set text to "Read"
    --     doubleclick the button and replace TODO with following code:
         if (checkbox2.isChecked()) {
         textField7.setText("true");
         } else {
         textField7.setText("false");
    Run:
    Click checkbox and then Read-button
    Click change-button and then read-button
    If you have a DB in bottom and want a checkbox to show a value from a table
    here is a tutor for that:
    DB-table with columns id of integer, name of varchar, friend of boolean
    Drag the table from Servers to the page
    add 3 textfields
    add a dropDownlist
    rightclick --> Autosubmit on Change
    rightclick --> Bind to data --> select xDataProvider --> select desired value=id and desired display field=name
    rightclick --> Edit EventHandler --> processValueChange
    replace the TODO with
    RowKey[] xrows = xDataProvider.getRowKeys(xDataProvider.getRowCount(), null);
    xDataProvider().setCursorRow(xrows[Integer.parseInt(dropDown1.getSelected().toString())-1]);
    When select a new value the page is sent back to server and you need these 2 lines to update the fields.
    textField1.setText(dropDown1.getSelected().toString()); (Shows dropDown selected item)
    textField2.setText(xDataProvider.getCursorRow().toString()); (shows dataprovider cursorrow)
    textField3.setText(xDataProvider.getValue("DB_tablename.friend", xDataProvider.getCursorRow())); (shows value of dataprovider friend column)
    add a checkbox
    rightclick --> Bind to data --> select xDataProvider --> select desired value=id and desired display field=friend
    in checkbox properties -- Data - converter - select booleanConverter
    in checkbox properties -- Data - selected - set this to true (true represent checked checkbox)
    Run and see changes (need at least 2 rows in DB table with different values for friend)
    Please give feedback if this helps.

  • How to add the entries and how to delete the entries from custom Z-table?

    Hi Experts,
    My requirement is I need to add the entries from program to three custom z-tables . Assume as zabc1,zabc2,zabc3.
    Here how to add the entries from program to Z-table.???
    And one more requirement is I want to provide a deletion checkbox in selection screen . Initial it was unchecked. If I am giving tick mark then the entries should be deleted from above custom Z-tables. this all will done in backgroung job?
    Could you please guide me the logic how to crack this???
    Let me know if you need more Info
    Thanks
    Sanju

    Hi Sanjana,
    What you can do is to use the ABAP keyword INSERT or MODIFY to add or modify records to a given database table. Here are the syntax taken from SAP documentation:
    *Insert Statement
    INSERT dbtab
    Syntax
    INSERT { {INTO target VALUES source }
           | {     target FROM   source } }.
    Effect
    The INSERT statement inserts one or more rows specified in source in the database table specified in target. The two variants with INTO and VALUES or without INTO with FROM behave identically, with the exception that you cannot specify any internal tables in source after VALUES.
    System Fields
    The INSERT statement sets the values of the system fields sy-subrc and sy-dbcnt.
    sy-subrc Meaning
    0 At least one row was inserted.
    4 At least one row could not be inserted, because the database table already contains a row with the same primary key or a unique secondary index.
    The INSERT statement sets sy-dbcnt to the number of rows inserted.
    Note
    The inserted rows are finally included in the table in the next database commit. Up until this point, they can still be removed by a database rollback.
    *Modify Statement
    MODIFY dbtab
    Syntax
    MODIFY target FROM source.
    Effect
    The MODIFY statement inserts one or several lines specified in source in the database table specified in target, or overwrites existing lines.
    System fields
    The MODIFY statement sets the values of the sy-subrc and sy-dbcnt system fields.
    sy-subrc Meaning
    0 At least one line is inserted or changed.
    4 At least one line could not be processed since there is already a line with the same unique name secondary index in the database table.
    The MODIFY statement sets sy-dbcnt to the number of processed lines.
    Note
    The changes are transferred finally to the database table with the next database commit. Up to that point, they can be reversed using a database rollback.
    Hope it helps...
    P.S. Please award points if it helps...

Maybe you are looking for

  • My iCal calendars no longer sync adn I can't re-publish them

    I have several calendars created in my iCal for staffing schedules, from which I keep and maintain my staff shifts. The Mac the staff uses (I have a separate machine in my office) is subscribed to each of these calendars (one for each staff member) i

  • Complex mapping with deep structure

    Hi all, I need to create a complex mapping as follows: Source message: CreateOrder (0..1) -sell-order (0..1) --items-sell-order (0..1) ---items-sell-request (0..unbounded) sell-discount (0..1) sell-discount (0..unbounded) discount-id (0..1) discount-

  • How to set a value to the TextField on keyPress Event?

    Hai, I am using Jdev 11g. In my jspx page,i have an Input Text...I want to set a value to that input text when i press any button (say F2) inside that text field .I tried with clientListener and server Listener..But it is not set. In jspx page *=====

  • Error message indicating that iTunes card has not been properly activated. Please help.

    I tried to redeem an iTunes card but an error message pops up indicating that it has not been properly activated. What should I do? Please help. Thanks in advance

  • Importing still images to Premiere Pro CS5

    I have some still digital images in my computer which I want to use for a project for class. The problem I find is that when I import the images they are too big and only a portion of shows. Apparently the size of the image has to be 720 wide x 480 t