Add Jcombo in Jtable at run time

hello,
i want to add jcombo box in jtable every cell & i also add column in run time.proble is when i add new column that time last column combo is add but prievious column its remove automatic.
so give me some code & where i can get see good example for add combo in jtable.
thanks

hi j-rg,
It was really appreaciating to c ur reply, regarding the specific problem.Actually wht i was facing the peoblem, Am adding a colomn in the run time and in that column am adding a combo in each cells of that column.AS i was expecting am able to add a new colum in th erum time with the combo in each cells of that column,now when am adding another column in the run time am getting all the required things,but the problem is " in the previous cloumn am not getting that combo"(only the combo is been added in the last column).
What am expecting is the combo should be there in each cell of the column(all columns)
Am also sending the code wht am using, plz have a look below,
df1.addColumn(result);
     TableColumn aa= tb1.getColumnModel().getColumn(tb1.getColumnCount()-1);
     aa.setCellEditor(new DefaultCellEditor(comboBox));
wating for ur reply
thanks and regards
sandeep

Similar Messages

  • How can i add rows to a JTable at run time ??????

    hi there
    how can i add a row to a JTable at run time? and display the table after the change? thank you.

    For adding or removing the rows from the JTable, you have to use the methods on the table model. I would show you a simple implementation of table model.
    public class MyTableModel extends AbstractTableModel {
    private ArrayList rowsList = null;
    private String [] columns = { "Column 1" , "Column 2", "Column 3"};
    public MyTableModel() {
    rowsList = new ArrayList();
    public int getRowCount() {
    return rowsList.size();
    public int getColumnCount() {
    return columns.length;
    public void addRow(MyRow myRow) {
    //MyRow is any of your object.
    rowsList.add(myRow);
    fireTableDataChanged();
    public void removeRow(int rowIndex) {
    rowsList.remove(rowIndex);
    fireTableRowsDeleted(rowIndex, rowIndex);
    public Object getValueAt(int row, in col) {
    MyRow currentRow = (MyRow)rowsList.get(row);
    switch (col) {
    case 0:
    //return the value of first cell
    break;
    case 1 :
    //return the value of second cell
    break;
    case 2 :
    //return the value of third cell
    break;
    }Then create the table using the TableModel using the constructor new JTable(TableModel) and then when you want to add/remove a row from the table, call myTableModel.addRow(MyRow) or myTableModel.removeRow(rowIndex)....I hope that this solves your problem.

  • How to add or remove tiles at run time

    We are in the need to create following functionality through mosiac:
         1) Add tiles in layout at run time by user.
         2) Remove tiles in layout at run time by user.
         3) Option for minimize-maximize any tile in layout at runtime.
         4) Whenever any tile is minimised or removed from the layout, its operation should not run while loading the tile.
         5) User may create a layout according to his wish using available tiles and this layout should persist for the user's session.
    Is it possible to create all above by using mosaic. If not, please tell me which options can not be created.
    I have gone through the sample code found on adobe site but those are too simple to explain my needs. If there are some other sample code(which can explain my requirement), please send me the links.

    1 + 2 is possible with Mosaic today. The ClientDashboard example (part of Mosaic standard samples) shows how a user can add tiles via a menu and remove tiles using the "x" close button in the tile chrome. Adding and removing tiles can be done through the Mosaic client API.
    3) Minimizing and maximizing tiles is not yet supported (but something high on our product backlog).
    4) When a tile is removed by the user it does not run anymore in the background
    5) If you define a dynamic layout (see the Client Dashboard example) the user can re-arrange tiles within the constraint of that defined layout and those changes can be persisted within the session as well as between sessions (user can save view). Users can not change the fundamental layout definitions defined for a panel (that needs to be done in the XML definition of the panel).
    Cheers,
    Matthias

  • How can i update data in JTable at run time ?

    i am trying to build a client/server architecture for conducting quizzes & online tests.. My client will return a object to the server after the test is over, which contains details about the participant, his score and other details. i am putting the incoming object to an Vector. I'll create a new thread each time for the incoming connection and insert the object to the Vector.. Now, please tell me tat, how can i update my table automatically at run time so tat, my table is updated whenever a new object is entered into vector..
    here is my code for the table..
    public class MyTableModel extends AbstractTableModel {
        String columNames[] = { "ID", "NAME", "COLLEGE", "SCORE", "CELL" };
        /** Creates a new instance of MyTableModel */
        public MyTableModel() {
            Main.List = new Vector();
            SetDefaultData();
        public int getRowCount() {
            return Main.List == null ? 0 : Main.List.size();
        public int getColumnCount() {
            return columNames.length;
        public String getColumnName(int column) {
            return columNames[column];
        public boolean isCellEditable(int row,int col) {
            return false;
        public Object getValueAt(int rowindex, int columnindex) {
            if(rowindex < 0 || rowindex >= getRowCount())
                return "";
            Student row = (Student)Main.List.elementAt(rowindex);
            switch (columnindex)
                case 0 : return row.id;
                case 1 : return row.name;
                case 2 : return row.college;
                case 3 : return row.score;
                case 4 : return row.cell;
            return "";
        public String getTitle() {
            return "Student Table";
        private void SetDefaultData() {
            Main.List.removeAllElements();
            Main.List.addElement(new Student("CS041","Keerthivasan M","MNM",95,"9884326321"));
            Main.List.addElement(new Student("CS012","Arun M","MNM",90,"9884825780"));
            Main.List.addElement(new Student("CS019","Balaji S","MNM",79,"9841742068"));
            Main.List.addElement(new Student("CS005","Anand R","MNM",89,"9884130727"));
            Main.List.addElement(new Student("CS045","Manish J","MNM",55,"9841624625"));
            Main.List.addElement(new Student("CS013","Mangal S","MNM",5,"9841961742"));
    }

    In the future Swing related questions should be posted in the Swing forum.
    how can i update my table automatically at run time so tat, my table is
    updated whenever a new object is entered into vector..You don't update the Vector directly. You should be creating a method in your TableModel, called "addRow(...)". This method will do two things:
    a) add the Student object to the Vector
    b) invoke the fireTableRowsInserted(..) method of AbstractTableModel. This will cause the table to be repainted.

  • How to initilize the size of rows in an jtable in run time

    i am trying to retrieve data from a oracle database and display them in an jtable ,but i could not figure out how to increase the size of the table based on the number of records fetched in runtime. i also want to add checkbox for each enrty made in the jtable such that by cheching the box ,i could select the data and process it in futher frames. i use an netbean5 version for design.kindly give me giudence.

    Best thing to do is write your own table model and a Cell Renderer for the check box.
    Please follow the "How to use tables" tutorial.
    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

  • How can we add elements to component at run time  through java

    Hi,
    In my project ,I am using JArrayList to collect urls and I need to add those to JScrollPane(JTextArea) and this to frame. This works fine but I need the process of how the elements added to ArrayList simultaneusly added to JTextArea.
    pls suggest the way

    arrayList.add( someObject );
    textArea.append( someObject.toString() );

  • How to create and add an XML node at run time ?

    Hello and thanks to All of You i've been learning a lot since i use this forum..
    I'm having another problem, !!! i would like that my executeShape function insert a new XMLChildnode called "adverts"  to my Pages:XML via the evenListener of the execute_bt. I tryed copying the nodes and it works but it copy a blank "adverts" node in betwen each node copied. so i tryed with appendChild, but it works only once, then it say error. so i tryed with inserChildafter or inserChildbefore but this one doesnt work at all because "advert" doesnt exist. I understand why all my suggestions does'nt work (copied or append or insertchild), but i dont figure out how to get what i want . i love AS but im no advance in enought..
    My XML structure that I want is quite simple : i just want that every time I press the execute_bt, a new "adverts" is added to the Pages XML
    <Pages>
      <page id="Page1">
        <adverts>
          <adfile>Null</adfile>
          <adwidth>1</adwidth>
          <adheight>50</adheight>
          <adposx>514</adposx>
          <adposy>200</adposy>
        </adverts>
       <adverts>
           <adfile>Null</adfile>
           <adwidth>1</adwidth>
           <adheight>50</adheight>
           <adposx>514</adposx>
           <adposy>200</adposy>
         </adverts>
      </page>
    </Pages>
    Here is the code of the clip:
    execute_bt.addEventListener(MouseEvent.MOUSE_UP,executeShape);
    var _adWidth:uint=uint(Adwidth.text);
    var _adHeight:Number=Number(Adheight.text);
    var _adFileName:String=String(adFileName.text);
    var _adpage:String=String(PageInstanceName.text);
    var _adPosx:Number;
    var _adPosy:Number;
    var _adArrayID:int;
    var currentColor:Number;
    var i:int=0;
    var element:int=0;
    var Pages:XML=<Pages />;
    Pages.page = <page />;
    Pages.page.@id=_adpage;
    var boldText:TextFormat = new TextFormat();
    with (boldText) {
        font="Verdana";
        size=10;
        color=0xFFFFFF;
        bold=false;
        multiline=true;
    function executeShape(evt:MouseEvent):void {
        _adArrayID=i;
        currentColor=Adcolor.selectedColor;
        var Container:MovieClip= new MovieClip();
        Container.name=adFileName.text;
        Container.id=_adArrayID;
        var gr:Graphics=Container.graphics;
        gr.lineStyle();
        gr.beginFill(Adcolor.selectedColor, 2);
        gr.drawRect(0,0,(uint(Adwidth.text)*70),Number(Adheight.text)*1.68);
        gr.endFill();
        var Lbl:TextField = new TextField();
        Lbl.x=Lbl.y=1;
        Lbl.autoSize=TextFieldAutoSize.LEFT;
        Lbl.multiline=Lbl.wordWrap=true;
        Lbl.width=(uint(Adwidth.text)*65);
        Lbl.text=String(adFileName.text);
        Lbl.setTextFormat(boldText);
        var btn:Sprite=new CreateRoundRectButton(20,20,5,0,0xFFFFFF,"X",0xFF0000);
        btn.name="delete";
        btn.x=9;
        btn.y=50;
        addChild(Container);
        Container.x=514;
        Container.y=200;
        Container.addChild(Lbl);
        Container.addChild(btn);
        index.text=String(Container.id);
        file.text=String(Container.name);
        widht.text=String(uint(Adwidth.text));
        heigth.text=String(Number(Adheight.text));
        posx.text=String(Container.x);
        posy.text=String(Container.y);   
        Pages.page.appendChild(<adverts />);
       Pages.page.adverts.appendChild(<adfile />);
        Pages.page.adverts.appendChild(<adwidth />);
        Pages.page.adverts.appendChild(<adheight />);
        Pages.page.adverts.appendChild(<adposx />);
        Pages.page.adverts.appendChild(<adposy />);
        Pages.page.adverts.adfile=String(Container.name);
        Pages.page.adverts.adwidth=String(uint(Adwidth.text));
        Pages.page.adverts.adheight=String(Number(Adheight.text));
        Pages.page.adverts.adposx= String(Container.x);
        Pages.page.adverts.adposy=String(Container.y);
       //var templist:XMLList= Pages.page.adverts.copy();
        //templist[0].adfile = String(Container.name);
        //templist[0].adwidth = String(uint(Adwidth.text));
        //templist[0].adheight = String(Number(Adheight.text));
        //templist[0].adposx = String(Container.x);
        //templist[0].adposy = String(Container.y);
        //Pages.page.appendChild(templist);
        //Pages.page.insertChildAfter(Pages.page.adverts[0], templist);
        trace(Pages);
        btn.addEventListener(MouseEvent.CLICK, deleteme, false, 0, true);
        Container.addEventListener(MouseEvent.MOUSE_DOWN,StartDrag);
        Container.addEventListener(MouseEvent.MOUSE_UP,StopDrag);
        i++;

    Sorry , i Found the solution......:
    var Pages:XML=<Pages />;
    Pages.page = <page />;
    Pages.page.@id=_adpage;
    var boldText:TextFormat = new TextFormat();
    with (boldText) {
        font="Verdana";
        size=10;
        color=0xFFFFFF;
        bold=false;
        multiline=true;
    function executeShape(evt:MouseEvent):void {
        _adArrayID=i;
        currentColor=Adcolor.selectedColor;
        var Container:MovieClip= new MovieClip();
        Container.name=adFileName.text;
        Container.id=_adArrayID;
        var gr:Graphics=Container.graphics;
        gr.lineStyle();
        gr.beginFill(Adcolor.selectedColor, 2);
        gr.drawRect(0,0,(uint(Adwidth.text)*70),Number(Adheight.text)*1.68);
        gr.endFill();
        var Lbl:TextField = new TextField();
        Lbl.x=Lbl.y=1;
        Lbl.autoSize=TextFieldAutoSize.LEFT;
        Lbl.multiline=Lbl.wordWrap=true;
        Lbl.width=(uint(Adwidth.text)*65);
        Lbl.text=String(adFileName.text);
        Lbl.setTextFormat(boldText);
        var btn:Sprite=new CreateRoundRectButton(20,20,5,0,0xFFFFFF,"X",0xFF0000);
        btn.name="delete";
        btn.x=9;
        btn.y=50;
        addChild(Container);
        Container.x=514;
        Container.y=200;
        Container.addChild(Lbl);
        Container.addChild(btn);
        index.text=String(Container.id);
        file.text=String(Container.name);
        widht.text=String(uint(Adwidth.text));
        heigth.text=String(Number(Adheight.text));
        posx.text=String(Container.x);
        posy.text=String(Container.y);   
        var adverts:XML= new XML;
        adverts=<adverts />;
        adverts.adfile=<adfile />;
        adverts.adwidth=<adwidth />;
        adverts.adheight=<adheight />;
        adverts.adposx=<adposx />;
        adverts.adposy=<adposy />;
        adverts.adfile=String(Container.name);
        adverts.adwidth=String(uint(Adwidth.text));
        adverts.adheight=String(Number(Adheight.text));
        adverts.adposx= String(Container.x);
        adverts.adposy=String(Container.y);
        Pages.page.appendChild(adverts);
        trace(adverts);
        btn.addEventListener(MouseEvent.CLICK, deleteme, false, 0, true);
        Container.addEventListener(MouseEvent.MOUSE_DOWN,StartDrag);
        Container.addEventListener(MouseEvent.MOUSE_UP,StopDrag);
        i++;

  • SAMPLE CODE  + HOW ADD JCOMBOBOX IN JTABLE

    HI,
    ALL OF U
    PLZ SUGGEST ME HOW TO ADD COMBOBOX IN JTABLE.
    AND ALSO TELL HOW WE CAN ADD ITEMS IN COMBOBOX AT RUN TIME.
    PLZ SUGGEST ME.
    THANX IN ADVANCE.
    BYE

    Hi if you google you find a lot
    http://www.google.be/search?q=JTable+combobox&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:nl:official&client=firefox-a
    and
    http://www.google.be/search?q=JTable+combobox+example&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:nl:official&client=firefox-a
    Satanduvel

  • How to make a text field required at run time when the user clicks the checkbox ?

    I got a form where , there are several checkboxes and text fields associated with that checkboxes.If the use clicks on the check box then the associated
    text fields should become required.I have tried the change event and the click event for the checkboxes.It gives error in the onChnage event and I got some weird results in the on click event .Sometimes if the user click the check box , then for the 1st time the field doesnt become required , then the user onclicks the check box and when the user clicks the checkbox for the second time the field becomes required,but if i deselects the highlighted field option and selects it again the field becomes required even if the user onchecks it I am totally confused !!! Adding to it i have also written the wrong code still i achieved the desired result ?? How it can be possible . I am writing the codes below , please help me as i am working under a deadline from the client.
    onChange event :
    var newVal = this.boundItem(xfa.event.newText);
    if(newVal == 0)
        xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.Purchasecost3_1" ).validate.nullTest = "disabled";
      else
         xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.Purchasecost3_1" ).validate.nullTest = "error";
    For the onClick event :
    var a = xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row2.CostItemRecovere d_OnlyEnergyCharges").rawValue;
    //app.alert(a);
    if(a == 0)
        xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L1_1").validate.nullTest = "error";
      if(a == 1)
          xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L1_1").validate.nullTest = "disabled";
       Please help someone !!!

    I used the onchange event and wrote the code for it. I got the result . But there is a problem.All these fields are in a table and it's a dynamic table where you can add rows dynamically at the run time .I have other change event for some fields in this table .All are working fine when i add the row.But for this check box the required fields are not validated as required at the run time . I am here giving the code , Please help me .
    form1.Subform0.Subform1.Subform9.Subform10.Table48.Row2.CostItemRecovered_OnlyEnergyCharge s::change - (JavaScript, client)
    if(this.rawValue == "1")
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L1_1").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L2_1").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row5.ComplianceCheck_ L1_2").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row5.ComplianceCheck_ L2_2").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row6.ComplianceCheck_ L1_3").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row6.ComplianceCheck_ L2_3").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row7.ComplianceCheck_ L1_4").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row7.ComplianceCheck_ L2_4").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row8.ComplianceCheck_ L1_5").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row8.ComplianceCheck_ L2_5").mandatory= "error";
    else
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L1_1").mandator = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L2_1").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row5.ComplianceCheck_ L1_2").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row5.ComplianceCheck_ L2_2").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row6.ComplianceCheck_ L1_3").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row6.ComplianceCheck_ L2_3").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row7.ComplianceCheck_ L1_4").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row7.ComplianceCheck_ L2_4").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row8.ComplianceCheck_ L1_5").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row8.ComplianceCheck_ L2_5").mandatory = "disabled";

  • Adding panel into JDialog at run time problem

    Hi ,
    I am adding one component at a time into the jdialog at run time.
    What I do , when I launch jdialog instance first time I added one
    component into the jdialog. when OI press next button it removes this
    component and adding next one , but the problem is that is is not showing in the jdialog.
    Please give me any idea that
    How I can add component into jdialog at run time.
    Thaks In Advance.
    - vikas

    Hello,
    without source-code its difficult to understand where your problem is. The following sample code works 'fine':
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class AddCompoDialog extends JDialog {
         int compoCounter;
         public AddCompoDialog(){
              setLocationRelativeTo(null);
              setSize(300,300);
              JPanel mainPanel=new JPanel(new BorderLayout());
              JPanel buttonPanel =new JPanel();
              final JPanel compoPanel=new JPanel(new GridLayout(10,10));
              JButton newCompo=new JButton("add new Component");
              newCompo.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent e){
                        compoPanel.add(new JLabel("Compo #"+ ++compoCounter));
                        compoPanel.revalidate(); //Dont forget to relayout your container
              buttonPanel.add(newCompo);
              JButton close=new JButton("close Dialog");
              close.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent e) {
                        dispose();
              buttonPanel.add(close);
              mainPanel.add(buttonPanel,BorderLayout.NORTH);
              mainPanel.add(compoPanel);
              getContentPane().add(new JScrollPane(mainPanel));
         public static void main(String[] params) {
              new AddCompoDialog().setVisible(true);
    }Regards,
    Tim

  • Setting corect value in JTable while adding row @ run time

    HI All,
    Iam facing the following problems in Java Swing while using JTable..
    I have a JTable with 11 colums and i add row on run time..
    Since i needed the 11th column of the table to be of type CheckBox i used the follwing object in the DefaultTableModel class..
    Object[][] data =
                   {"1", "", "", "", "", "", new Double(0.0), new Integer(0), new Double(0.0), new Double(0.0),new Boolean(false) }
    When ever i wan't to delete a row i will click the Boolean Object ( which appears as a Check box ) and then delete that row.. For deleteing i am using 1 methods..
    1. By selecting the col by mouse and the click a button to delete the selected rows...
    2. By selecting the col by key board , using a Menu ShortCut key ( CTRL-F ) and then using the space key to on the value , then i use another Menu ShortCut key ( CTRL-D ) to delete all the selected rows..
    The above 2 methods work fine as for as deleting is concerned..
    But the problem starts while adding another row after deleting one or more rows..That 2 happens while the deletion had been done by the KEYBORD only..
    The problem is...
    If there is more than 1 rows and i select some rows of any order..And then delete them with the Keyboard option..and then add a rows , while adding the row @ the postion where the last row was deleted iam getting the 11th col. value ( which apears as a check box ) as selected..For example if there is 4 rows and i delete the 3rd and 4th row and then when i add rows its fine for the 3rd row and for the 4th row ( which was the last one which was slected to be deleted ) i get the option as a selected one..
    But while adding i use the above said Data object only..I then used the the
    JTablename.getValueAt(i,10); to print the value and iam geting false only..
    And more over when i try to focus in the cell in 1st row last column of the table by the setSelection method , the focus goes to the cell which appears to be enbled..
    My friends asked me to use the follwing methods before adding rows ..
    1. clearSelection()
    2. Validate()
    3. repaint()
    But the problem seems not over can anyone help....
    U can mail me to [email protected]
    Love,.
    Siva

    Yes, relatively easily, I think.
    In your end jump script set a second value in a different GPRM that identifies the last film played. This way the play all flag is set and you know which clip has just been seen.
    On resuming the play all you need to reset the play all flag to '1' and then look at the other GPRM to see which clip played last. Use a bunch of jump commands to get back in to the playback at the start of the next logical clip and it should continue through as before.
    The secret here is to clear the play all flag when showing a few clips, but use your 'resume play all' button to reset the flag and see where you were by reading the other GPRM.
    The downside here is that you could be in clip 3 when you exit the play all, but you would have to resume clip 3 from the start when you return as the 'Resume' info will get cleared if you start showing other clips in the mean time.
    Have you also considered setting up a video jukebox? You could then pick a selection of tracks to play in the order they were chosen and leave them to run through. This is a much trickier bit of scripting, but very possible!
    Stories could have made things easier, but given the set-up that you have built you can still get what you need from the scripting

  • Add an element to the list in run time

    There is an item in my form which is a list of values.It is getting populated based on a record group query.
    I want to let the user enter values at run time and add the values to the exiting list in the form and same
    should be added to the record group so that next time i open the form the added value can be seen.
    Is this possible?
    Regards,

    I have written this code on when_button_pressed trigger to populate the record group RGSTD and LOV(Name LOVSTD).
    I have added the element in the list using add_list_element built in. But it is not giving me proper results.
    Record group has two columns STDID and STDNAME.
    DECLARE
    ln_num NUMBER := 0;
    BEGIN
    ln_num := show_alert('ALERT15');
    IF ln_num = 88 THEN
    add_group_row('RGSTD', 1);
    set_group_char_cell('STDID', 1, 'ST00004');
    set_group_char_cell('STDNAME', 1, 'Add To List');   
    add_list_element('LOVSTD', 1, 'Add To List', 'Add To List');  
    ELSE
    NULL;
    END IF;
    END;Edited by: LostWorld on Feb 9, 2009 5:49 AM

  • Add Exisiting Table to an Already Exising Dataset at run time

    I have searched and searched
    I have found the followind to "Create" a dataset and then create and add a table
    to the dataset, 
    Example Below:
    Dim customerOrders As DataSet = New DataSet("CustomerOrders")
    Dim ordersTable As DataTable = customerOrders.Tables.Add("Orders")
    Dim pkOrderID As DataColumn = ordersTable.Columns.Add( _
        "OrderID", Type.GetType("System.Int32"))
    ordersTable.Columns.Add("OrderQuantity", Type.GetType("System.Int32"))
    ordersTable.Columns.Add("CompanyName", Type.GetType("System.String"))
    ordersTable.PrimaryKey = New DataColumn() {pkOrderID}
    What I need help with - PLEASE is 
    I already have a dataset named MyLearningDBDataSet.xsd in my Project
    I have a Table that was created as copy of a table, but was given a Different Name at run time
    How do I add this table to the Existing MyLearningDBDataSet.xsd....
    I need to be able to delete rows out of the New table that was created (that is why I make a copy of it)
    So Again : Please How do I add an Exisiting Table to an Exisiting Dataset?  Please help!  I have 
    searched and searched.

    Let me ask you this then Mr. Paul.  Can you please show me how to create the dataset at run time, add a table to it, then put a binding navigator on the form that will be bound to it.  If that is not possible, then can you show me how to have a
    have a record (row) displayed in text boxes and then how I can navigate forward a record or back a record.  Ultimately that is what I need.
    I have everything working as is except for when I delete a row from the Table, since it is not part of the dataset (.xsd) then the BindingNavigator does not get the update, because the update is done to the table with the sql code.  I will paste my
    other post in here so you can get the big picture.
    I have a dataset that was created at design time
    but - after I run the app, it randomly creates a table based on The Users name
    since I do not know the users name before had, the table is not part of my existing dataset
    (I actually used an insert into sql nonquery to just make this table a copy of the masterUserTable)
    Now - I have a binding navigator on my form, that is originally bound to masterUserTable, but my goal is to
    make it bound to the users table (let's say GabrielUserTable)
    I thought I did so with this code: 
            'TODO: This line of code loads data into the 'MyLearningDBDataSet.masterUserTable'
    table. You can move, or remove it, as needed.
            Me.MyMainDBTableAdapter.Fill(Me.MyLearningDBDataSet.masterUserTable)
            Dim ThisNewVariable As String = MyUserNameIs & "UserTable"
            Dim ThisNewTableName As New DataTable
            Me.MyLearningDBDataSet.masterUserTable.TableName = ThisNewVariable
            Me.MyMainDBTableAdapter.Fill(Me.MyLearningDBDataSet.masterUserTable)
    that appeared to do the trick  (but if it is incorrect please advice on the proper way to add a table
    made at runtime to a users existing datset)
    Else where in my code  I successfully execute the following NonQuery :
            SqlString= "DELETE FROM " & MyUserNameIs & "UserTable"
    & vbCrLf &
                "WHERE vState='" & txtStateInfo.Text & "';"
    I check in Visual Studio 2013 that the row was deleted from the "GabrielUserTable"  (Gabriel
    is the current value of MyUserNameIs) by using the Server Explorer and right clicking
    on the table and choosing show talbe data
    But the MyMainDBBindingNavigator is still showing the item I deleted.
    So after searching for answers - I created a new button for testing and added the following code to test if
    it would work
            Me.Validate()
            Me.MyMainDBBindingSource.EndEdit()
            Me.TableAdapterManager.UpdateAll(Me.MyLearningDBDataSet)
    but the data is still showing after deleting it with my NonQuery 
    Again - please help!  
    I have purchased over 4 books and none of them explain this 2 me.

  • How to add a place holder dynamically at run time

    Hi All,
    is it possible to add a site studio place holder dynamically at run time?
    Thanks
    ~hari

    Yes, it should be possible in the Design Mode. See http://docs.oracle.com/cd/E21764_01/doc.1111/e10611/c02_getting_started.htm#CIHCDGIB

  • Resources getting deleted when trying to add at run time

    Hi All,
    When i am trying to add resources to another file at run time, some of the earlier resources are getting deleted. Please find the source code below:
    void CResourceIncludeSampleDlg::OnBnClickedButton1()
    CString strInputFile = _T("C:\\SampleData\\FileToInsert.zip"); // This File is 100 MB
    HANDLE hFile = CreateFile(strInputFile, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
    DWORD FileSize = GetFileSize(hFile, NULL);
    BYTE *pBuffer = new BYTE[FileSize];
    DWORD dwBytesRead;
    ReadFile(hFile, pBuffer, FileSize, &dwBytesRead, NULL);
    for (int iIndex = 1; iIndex <= 4; iIndex++)
    InsertResource(FileSize, iIndex, pBuffer);
    CloseHandle(hFile);
    void CResourceIncludeSampleDlg::InsertResource(DWORD FileSize, int iIndex, BYTE *pBuffer)
    CString strOutputFile = _T("C:\\SampleData\\ResourceIncludeSample_Source.exe");
    int iResourceID = 300 + iIndex;
    HANDLE hResource = BeginUpdateResource(strOutputFile, FALSE);
    if (INVALID_HANDLE_VALUE != hResource)
    if (UpdateResource(hResource, _T("VIDEOBIN"), MAKEINTRESOURCE(iResourceID), MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
    (LPVOID)pBuffer, FileSize) == TRUE)
    EndUpdateResource(hResource, FALSE);
    After completion of the execution, i am expecting output as 301, 302, 303 and 304 added under "VIDEOBIN" category. But only 2 (sometimes 3) resources are present. One resource
    is always deleted.
    Could you please let me know what could be wrong or any fix for the same ?
    Any help or sample source code is greatly appreciated.
    Thanks and Regards,
    Kishor Reddy
     

    Make sure that all precautions mentioned in the
    docum are met.
    "Before you call this function, make sure all file handles other than the one returned by
    BeginUpdateResource are closed." and also regarding LN and MUI files.
    -- pa

Maybe you are looking for

  • Memory upgrade on Satellite L30

    I have a Satellite L30-11D and I am wanting to upgrade the memory modules in it, I have found this; Part Number: PA3411S-2M1G 1024MB (1GB) Memory PC2-4300 DDR2 (533MHz) and it will work but im unsure on this - can you have more than one plugged into

  • How to Split field  into multiple fields in  Import Manager without  delem

    Hi   Is there any method to Split a record in MDM without using delimitter? I dont want to use any delemitter  My field content in Source is  PRODLABELPACK and I want to split it into 3 fields in destination  Field1= PROD Field2=LABEL   Field3=PACK I

  • (2) odd behaviors - Bookmarks R Toast & phone lock up

    I've owned a Palm Pre Plus for 6 weeks.  At week 3 all default and any added Bookmarks were smoked. Prior to losing the bookmarks the phone locked up while in idle use. Since that time, almost daily lockups of the phone occur.  I press reset button,

  • Table required to check the charecterstics with values

    HI Gurus, i need to get the dump of charecterstics with associated values which are usind for release procedure, i have checked the tables CAWN & CAWNT , but it is not giving straight away, is there any other table to get values with charecterstics r

  • Identify tables from where the function module extracts data for the ES

    Hi All, For the datasource, 0CRM_SALES_ORDER_I in the CRM system, we need to add a new field (in the table level). This datasource's extraction type is 'F1 - function module'. Is the extractor itself is this function module? If it is a sepeate FM, wh