Send new value if original value is changed

Hey there,
I have programmed a sequence that sends commands to a power supply using VISA write to change the voltage. Every step in the sequence (for example 10 minutes at 100 V -> 5 minutes at 150 V -> ...) is represented by a case in a case structure. I want the user to be able to change the voltage during the run (to compensate small variations for example). How would I go about "send the programmed value, but as soon as the voltage control is changed by the user, send the new value"? I could use an event structure with "value change" as condition, but how then would I send the original value?
Have a nice day.

Leukocyte wrote:
Hey there,
I have programmed a sequence that sends commands to a power supply using VISA write to change the voltage. Every step in the sequence (for example 10 minutes at 100 V -> 5 minutes at 150 V -> ...) is represented by a case in a case structure. I want the user to be able to change the voltage during the run (to compensate small variations for example). How would I go about "send the programmed value, but as soon as the voltage control is changed by the user, send the new value"? I could use an event structure with "value change" as condition, but how then would I send the original value?
Have a nice day.
Duplicate post of http://forums.ni.com/t5/Instrument-Control-GPIB-Serial/Control-Consort-EV232-power-supply-via-RS-232...

Similar Messages

  • JTable cell edits return to original values

    Hi
    I am making some progress with using AbstractTableModel, however I have a problem whereby any edits that I make to cells within the table are being lost when I add a new row��the original values are re-appearing.
    I have searched through the forum looking for a solution but with no success thus far.
    I believe that the solution lies with the fireTableDataChanged() method but thus far I have had no success. My problem (I believe) is that I cannot work out how to fire it when a user leaves the newly edited cell.
    The method that adds the new rows is shown below and is called from a button on the Frame that houses the jTable. I have tried firing the method from here, hoping that all table edits will persist, but unfortunately they still disappear.
    public void fillTable()
            if(c > 0)
                for (int i = 0; i < c; i = i + 1)
                    this.setValueAt(((JobItemClass) items.get(i)).getItemNumber(), i, 0);
                    this.setValueAt(((JobItemClass) items.get(i)).getDescription(), i, 1);
                    this.setValueAt(((JobItemClass) items.get(i)).getCostPerItem(), i, 2);
                    this.setValueAt(((JobItemClass) items.get(i)).getQuantity(), i, 3);
        public void addRow()
            newItem = new JobItemClass();   //Create an object to hold the new row defsault values
            newItem.setItemNumber(c + 1);
            newItem.setDescription("");
            newItem.setCostPerItem(0.0);
            newItem.setQuantity(0);
            items.add(c, newItem);          //Add the default object to the array
            c = c + 1;                      //Update the variable holding the array size
            table = new Object[c][4];       //Increase the size of the object that acts as the table
            fireTableRowsInserted(c, c);    //Alert the object acting as the table that there is a new row
            fillTable();                    //Refresh the display to reflect the new row default values      
        }As always, any help greatly appreciated
    GB

    Thanks again for the replies people.
    I decided to edit this message and post updated code which can be seen below. This is a result of re-reading the helpfull advice from both azukov and camickr who took the time to respond to my initial request for help. I still have to work out how to validate user input but am sure that the tableChanged method will be the key.
    A simple tutorial also provided great assistance, especially helping eith the implementation of the TableModelListener. I have provided a link to the tutorial here:
    http://www.javalobby.org/articles/jtable/
    The coding was carried out in netbeans 5.5, libraries have not been included.
    Here is my updated code......table model first:
    public class MyJobItemTableModel extends AbstractTableModel
        JobItemClass newItem;   //Procides a default record when nothing available
        int jobNo;
        int c;
        ArrayList items;        //Stores the objects that provide the records
        public MyJobItemTableModel(int j)
            jobNo = j;
            items = (new JobAllItems(jobNo)).getItems();
            c = items.size();
        String columnName[] = { "Item Number", "Item Description", "Cost per item", "Quantity" };       
        Class columnType[] = { Integer.class, String.class, Double.class, Integer.class };
        /**************************This method probably now redundant************************
        public void storeCellValue(int row, int col)
            if(col == 0)
                ((JobItemClass) items.get(row)).setItemNumber((Integer) this.getValueAt(row, col));
            if(col == 1)
                ((JobItemClass) items.get(row)).setDescription((String) this.getValueAt(row, col));
            if(col == 2)
                ((JobItemClass) items.get(row)).setCostPerItem((Double) this.getValueAt(row, col));
            if(col == 3)
                ((JobItemClass) items.get(row)).setQuantity((Integer) this.getValueAt(row, col));
        public void addRow()
            c = c + 1;                          //Update the variable holding the array size
            newItem = new JobItemClass();       //Create a default object to fill the new row
            newItem.setItemNumber(c);
            newItem.setDescription("");
            newItem.setCostPerItem(0.0);
            newItem.setQuantity(0);
            items.add(c-1, newItem);
            this.fireTableRowsInserted(c, c);   //Update the display to show the added row.
        public int getColumnCount()
            return 4;
        public int getRowCount()
            return items.size();
        public Object getValueAt(int r, int c)
            JobItemClass jic = (JobItemClass) items.get(r);
            switch(c)
                case 0:
                    return jic.getItemNumber();
                case 1:
                    return jic.getDescription();
                case 2:
                    return jic.getCostPerItem();
                case 3:
                    return jic.getQuantity();
                default:
                    return new Object();               
        public String getColumnName(int column)
            return columnName[column];
        public Class getColumnClass(int c)
            return columnType[c];
        public boolean hasNoItems()
            if(items.size() == 0)
                return true;
            else
                return false;
        public boolean isCellEditable(int r, int c)
            return true;
        public void setValueAt(Object aValue, int r, int c)
            JobItemClass jic = (JobItemClass) items.get(r);
            switch(c)
                case 0:
                    jic.setItemNumber((Integer)aValue);
                    break;
                case 1:
                    jic.setDescription((String)aValue);
                    break;
                case 2:
                    jic.setCostPerItem((Double)aValue);
                    break;
                case 3:
                    jic.setQuantity((Integer)aValue);
                    break;              
            fireTableCellUpdated(r, c);
    }......and now the view (what the user sees)
    public class ViewItems extends javax.swing.JPanel
        protected MyJobItemTableModel myModel;
        /** Creates new form ViewItems */
        public ViewItems()
            initComponents();
        public void createTable(int jobNo)
            myModel = new MyJobItemTableModel(jobNo);
            myModel.addTableModelListener(new ViewItems.ViewItemsTableModelListener());
            jTable1.setModel(myModel);
            //jTable1.setSurrendersFocusOnKeystroke(true);  //not sure what this does
            if (myModel.hasNoItems())
                myModel.addRow();          
            public void run(int jobNo)
                createTable(jobNo);
                try
                    UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
                    JFrame frame = new JFrame("Invoice Breakdown");
                    frame.addWindowListener(new WindowAdapter()
                        public void windowClosing(WindowEvent evt)
                            setVisible(false);
                    frame.getContentPane().add(this);
                    frame.pack();
                    frame.setVisible(true);
                catch (Exception e)
                    e.printStackTrace();
            /**This class is required in order to respond to any changes that happen
             * to the table or data within, i.e. the user editing data in a cell.
             * The tablemodel (MyJobItemTableModel) will 'fire' the event and the
             * tableChanged() method will be executed.
            public class ViewItemsTableModelListener implements TableModelListener
                public void tableChanged(TableModelEvent evt)
                    if (evt.getType() == TableModelEvent.UPDATE)
                        int column = evt.getColumn();
                        int row = evt.getFirstRow();
                        System.out.println("row: " + row + " column: " + column);
                        jTable1.setColumnSelectionInterval(column + 1, column + 1);
                        jTable1.setRowSelectionInterval(row, row);
            /** This method is called from within the constructor to
             * initialize the form.
             * WARNING: Do NOT modify this code. The content of this method is
             * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc=" Generated Code ">                         
        private void initComponents()
            jScrollPane1 = new javax.swing.JScrollPane();
            jTable1 = new javax.swing.JTable();
            btnAddItem = new javax.swing.JButton();
            jTable1.setModel(new javax.swing.table.DefaultTableModel(
                new Object [][]
                    {null, null, null, null},
                    {null, null, null, null},
                    {null, null, null, null},
                    {null, null, null, null}
                new String []
                    "Title 1", "Title 2", "Title 3", "Title 4"
            jScrollPane1.setViewportView(jTable1);
            btnAddItem.setText("Add Item");
            btnAddItem.addActionListener(new java.awt.event.ActionListener()
                public void actionPerformed(java.awt.event.ActionEvent evt)
                    btnAddItemActionPerformed(evt);
            org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
            this.setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(layout.createSequentialGroup()
                    .addContainerGap()
                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                        .add(layout.createSequentialGroup()
                            .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 589, Short.MAX_VALUE)
                            .addContainerGap())
                        .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                            .add(btnAddItem)
                            .add(264, 264, 264))))
            layout.setVerticalGroup(
                layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(layout.createSequentialGroup()
                    .addContainerGap()
                    .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 163, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(49, 49, 49)
                    .add(btnAddItem)
                    .addContainerGap(54, Short.MAX_VALUE))
        }// </editor-fold>                       
        private void btnAddItemActionPerformed(java.awt.event.ActionEvent evt)                                          
            ViewItems.this.myModel.addRow();
        // Variables declaration - do not modify                    
        private javax.swing.JButton btnAddItem;
        private javax.swing.JScrollPane jScrollPane1;
        private javax.swing.JTable jTable1;
        // End of variables declaration                  
        }Edited by: greenockboy on Oct 15, 2007 8:17 PM

  • Getting the original values in table maintenance and the new one and send t

    Hello experts,
    In table maintenance, I need to capture the original values in that selected column/field and
    also the new one and send it to email. For example, I have a field in my z table named zaddress and whenever
    the user changes the contents of that selected row I need to get/fecth the original value and the new and send it to email.
    So the email will be something like this:
    Dear Admin,
    Changes were made to ztable. Here are the changes:
    Customer : Customer 1
    Order no : 1
    Original Address : example address A
    New Address : example address B
    NOTE: Do not reply to this email.
    Again, thank you guys and have a nice day!

    Hi Vijay,
    <b>1</b>.
    If u r using Modulepool programming to change the field contents ,u just capture field value into one  variable .This is possible in <b>PBO</b>.before displaying .once u change the field value and press something ,now capture changed value in another variable .This is possible in <b>PAI</b>.After pressing something to modify Database.
    I think u can get one idea after reading this .
    <b>2</b>.
    For sending mail it is not a problem.
    You can check the following code.
    *-------Mail related tables ,structures and variables
    DATA:
       w_subject       LIKE sodocchgi1,
       i_pack_list     LIKE sopcklsti1 OCCURS  1  WITH HEADER LINE,
       i_objhead       LIKE solisti1   OCCURS  1  WITH HEADER LINE,
       i_contents_text LIKE solisti1   OCCURS 10  WITH HEADER LINE,
       i_cont_bin      LIKE solisti1   OCCURS 10  WITH HEADER LINE,
       i_objhex        LIKE solix      OCCURS 10  WITH HEADER LINE,
       i_receiver      LIKE somlreci1  OCCURS  1  WITH HEADER LINE,
       i_listobject    LIKE abaplist   OCCURS  1  WITH HEADER LINE,
       pdf             LIKE tline      OCCURS 100 WITH HEADER LINE,
       content_out     LIKE solisti1   OCCURS 0 WITH HEADER LINE.
    DATA:
       tab_lines       TYPE i,
       doc_size        TYPE i,
       att_type        LIKE soodk-objtp,
       obj_desc        LIKE w_subject-obj_descr,
       sent_to_all     LIKE sonv-flag,
       client          LIKE tst01-dclient,
       name            LIKE tst01-dname,
       objtype         LIKE rststype-type,
       type            LIKE rststype-type,
       is_otf          TYPE c ,
       no_of_bytes     TYPE i,
       pdf_spoolid     LIKE tsp01-rqident,
       jobname         LIKE tbtcjob-jobname,
       jobcount        LIKE tbtcjob-jobcount,
       pn_begda        LIKE sy-datum,
       val(1)          TYPE c,
       pripar          TYPE pri_params,
       arcpar          TYPE arc_params,
       lay             TYPE pri_params-paart,
       lines           TYPE pri_params-linct,
       cols            TYPE pri_params-linsz,
       spool_name      TYPE pri_params-plist.
      CLEAR :w_subject,
             sent_to_all,
             i_pack_list[],
             i_objhead[],
             i_cont_bin[],
             i_contents_text[],
             i_receiver[].
      i_cont_bin = '  |  '.
      APPEND i_cont_bin.
    Subject of the mail.
      obj_desc  = 'Outstanding Appraisals' .
      w_subject-obj_name  = 'MAIL_ALI'.
      w_subject-obj_descr = obj_desc.
    Body of the mail
      DATA :head_desc LIKE i_contents_text,
            body_desc LIKE i_contents_text.
      i_contents_text = space.
      APPEND i_contents_text.
      CLEAR  i_contents_text.
      CONCATENATE
      'Please refer to the attached list of appraisal(s) that require your'
      'attention. Please log in to the eHR System and use the eAppraisal'
      'function to work on it.'
      INTO body_desc
      SEPARATED BY space.
      i_contents_text = body_desc.
      APPEND i_contents_text.
      CLEAR  i_contents_text.
      CLEAR body_desc.
      i_contents_text = 'Thank You.'.
      APPEND i_contents_text.
      CLEAR  i_contents_text.
      i_contents_text = space.
      APPEND i_contents_text.
      CLEAR  i_contents_text.
      CONCATENATE '(Note: This is system generated message, please'
                  'do not reply'
                  'to this Email.)'
               INTO i_contents_text
               SEPARATED BY space.
      APPEND i_contents_text.
      CLEAR  i_contents_text.
    Write Packing List (Body)
      DESCRIBE TABLE i_contents_text LINES tab_lines.
      READ     TABLE i_contents_text INDEX tab_lines.
      w_subject-doc_size = ( tab_lines - 1 ) * 255 + STRLEN(
      i_contents_text ).
      CLEAR i_pack_list-transf_bin.
      i_pack_list-head_start = 1.
      i_pack_list-head_num   = 0.
      i_pack_list-body_start = 1.
      i_pack_list-body_num   = tab_lines.
      i_pack_list-doc_type   = 'RAW'.
      APPEND i_pack_list.
      CLEAR  i_pack_list.
    Create receiver list
       i_receiver-receiver = g_email_next_man.
      i_receiver-rec_type = 'U'.
      APPEND i_receiver.
      CLEAR  i_receiver.
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = w_subject
          put_in_outbox              = 'X'
          commit_work                = 'X'
        IMPORTING
          sent_to_all                = sent_to_all
        TABLES
          packing_list               = i_pack_list
          object_header              = i_objhead
          contents_bin               = i_cont_bin
          contents_txt               = i_contents_text
          receivers                  = i_receiver
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          document_type_not_exist    = 3
          operation_no_authorization = 4
          parameter_error            = 5
          x_error                    = 6
          enqueue_error              = 7
          OTHERS                     = 8.
      IF sy-subrc NE 0.
      ENDIF.
    I think it helps u something.
    <b>Thanks,
    Venkat.O</b>

  • Serv. Desk: Action: send an email only when a value in a field has changed

    Hello,
    In Soution Manager 4.0, Sevice Desk, I would like to create an action which creates an email only when a value of a certain field has changed.
    - only in change mode relevant
    - only when a value of one field has changed (e.g. Message Processort has changed from Buss. Partner 4 to 5. Than a mail should be sent to BP 5).
    - it should only send this kind of email when the field value has changed in change mode. In other words: it should not sent the email e.g. when the status has changed.
    I tried all kinds of things but I do not know on how to define the COnditions for an Action, so I can compare e.g.
    if <old value> <> <new value>
    Any ideas or experience on how to implement this without major modifications ?
    Thanks
    Christian

    Hi Christian,
    check out my question on SDN.
    Email on Status Change
    it has details on how to send an email when the status changes. I believe you are going to have to do something like this for each of the fields you want to create an Action Starting Condition for.
    regards,
    Jason

  • Material weight changes back to original value

    Hi, we have a scenario where a material's weight is changed to a new value. This is done by an incoming Idoc, that is processed by a background job.
    The problem is, the material get this new value, but it is changed back to the old value immediatly.
    In transaction mm03 and looking at the material, in Environment -> Display Changes, from the menu, I see the new value is written by the background job user. But at the same second in time, the material is updated back with the old value, by the same background user.
    Any suggestions?

    Hello Rune,
    As u can c there are two entries in the Change screen, the second is created by the same user or different and also by which tcode is it created. My understanding is there is some additional process started when u are doing a change. Also try manually doing a change and c if it gets back the original value. If not then I think your Idoc is firing some parallel process which is geting executed. I don't think the same process is updating the material otherwise you would get only one entry.

  • JTable get Old Value in the Listener of change Value

    Software
    JDK 1.5 Update 6
    Requirements
    I have a JTable I want to show the sum total of certain Cell Value.So I have added a TableModelListener by which on updating the cell Value I change the total in the JTextField. The Problem is If I change the value then I have to get the previous value that the cell had. How to get that original value before the update.
    There is a way by which we can get the same by inserting one dummy column which stores previous value.But this method inserts unneccessary if you require the total of 3 columns and if you require the same thing again and again in different frames
    Is There any way by which we can show the total
    Thanks in advance
    CSJakharia

    Can I maintain a sum of a column in a JTextField such that I change the sum as soon as any value in that column is changed without recalculating the totalYes, now I understand the question you just want to update the total with the difference between the old value and the new value.
    I don't see why you are going to all this trouble. Why complicate your program, just loop though all the values in each column and add them together. You will not have a performance problem. Here is a similiar example of this approach:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=566133
    However, if you still don't like that solution then you can try overriding the getCellEditor(...) or prepareEditor(...) methods of JTable. These methods should be invoked when you start editing the cell and you could query the TableModel and save the current value.

  • Call transaction in new session with the value at hotspot

    Hi all,
    As a hotspot functionality I would like to open a new transaction in a new session with the value at hotspot. For that reason, I am using the FM ABAP4_CALL_TRANSACTION with the option STARTING NEW TASK.
    This FM is not working because Parameter ID is not Maintained for the field (Hotspoted). So no value is passing to new transaction.
    Please suggest any other way to implement this.
    Thanks

    Hi Anil..
    This is the Solution for ur Requirement.   try this program and change as per ur need.
    REPORT  ZSEL_CALL_TCODE.
    data : IT_KNA1 TYPE TABLE OF KNA1 WITH HEADER LINE.
    DATA : IT_SPA TYPE TABLE OF RFC_SPAGPA WITH HEADER LINE.
    SELECT * FROM KNA1 INTO TABLE IT_KNA1 .
    LOOP AT IT_KNA1 .
      WRITE:/ IT_KNA1-KUNNR HOTSPOT ON.
      HIDE IT_KNA1-KUNNR .
    ENDLOOP.
    CLEAR IT_KNA1-KUNNR.
    AT LINE-SELECTION.
    CASE SY-LSIND.
    WHEN 1.
    IF IT_KNA1-KUNNR IS NOT INITIAL.
    REFRESH IT_SPA.
    IT_SPA-PARID = 'KUN'.
    IT_SPA-PARVAL = IT_KNA1-KUNNR.
    APPEND IT_SPA.
      CALL FUNCTION 'ABAP4_CALL_TRANSACTION' STARTING NEW TASK 'S1'
        EXPORTING
          TCODE                         = 'XD02'
         SKIP_SCREEN                   = ' '
        MODE_VAL                      = 'A'
        UPDATE_VAL                    = 'A'
      IMPORTING
        SUBRC                         =
       TABLES
        USING_TAB                     =
         SPAGPA_TAB                    = IT_SPA
        MESS_TAB                      =
      EXCEPTIONS
        CALL_TRANSACTION_DENIED       = 1
        TCODE_INVALID                 = 2
        OTHERS                        = 3
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      ENDIF.
    ENDCASE.
    <b>Reward if Helpful.</b>

  • Problem of h:selectOneMenu it is popping back to original value

    I have a dataTable in which one column is a <h:selectOneMenu> and the required attribute is false.
    There is a inputText in another column and the required attribute is true.
    Whenever I change the <h:selectOne> option to null (that is blank option) from a string option and delete the inputText box value and click the submit button the
    <h:selectOneMenu> jumps back to its original value though I placed the required to false and a required message for inputText box.
    Required Message that pops out for inputText is expected but the <h:selectOneMenu> popping back is not desired. How can I avoid it.
    Regards
    Sandeep

    Please do not double post.
    [http://forums.sun.com/thread.jspa?threadID=5330114]

  • Values for Ordinary deprec. have changed in dep. area 01 in fiscal year 200

    Hi Guru,
    I m in the process of upgradation from 4.6C to ECC 6.0.
    In Asset Accounting in 4.6C there is a facility of batch input thereby the user can replace the block cost centre by new one. As this facility is not available in ECC 6.0 so I have figured out all asset master in which the block centre are entered. And one by one replace the old cost centre by new one in asset master. When I ran the dep. "AFAB" there were no error. But for few assets the dep. shows positive value and cumulative dep. as zero. When I display the master of these assets and go into asset value of that asset then it give the message
    Values for Ordinary deprec. have changed in dep. area 01 in fiscal year 2008
    Message no. AU390
    Diagnosis
    Depreciation terms were changed in depreciation area 01 since the last time depreciation was recalculated. The values for Ordinary deprec. that were saved in the database in fiscal year 2008 are therefore different from the newly calculated values by an amount of   102385.74-.
    Procedure
    Check if the newly calculated values are correct. If they are, then carry out a depreciation recalculation. You should be aware that if you recalculate depreciation, new values could arise for all open fiscal years, and these would then have to be posted to the general ledger by means of a depreciation posting run.
    If, on the other hand, you want to keep the values that are saved in the database, you have to set the depreciation terms back to how they were at the time of the last depreciation recalculation.
    To see a comparison of the old and new values, you can use the Display dep. calc. function in the asset value display or the Recalculate values function in the Asset Accounting menu."
    Guru, New value is absolutely wrong as it reversed all the dep. charged upto previous period.
    please tell me what I can do & how i colud check whether any body has changed the dep. term or not.
    Thanks
    Rajeev

    Hi,
    start transaction AFAR for the company code as real run. That will recalculate all asset values and should solve the problem.
    Alternative would be to go to AS02 and choose "edit -> recalculate values" from the system menu.
    Regards,
    Markus

  • How to create the new row with existing values

    Hi all,
    first of all i create a row,
    i opened that in edit mode,
    suppose i want to edit any one of the value in that recordd,
    that time compulsory create a new row with those valuess.
    how can i create a new row with those valuess.

    Hi Anusha,
    This code correct for your requirement, only thing is you are not able to modify it as per your requirement.
    What you have to do is:
    1. Copy queried row into into new row, change primary key values(but don't commit your changes here).
    2. Now you have two rows in your VO(OLD as well as New)
    3. Make any changes if you want using User Interface.
    4. At the save button first compare OLD and NEW row, if any value is differing then commit the chnages(it will insert new row in corresponding database table), if no changes are there I mean to say OLD value and NEW rows are same then rollback(it will remove copied row from VO and no row will be inserted in database.)
    While comparing rows please note that Primary keys will not be same so don't compare Primary keys while comparing rows.
    I hope it will help you.
    Regards,
    Reetesh Sharma

  • Sending more than one name value pair via ajaxRequest.add()

    Hi all,
    I'm implementing AJAX in Oracle Application Express to perform DML operations on a table. I need to send more than one name value pair via the ajaxRequest object. Can someone guide me how to achieve this? Say for example i need to send 2 values(need to send 2 form elements when submit button is clicked) P3_region and P3_scope. i tried the following methods.
    Method 1:
    ======
    ajaxRequest.add('P3_region',document.getElementById('P3_region').value);
    ajaxRequest.add('P3_scope',document.getElementById('P3_scope').value);
    Method 2:
    ======
    ajaxRequest.add('P3_region',document.getElementById('P3_region').value,'P3_scope',document.getElementById('P3_scope').value);
    Neither of them is fruitful. Can someone guide me how to achieve this?
    Regards,
    Balaji Radhakrishnan.

    Hi Roel,
    The javascript goes like this.
    <script language="JavaScript" type="text/javascript">
    function getElement1()
    document.getElementById('P3_Element1').value = '';
    var ajaxRequest = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=Element1Process',0);
    ajaxRequest.add('P3_Element2',document.getElementById('P3_Element2').value);
    ajaxRequest.add('P3_Element3',document.getElementById('P3_Element3').value);
    ajaxRequest.add('P3_Element4',document.getElementById('P3_Element4').value);
    ajaxRequest.add('P3_Element5',document.getElementById('P3_Element5').value);
    ajaxRequest.add('P3_Element6',document.getElementById('P3_Element6').value);
    ajaxResult = ajaxRequest.get();
    if(ajaxResult)
    var wsArray = ajaxResult.split("~");
    document.getElementById('P3_Element1').value = wsArray[0];
    </script>
    The application Process goes like this..
    declare
    v_Element1 VARCHAR2(60);
    begin
    select distinct Element1 into v_Element1 from TableA where Element2=:P3_Element2 AND Element3=:P3_Element3 AND Element4=:P3_Element4 AND Element5=:P3_Element5 AND Element6=:P3_Element6;
    htp.prn(v_Element1);
    exception
    when others then
    v_Element1 := 'Invalid Header Combination';
    htp.prn(v_Element1);
    end;
    The requirement goes like this..
    When i give Element2, Element3,Element4,Element5,Element6 as input in the form page the Element1 should get displayed automatically without refreshing the page. But when i use the above javascript and application process i get the Element1 loaded with some html scripts. I call the javascript using onChange() function.
    Regards,
    Balaji Radhakrishnan.

  • Resetting a form to its original values

    Does anybody know of a way to reset a form to its original values? In some cases JSF is displaying the last used form values, even after navigating to a different page and back again, instead of re-reading the values from the relevant backing bean.
    I'd imagine it involves iterating through the tree of UIView objects, but if anybody has some sample code that would much appreciated (and if anyone from the EG is listening, some kind of resetValues() method would be a useful addition to the API).
    -- Keith

    Each page in creator gets an AbstractPageBean which extends FacesBean and that contains the erase() method. This clears the state of the page forcing a reload of the page components. The docs make the following comment.
    "Erase previously submitted values for all input components on this page. This method MUST be called if you have bound input components to database columns, and then arbitrarily navigate the underlying RowSet to a different row in an event handler method."
    I find this comment very strange indeed. First, why hardwire you GUI to database components? What's the upside? It's not convenience because you can automate creation of datamodels from the database then do your binding. That aside, why hardwire the documentation to the database? Why not say "if the underlying state of bound variables changes independent of the UI you must call erase to relaod the change values". Anyhoo, I digress.

  • Ultiboard v5.72 via code default back to original values – help please!

    Hi
    I’m prototyping a fairly simple double sided board. I’m using the internal single pass auto router. I’m quite happy to have vias in the design but they need to be fairly large. Consequently before beginning the auto router I modified via size 0 to be :
    X1=40mil X2=40mil Y=80mil RAD=40mil Clear=40mil Drill=40mil      ‘apply’
    After entering the sizes I get a warning window “you have changed the via sizes – please verify your production class to achieve best (auto) routing
    I then click on ‘ok’ to acknowledge the warning. The values I have changed at this moment are still the ones I chose. I then click auto route../..production class 4M and it begins to route but does not use the dimensions of the via code I modified, if fact when I interrogate the via sizes after the route is complete, they have defaulted back to the original values !!
    Have I not set some parameter or sommat? Any help would be appreciated
    Regards ……. acekiddy

    I say this not to be a jerk, but I don't think your going to get any help on this. Even 3 years ago they were up to version 7..........as of todays date, its version 10.......and in a month or two it will be version 11.......I doubt there is any support for 5.72.
    What does the help file say about drill hole and via diameters? Those archaic bitmap autorouters sucked big then, and still do. Since version 8 its vector based and a lot more robust. I would suggest you download the eval 10 and give that a whirl.....just a thought. I haven't used 5.72 in over 9 years......sorry I can't be of more help.
    Message Edited by kittmaster on 01-10-2008 11:35 AM
    Signature: Looking for a footprint, component, model? Might be here > http://ni.kittmaster.com

  • Results and original value

    Hi All,
    i put a value on the result column and put 1 on the inspected column but when i valuated the results the value on the results column is gone and the value 1 in the inspected column became a zero..the value on the result column move to original value...
    please reply on this thread ASAP
    Edited by: phoebe blanco on Nov 4, 2008 8:00 AM

    I am also having this issue. 
    I am recording the result in QE51n.  I enter the result, and lock it in.  The result transfers to the u201Coriginal valueu201D field as usual, but it is not retained/rounded in the result column.  Instead the result column goes blank. 
    The MIC status is changed to 5, and is valuated as passing with the green checkmark.  Therefore, I can generate a CoA with this MIC, but of course there is not a value in the result field, so nothing pulls to the CoA.  
    Thanks in advance,
    Chris

  • How to Get the min,max and original values in a single query

    Hi,
    I have a task where in i have to the min , max and the original values of  a data set .
    I have the data like below and i want the target as well as mentioned below
    SOURCE
    DATASOURCE
    INTEGRATIONID
    SLOT_DATE
    SLOT1
    SLOT2
    SLOT3
    SLOT4
    SLOT5
    SLOT6
    SLOT7
    SLOT8
    SLOT9
    SLOT10
    1
    101
    201111
    100
    100
    200
    100
    100
    100
    300
    300
    300
    300
    1
    101
    2011112
    200
    200
    200
    200
    100
    100
    100
    100
    200
    300
    TARGET
    DATASOURCE
    INTEGRATIONID
    SLOT_DATE
    SLOT_VALUE
    SLOT MIN
    SLOT_MAX
    SLOT NUMBER
    1
    101
    201111
    100
    1
    2
    SLOT1
    1
    101
    201111
    100
    1
    2
    SLOT2
    1
    101
    201111
    200
    3
    3
    SLOT3
    1
    101
    201111
    100
    4
    6
    SLOT4
    1
    101
    201111
    100
    4
    6
    SLOT5
    1
    101
    201111
    100
    4
    6
    SLOT6
    1
    101
    201111
    300
    7
    10
    SLOT7
    1
    101
    201111
    300
    7
    10
    SLOT8
    1
    101
    201111
    300
    7
    10
    SLOT9
    1
    101
    201111
    300
    7
    10
    SLOT10
    1
    101
    2011112
    200
    1
    4
    SLOT1
    1
    101
    2011112
    200
    1
    4
    SLOT2
    1
    101
    2011112
    200
    1
    4
    SLOT3
    1
    101
    2011112
    200
    1
    4
    SLOT4
    1
    101
    2011112
    100
    5
    8
    SLOT5
    1
    101
    2011112
    100
    5
    8
    SLOT6
    1
    101
    2011112
    100
    5
    8
    SLOT7
    1
    101
    2011112
    100
    5
    8
    SLOT8
    1
    101
    2011112
    200
    9
    9
    SLOT9
    1
    101
    2011112
    300
    10
    10
    SLOT10
    e
    so basically i would first denormalize the data using the pivot column and then use min and max to get the slot_start and slot_end.
    But then i
    can get the min and max ... but not the orignal values as well.
    Any thoughts would be appreciated.
    Thanks

    If you want to end up with one row per slot per datasource etc, and you want the min and max slots that have the same value as the current slot, then you probably need to be using analytic functions, like:
    with t as
    (SELECT 1 datasource,101    INTEGRATIONID, 201111     slotdate, 100    SLOT1, 100        SLOT2,    200    slot3, 100    slot4, 100    slot5, 100    slot6, 300    slot7, 300    slot8, 300    slot9, 300 slot10 FROM DUAL  union all
    SELECT 1,    101,    2011112,    200,    200,    200,    200,    100,    100,    100,    100,    200,    300 FROM DUAL),
    UNPIVOTED AS
    (SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,1 SLOT,SLOT1 SLOT_VALUE
    FROM T
    UNION ALL
    SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,2 SLOT,SLOT2
    FROM T
    UNION ALL
    SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,3 SLOT,SLOT3
    FROM T
    UNION ALL
    SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,4 SLOT,SLOT4
    FROM T
    UNION ALL
    SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,5 SLOT,SLOT5
    FROM T
    UNION ALL
    SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,6 SLOT,SLOT6
    FROM T
    UNION ALL
    SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,7 SLOT,SLOT7
    FROM T
    UNION ALL
    SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,8 SLOT,SLOT8
    FROM T
    UNION ALL
    SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,9 SLOT,SLOT9
    FROM T
    UNION ALL
    SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,10 SLOT,SLOT10
    FROM T)
    select DATASOURCE,INTEGRATIONID,SLOTDATE,slot,slot_value,min(slot) OVER (partition by datasource,integrationid,slotdate,rn) minslot,
        max(slot) OVER (partition by datasource,integrationid,slotdate,rn) maxslot
    FROM   
      select DATASOURCE,INTEGRATIONID,SLOTDATE,max(rn) over (partition by datasource,integrationid,slotdate order by slot) rn,slot,slot_value
      FROM
        (SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,slot,slot_value,
              case when row_number() over (partition by datasource,integrationid,slotdate order by slot) = 1 or
              lag(slot_value) over (partition by datasource,integrationid,slotdate order by slot) <> slot_value
                  then row_number() over (partition by datasource,integrationid,slotdate order by slot)
                  ELSE null
                  END rn
        from unpivoted
    order by DATASOURCE,INTEGRATIONID,SLOTDATE,slot 

Maybe you are looking for