Struts: checkbox's previous value remains after unselecting it

hi
I have a checkbox in a JSP in struts environment:
<html:checkbox property="conversionOption"/>now in struts-config, the dynaactionform is :
<form-bean name="QuoteDetailsBean" type="org.apache.struts.validator.DynaValidatorActionForm">
                                  <form-property name="conversionOption" type="java.lang.String"/>
              </form-bean>now if the checkbox is not clicked, and in the action class I do:
String s = (String)formbean.get("conversionOption");s is null.
Now when i check(select) the check box, and click on submit the String s is 'on'. After this if I click on 'back' button and then uncheck the checkbox and click submit., the String is still 'on'. I expect it to be null or something other than 'on'.
It seems struts does not set conversionOption property if the checkbox for that property is not selected. so the previous value remains.
how do I overcome this?
I tried by changing :
<form-property name="conversionOption" type="java.lang.String"/>
to
<form-property name="conversionOption" type="java.lang.String[]"/>
but it did not help. changing to String[] will help if i have musltiple checkboxes for the same property. but my form has only one checkbox.
can anybody please help me?
Tanveer

I think u got this wrong.
In struts if the chechbox is unchecked the value is not set to anything and thus its unchecked and nothing is sent to servlet. If u checked and submitted the page then a value called "on" is set to the attribute that represents the checkbox in ur form. Now consider that u checked the checkbox and hit submit. come back and see that checkbox is checked. now uncheckit and hit submit. come back and see it unchecked. now hit back of IE "SHOULD IT BE CHECKED??" ANSWER IS NO. "BACK" button of IE or NS is not equivalant to sending a request? thus in the previous request even if has the property corresponding to the check box is availabe and is "on" and u can see that in the URL(its just a cache ant not exactly the request) the check box will not be checked and viceversa.
clear

Similar Messages

  • How to get a summ of all previous values

    Hello ALL,
    Could you please give an advice on how to find the sums of all previous values in 1 select without using dynamic sql. Cross join is not a variant because of a huge response time.
    OR may be there are any other ideas on how to find first rows with total sum equals to some general value? My idea is to find a sum of all preceding values and the first of such sums that would be equal to the general value or greater it is a necessary result.
    For example we have goods receipts:
    MATERIAL | BATCH | QTY
    material1 batch1 1
    material1 batch2 2
    material1 batch3 3
    material1 batch4 4
    material1 batch5 5
    material1 batch6 6
    and general qty is 7 - it's our current stock. So I should take material from [batch1 to batch4] to get necessary QTY >=7 (1+2+3+4=10>7) So our current stock consists of batch1,batch2,batch3 and remains of batch4.
    Thanks in advance!
    Edited by: user9321926 on Jun 18, 2010 3:56 AM

    Some thing like:
      1  select
      2     empno,
      3     sal,
      4     (select sum(sal) from emp b where  b.empno <= a.empno) running_total
      5* from (select * from emp order by empno) a
    SQL> /
         EMPNO        SAL RUNNING_TOTAL
          7369        800           800
          7499       1600          2400
          7521       1250          3650
          7566       2975          6625
          7654       1250          7875
          7698       2850         10725
          7782       2450         13175
          7788       3000         16175
          7839       5000         21175
          7844       1500         22675
          7876       1100         23775
         EMPNO        SAL RUNNING_TOTAL
          7900        950         24725
          7902       3000         27725
          7934       1300         29025
    14 rows selected.
    SQL>

  • How to find the PREVIOUS value of a non-DB item?

    I want to do a simple thing but found it impossible.
    I want to find the previous value of a non-DB item in a form.
    I tried creating a text item and populating it using PRE-TEXT-ITEM but that does not work.
    WHEN-VALIDATE-ITEM does not work either because WVI fires only after item value has changed.
    Any suggestions will be greatly appreciated.
    Edited by: Channa on Apr 2, 2010 4:34 AM

    Channa wrote:
    I want to do a simple thing but found it impossible.
    I want to find the previous value of a non-DB item in a form.
    I tried creating a text item and populating it using PRE-TEXT-ITEM but that does not work.
    WHEN-VALIDATE-ITEM does not work either because WVI fires only after item value has changed.
    Any suggestions will be greatly appreciated.
    Edited by: Channa on Apr 2, 2010 4:34 AMPlease make it clear what is your requirement then possibly we can provide you a better answer
    You can use Global variables for to store old values also on Post-query populate a value in separate field or Parameter

  • Quicken 07 remains after Archive and Install?

    Will the Quicken 07 application AND all my accounts remain after doing Archive and Install? I mean, will they be up and ready to use or need to be located in a folder and re-installed?

    On an "Archive and Install", you have the option to save user data and network settings. This will copy all your user data into the home directory on the new install, and make the install process as seamless as possible. Applications are copied over as well, I believe, but if they're not they are left in the "Previous System" folder and you can copy them over manually and test them out. I believe "Quicken" is one of those applications where you just drag it to the applications folder to install it. As such, it should migrate to the new system easily and be up and running without the need to reinstall it. Most apps that require reinstalls are those that put extensions and plug-ins into the system folder (Adobe CS3, for example). Some things to keep in mind:
    Corrupt preference files can cause applications to run funny or not at all. If an app doesnt behave normally then remove the preference file for that application from your user library. Corrupt preference files can happen during an install, so its good to be aware of the possibility they might crop up.
    In a similar manner as corrupt preference files, sometimes the install process can change the permissions on files and folders, which will result in the same funky behavior. Using Disk utility to fix permissions BEFORE and AFTER the install will greatly reduce the probability of this being an issue.

  • Compare the current value with the previous value in the same column

    Hi all,
    I have to include a statement in a query which allows to compare the current value of column A with the previous value of column A (same column). from there, I need to add a condition in order to have the expected result.
    Let's take an example to illustrate what I want to achieve:
    I have the following columns in table called 'Charges':
    Ship_id batch_nr Order_nr Price
    SID1111 9997 MD5551 50
    SID1111 9998 MD5552 50
    SID1111 9999 MD5553 50
    SID2222 8887 MD6661 80
    SID2222 8887 MD6662 80
    SID2222 8887 MD6662 80
    SID3333 6666 MD7771 90
    I want to check if the ship_id of row 2,3 (and more if available) is equal to the ship_id of row 1.
    If it is the case, then value 'together with the first batch_nr' in row 2 and 3 under Price column. If not, then keep the original value of Price column
    PLease see below the expected result:
    Ship_id batch_nr Order_nr Price
    SID1111 9997 MD5551 50
    SID1111 9998 MD5552 together with 9997
    SID1111 9999 MD5553 together with 9997
    SID2222 8887 MD6661 80
    SID2222 8887 MD6662 together with 8887
    SID2222 8887 MD6663 together with 8887
    SID3333 6666 MD7771 90
    Thanks in advance for your help, it is really urgent.
    Imco20030

    Hi,
    user11961002 wrote:
    Hi,
    Here is the query that I use:
    [ select
    sl.ship_id,
    o.ordnum,
    o.reffld_5 "BatchNR",
    sum(tc1.chrg_amt) "FreightPRC",
    sum(tc2.chrg_amt) "FuelPRC",
    sum (tc1.chrg_amt + tc2.chrg_amt + tc3.chrg_amt) "Total Price"
    from ord_line ol
    join ord o on (ol.ordnum = o.ordnum and ol.client_id = o.client_id)
    join shipment_line sl on (ol.ordnum = sl.ordnum and ol.client_id = sl.client_id and ol.ordlin = sl.ordlin)
    join adrmst a2 on (o.rt_adr_id = a2.adr_id)
    left join tm_chrg tc1 on (tc1.chargetype = 'FREIGHT' and tc1.chrg_role = 'PRICE' and tc1.ship_id = sl.ship_id)
    left join tm_chrg tc2 on (tc2.chargetype = 'FUELSURCHARGE'and tc2.chrg_role = 'PRICE' and tc2.ship_id = sl.ship_id)
    where sl.ship_id = 'SID0132408'
    group by o.client_id, o.ordnum, o.reffld_2, sl.ship_id, a2.adrnam, a2.adrln1, a2.adrpsz, a2.adrcty, a2.ctry_name,
    o.reffld_5, ol.early_shpdte
    order by ship_id
    ]That looks like the query you were using before you started this thread.
    Modify it, using the analytic fucntions FIRST_VALUE and LAG, like I showed you.
    I see that you did simplify the problem quite a bit, and it's good that you did that.
    It doesn't matter that your real problem involves joins or GROUP BY. Analytic functions are calculated on the results after all joins and GROUPS BYs are done. Just substitute your real expressions for the simplified ones.
    For example, in your simplified problem, there was a column called order_nr, but I see now that's it's really called o.ordnum. Where the solution I posted earlier says "ORDER BY order_nr", you should say "ORDER BY o.ordnum".
    Here's a less obvious example: in your simplifed problem, there was a column called price, but I see now that it's really SUM (tc1.chrg_amt + tc2.chrg_amt + tc3.chrg_amt). Where the solution I posted earlier says "TO_CHAR (price)", you should say "TO_CHAR (SUM (tc1.chrg_amt + tc2.chrg_amt + tc3.chrg_amt))". (You can't use an alias, like "Total Price", in the same SELECT clasue where it is defined.)
    I removed some columns from the select as they are not relevant for the wanted action like 'adress details or other references'.
    Now here is the result:
    Shipment ID     Order Number     WMS Batch     Freight      Fuel Price Order Total Price
    SID0132408     MDK-000014-05602649     04641401     110     10 120
    SID0132408     MDK-000014-05602651     04641402     110     10 120
    SID0132408     MDK-000014-05602652     04641363     110     10 120
    as you can see, the 3 orders have the same shipment ID.
    The expected result should be shown under column 'Total Price' as follows:
    Shipment ID     Order Number     WMS Batch     Freight      Fuel Price Order Total Price
    SID0132408     MDK-000014-05602649     04641401     110     10 120
    SID0132408     MDK-000014-05602651     04641402     110     10 tog with 04641401
    SID0132408     MDK-000014-05602652     04641363     110     10 tog with 04641401Okay, so those are the correct results that I asked for, plus the incorrect results you're getting now. Thanks; extra information doesn't hurt.
    But where is the raw data that you're starting with?
    It looks like you tried to format the code (but not the results) by typing this 1 character:
    before the formatted section and this different character
    after the formatted section. To post formatted text on this site, type these 6 characters
    before the formatted section, and the exact same 6 characters again after the formatted section.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How can I make JSpinner value remain unchange

    Hi,
    I've posted this message on Programming forum before, and many friends recommend me better to post in Swing forum.
    I have a question on how to make the value remain unchange after some confirmations? In my program, I have to ask whether user want to change the value,
    if yes, something other settings will be reset.
    if no, I hope the vaule in Jspinner remains unchange.
    I tried to use the state stateChanged event to detect any value change. and set back the previousValue, however, it comes into the event many times...
    pbrockway2 has suggested me to add a flag inside stateChanged to prevent it comes into the event, however, this method not so work all times. And the value also will keep being increased or decreased.
    Can some of you give a hints, the code below :
           jSpinner_row.addChangeListener(new ChangeListener()
                public void stateChanged(ChangeEvent event)
                    if(CheckFlag)
                        int result = JOptionPane.showConfirmDialog(ParentFrame,
                                "Are you sure you want to row setting ?",
                                "Setup", JOptionPane.YES_NO_OPTION,
                                JOptionPane.QUESTION_MESSAGE);
                        if (result == JOptionPane.NO_OPTION)
                            CheckFlag = false;
                            jSpinner_row.setValue(jSpinner_row.getPreviousValue());
                            CheckFlag = true;
                            return;
                        else
                            // do reset of controls and re - construct panel
                            CheckFlag = true;
            });

    this might (?) be one way, but, as is, only works with SpinnerNumberModel
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class Testing
      JSpinner spinner;
      final int MIN = 0, MAX = 100;
      public void buildGUI()
        JPanel p = new JPanel();
        spinner = new JSpinner(new SpinnerNumberModel(MIN,MIN,MAX,1));
        ((JSpinner.DefaultEditor)spinner.getEditor()).getTextField().setEditable(false);
        spinner.setUI(new ChangeVerifierUI());
        p.add(spinner);
        JFrame f = new JFrame();
        f.getContentPane().add(p);
        f.pack();
        f.setLocationRelativeTo(null);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
      class ChangeVerifierUI extends javax.swing.plaf.basic.BasicSpinnerUI
        protected Component createNextButton()
          JButton nextButton = (JButton)super.createNextButton();
          nextButton.removeMouseListener(nextButton.getMouseListeners()[0]);
          nextButton.addMouseListener(new MouseAdapter(){
            public void mousePressed(MouseEvent me){
              if(((Integer)spinner.getValue()).intValue() < MAX) checkChange(+1);
          return nextButton;
        protected Component createPreviousButton()
          JButton previousButton = (JButton)super.createPreviousButton();
          previousButton.removeMouseListener(previousButton.getMouseListeners()[0]);
          previousButton.addMouseListener(new MouseAdapter(){
            public void mousePressed(MouseEvent me){
              if(((Integer)spinner.getValue()).intValue() > MIN) checkChange(-1);
          return previousButton;
      public void checkChange(int direction)
        int result = JOptionPane.showConfirmDialog(null,"Are you sure you want to row setting ?",
            "Setup", JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE);
        if (result == JOptionPane.YES_OPTION) spinner.setValue(
          ((Integer)spinner.getValue()).intValue()+
          (((Number)((SpinnerNumberModel)spinner.getModel()).getStepSize()).intValue())*direction);
      public static void main(String[] args)
        SwingUtilities.invokeLater(new Runnable(){
          public void run(){
            new Testing().buildGUI();
    }

  • Keep Previous Value of Cell

    Hi there,
    I have two columns, let's call them Event Date (Column A) and Previous Event Date (Column B).
    I would like to implement some <acronym title="visual basic for applications">VBA</acronym> code (or use formulas if necessary) that automatically keeps the previous value of Event Date and retains it in the adjacent cell for Previous
    Event Date.
    For example, if A3 = Jan-03 and I update A3 to Jan-04, B3 would then show Jan-03 as it is the previous value of the cell.
    I would like this code to work for a whole column of cells, not just a single cell.
    I'm open to any & all ideas and appreciate the help. If any clarifications are necessary, just let me know.

    Right-click the sheet tab.
    Select View Code from the context menu.
    Copy the following code into the worksheet module:
    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim newVal As Variant
    ' Code won't work if multiple cells have been changed
    If Target.Count > 1 Then
    Exit Sub
    End If
    ' Only act if cell in column A has been changed
    If Intersect(Range("A:A"), Target) Is Nothing Then
    Exit Sub
    End If
    ' Turn off events and screen updating
    Application.EnableEvents = False
    Application.ScreenUpdating = False
    ' Get new value
    newVal = Target.Value
    ' Undo to restore old value
    Application.Undo
    ' Copy old value to adjacent cell
    Target.Offset(0, 1).Value = Target.Value
    ' Redo the change
    Target.Value = newVal
    ' Turn on screen updating and events
    Application.ScreenUpdating = True
    Application.EnableEvents = True
    End Sub
    Remarks:
    If you change multiple cells at once, the code won't do anything.
    When you change a cell in column A, that cell will remain the active cell, i.e. Tab or Enter won't activate another cell.
    When you change a cell in column A, Undo will be disabled.
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • Compare current value with previous value

    Hello,
    I would like to compare the current value with the previous value of the current value.
    How can I solve this problem?
    Maurits

    Hi,
    after going through the basics course you surely can understand that example:
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Suppress or Hide Previous Value in SSRS 2008

    Hi Friends,
    I have a requirement where i have to suppress previous value if that is equal to next or last value...
    i have tried using below expression in Test box visibility but  this is suppressing whole value.
    =IIF(Sum(Fields!AnnualFees.Value)=Last(Sum(Fields!AnnualFees.Value)),True,False) 
    as a second option i have tried below code in Text box expression instead o Visibility..
    =IIF((Sum(Fields!AnnualFees.Value))=Last(Sum(Fields!AnnualFees.Value)),Sum(Fields!AnnualFees.Value,"StudentID"),Nothing)
    but it is not working...Please help me..
    Thanks,
    Sam.

    Hi Samhith,
    After testing the issue in my own environment, we can try to refer to use runningvalue function to achieve your requirement. For more details, can refer to the following expression:
    =iif(sum(Fields!AnnualFees.Value,"StudentId")=runningvalue(Fields!AnnualFees.Value,sum,"StudentId"),sum(Fields!AnnualFees.Value,"StudentId"),nothing)
    The following document about RunningValue Function (Reporting Services) is for your reference:
    http://technet.microsoft.com/en-us/library/ms159136(v=sql.100).aspx
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Compare previous value and new value on Campaign Save

    Hi All,
    I create a campaign. I need some exit ( badi etc.) which is called before saving the campaign and after saving the campaign. My main intention is to compare the previous value and the new value.
    Thanks in advance,
    Raviraj

    Yes, you would have to write code that specifically compared each column. And update that code when the column list changed. Of course, you could always write code that generated your triggers for you based on the column definitions.
    On the other hand, I would tend to suggest that if you need an audit history, you want to store the whole row. Otherwise, the queries necessary to parse your audit table get to be hideously complicated and people spend a lot of time trying to reconstruct the state of a row at a particular point in time, often introducing errors.
    If you need an audit history, I would also tend to look into Oracle's auditing features or something like Workspace Manager that automatically tracks a version history for rows. Both of those are built into the database, which tends to make them a lot easier to deal with than a custom trigger solution.
    Justin

  • Oracle Forms : Accesing previous value of a field

    I am designing a form which is master detail in the way it looks. Both the blocks are non-database blocks. On the header part there are 2 fields and a button. Based on the values enterd in these fields, when the button is pressed, it populates the fields in the detail block below which is a multiple item block. Now what ever value is displayed in the detail block is editable. What i want is that what ever value is edited by the user should not be more than the initial number value populated initially in that field. Basically what i want is how do i access that previous value in that field which was there before the user edited that field, so that i can put validation checks with that field.
    It would be great if any of u can pls help me. Please reach back in case of any clarifications......... waiting for a reply soo........

    hello
    either you assign the old/original value to a global variable or hidden item or parameter then refer it to the new item value;
    after or on populating value :
    global.variable := item_value;
    validation :
    if item_value (EDITTABLE FILED) != global.variable (OLD VALUE) then
    end if;
    charles

  • Create a Locals variable that remains after run completed (LabVIEW)

    I am trying to create a Locals variable that remains after a sequence run is completed.  When I use the PropertyObject to create a Locals variable, its scope is available only when the sequence is running.
    Respectfully,
    Robert

    The locals you see at runtime are a copy of the default locals in the file. Each instance of a running sequence needs its own copy of the locals because their values can vary in different running instances of the same sequence.
    The edit time definition of the sequence local variables has a property path such as:
    RunState.SequenceFile.Data.Seq["MainSequence"].Locals
    If you modify these locals and you want the file to be marked as modified so that the user is prompted to save, then you should also call:
    RunState.SequenceFile.AsPropertyObjectFile().IncChangeCount()
    Note that changing the edit time locals only affects new executions. You might need to modify both the edit time and runtime locals depending on what you are trying to accomplish.

  • Create a new column in a table that compares the value of one column with its previous value

    The DDL:
    DECLARE
    @T TABLE
    IDNO
    int,
    name
    varchar(40),
    [Date]
    datetime2,
    Price1
    float,
    Price2
    float
    DECLARE
    @K TABLE
    IDNO
    int,
    name
    varchar(40),
    [Date]
    datetime2,
    Price1
    float,
    Price2
    float
    INSERT
    INTO @T
    VALUES(22,'C_V_Harris','2014-01-02 10:23:49.0000000',
    23.335,      
    23.347)
    INSERT
    INTO @T
    VALUES(21,'C_V_Harris','2014-01-02 10:05:13.0000000',
    23.357,      
    23.369)
    INSERT
    INTO @T
    VALUES(20,'C_V_Harris','2014-01-02 09:56:15.0000000',
    23.364,      
    23.377)
    INSERT
    INTO @T
    VALUES(19,'C_V_Harris','2014-01-02 09:45:26.0000000',
    23.351,      
    23.367)
    INSERT
    INTO @T
    VALUES(18,'C_V_Harris','2014-01-02 09:43:20.0000000',
    23.380,      
    23.396)
    INSERT
    INTO @T
    VALUES(17,'C_V_Harris','2014-01-02 09:34:28.0000000',
    23.455,      
    23.468)
    INSERT
    INTO @T
    VALUES(16,'C_V_Harris','2014-01-02 09:30:37.0000000',
    23.474,      
    23.486)
    INSERT
    INTO @T
    VALUES(15,'C_V_Harris','2014-01-02 09:18:12.0000000',
    23.419,      
    23.431)
    INSERT
    INTO @T
    VALUES(14,'C_V_Harris','2014-01-02 09:16:06.0000000',
    23.360,      
    23.374)
    INSERT
    INTO @K
    SELECT
    ROW_NUMBER()
    OVER (ORDER
    by IDNO)
    AS RN,*
    FROM
    @T
    SELECT
    * FROM
    @K
    --not working:
    SELECT
    a.RN,a.Price2
    FROM
    @K a
    INNER
    JOIN @K
    b
    ON
    a.RN=b.RN-1
    WHERE
    a.Price2>b.Price2
    I need to create  a view with a column (say 'Comp' below) that compares the value of each row in Price2 with the previous Price2 row, and it is greater then +1, the
    same 0, and less -1.
    The processed table should be:
    IDNO
    name
    Date
    Price1
    Price2
    Comp
    22
    C_V_Harris
    1/2/2014 10:23:49
    23.335
    23.347
    0
    21
    C_V_Harris
    1/2/2014 10:05:13
    23.357
    23.369
    1
    20
    C_V_Harris
    1/2/2014 9:56:15
    23.364
    23.377
    1
    19
    C_V_Harris
    1/2/2014 9:45:26
    23.351
    23.367
    -1
    18
    C_V_Harris
    1/2/2014 9:43:20
    23.38
    23.396
    1
    17
    C_V_Harris
    1/2/2014 9:34:28
    23.455
    23.468
    1
    16
    C_V_Harris
    1/2/2014 9:30:37
    23.474
    23.486
    1
    15
    C_V_Harris
    1/2/2014 9:18:12
    23.419
    23.431
    -1
    14
    C_V_Harris
    1/2/2014 9:16:06
    23.36
    23.374
    -1
     How can I structure the statement to get (the most recent - order by date ) result for Comp?

    Satheesh Variath, I just had to make some corrections from your script to get the correct answer:
    CREATE
    VIEW vw_Comp
    AS
    SELECT
    TOP 1 t.IDNO,t.name,t.[Date],t.Price1,t.Price2,
    CASE
    WHEN t.Price2
    > LAG(Price2,1)
    OVER (PARTITION
    BY name
    ORDER BY IDNO) 
    THEN 1
    WHEN t.Price2
    < LAG(Price2,1)
    OVER (PARTITION
    BY name
    ORDER BY IDNo) 
    THEN -1
    ELSE 0
    END
    AS Comp
    FROM 
    @T t
    ORDER
    BY DATE
    DESC
    The adjustments: the selection of the most recent comparison (Top 1) and the use of the function LAG (instead of LEAD) to get the previous value of the column.

  • Previous Values of Selected Items in a Datagrid

    I have a datagrid which the dataprovider is bound to an ArrayCollection of Value Objects from a web service.
    One other thing which is important to point out.   The Value Objects are created automatically for the Data/Service and so if I change the files, they will just be overwritten the next time I make a change to the service.
    The grid displays Inventory Items.    Lets say that Item 1 has a qty of 20.   Item 5 has a Qty of 10.
    The list in this grid is based upon the selection of a Location tree.   So it lists the inventory items for a certain location.
    I also have a second tree and grid for the to location inventory items.
    Between the two grids, there is a button which when clicked it iterates thru the selected items and creates a new item in the to list with qty 1 and saves it.  then decreases the current qty in the from list by one.
    So lets say I selected items 1 and 5 and then clicked the button.   A new copy of Items 1 and 5 are created in the to list with a qty of 1 and then saved.   Then the qty in the from list is decreased by 1 and saved and so the vales for 1 is now 19 and for 5 is 9.
    I would like to be able to change the qty in the from list to the qty I want to move.   So when the button is clicked the new item in the to list reflects the new qty and is saved.   Then the previous value of the current qty is decreased by the qty which is displayed in the grid
    So lets say I changed item 1 to 2 and Item 5 to 3 and then selected items 1 and 5 and then clicked the button.   A new copy of Items 1 and 5 are created in the to list with a qty of 2 for item 1 and 3 for item 5 and then saved.   Then the qty in the from list is decreased for Item 1 by 2 and item 5 by 3 and so now Item 1s qty is now 18 and items 5 qty is now 7.
    My first thought was if I had the previous values stored then no big deal.  But I put a break point at the point where the SelectedItems list is being iterated through and the previous values are not stored anywhere. 
    Any suggestions for this?

    ...in the mean time, this should be enough
    win.pnl.list1.onChange = function() {
         alert(this.selection.index); // for this to work set, multiselect:false
    I guess you already tried and the result is "undefined", the reason is you have this property
    multiselect:true
    in that case, selection returns an array,
    this.selection[0].index;
    would give you the first selected item, even if you only have one item selected, to get all selected items loop thru all items in the selection array.
    not sure if Peter's wonderful guide explains this (it is explained in the Tools Guide), but you should read it too, it has tons of great info.

  • How to get the previous value of a field before saving the record

    Hi All,
    I have a requirement like, listing out the modified field values with their previous value and new value using integration events or any method.
    For Ex: If i modify the customer name from "Jack" to "Amith" in the record.
    Then i have a requirement to display the message like : CustomerName has changed from "Jack" to "Amith"
    Please post your help notes on this.It's Urgent.
    Thanks & Regards
    Amith

    Hello Amith,
    How does a user perform the modification? Do you already have access to the existing value when the user makes the update? How are you identifying the record to be updated within CRMOD and what method are you using to perform the update?
    Thanks,
    Sean

Maybe you are looking for

  • Is it possible to get the page count of a *.doc and * .xls document in java

    Hi guys, How to determine the number of pages given a word document or an excel document.I searched many sites , found one in the forum about ImageDecoder it can determine the number of pages of tiff,jpeg etc images. but its not possible for *.do or

  • How to compress bursting output?

    Hi, I've created a report using XML Publisher that bursts the Excel output via Email. The problem were having now is the output file is growing larger to 20MB. Is there a way to zip the output file prior to sending it via Email using XML Publisher bu

  • Installation of Oracle 8.0.5 in NT4 Workstation

    Hi, I installed Oracle 8.0.5 (Enterprise edition) in my NT4 workstation home PC (Pentium 200 , 64 MB). All tools are working properly when logged in with userid/password and service name (i.e. connect string) = local.world, where local.world has been

  • Node reboot

    Hello This was my exam question last week. "b" and "e" are definetely correct but not sure about the last one. Which three actions would be helpful in determining the cause of a node reboot ? a-)determining the time of the node reboot by using the up

  • Using Apple TV Updates

    I have looked at all the discussion boards to find a solution and I have not found one yet. I need help with updating my apple tv. I have tried to restore it but it fails. My network signal is 5 bars so i know it is not the internet. What else could