How remember previous value?
Hi all,
I am working on a page, which is implmented using jsp and servlet. It shows alot options(radio button) in several pages, and user can browser next/previous page.
My question is how to let jsp remember the selected option, after user browsers next/previous page and goes back to the page in which the option is selected before?
Thanks alot.
tranquil
You could also use the session. In JSPs there is an implicit session object that you can get/setAttributes on. Each time the user clicks Next and the page is submitted, you could save the choices they made in the session. That way if they click Previous you'd check the session to see if values already exist. If they do read them from the session and set them in the page accordingly.
Take a look at the HTTPSession JavaDoc for more info:
http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/http/HttpSession.html
Similar Messages
-
How to remember checkbox values for each image
The situation is this: i have a horizontal list which i
populate with images loaded from xml. After i click on any of the
images, popup windows is displayed with checkbox. The same popup is
displayed for all of the images after i click on them. I need to
remember checkbox values (on/off) for each one of the images in
horizontal list but i don't know how to do that? How can i know
which one of the images (they are different) inside horizontal list
i clicked on in the first place?
thank youI am sorry but i don't quite follow you, i am not sure what
you are saying so i would really appreciate it if you could explain
it to me a little bit further. I have the following mxml code where
i define my HorizontalList:
<mx:HorizontalList height="326" width="935" id="imageList"
itemRenderer="mx.controls.Image" columnWidth="427" rowHeight="320"
itemClick="popUpWindow()" backgroundColor="#4A4A4A"
borderColor="#444242" themeColor="#000000" verticalCenter="166"
horizontalCenter="0">
</mx:HorizontalList>
and following "popUpWindow()" function which i call when
image in HorizontalList is clicked:
//previously i populate horizontal list with images from an
array "slidePathAC"
imageList.dataProvider = slidePathAC;
public function popUpWindow():void{
trace ("\npopUpWindow function")
var tw:TitleWindow = new TitleWindow();
tw.showCloseButton = true;
tw.setStyle("borderAlpha",0.9);
mx.managers.PopUpManager.addPopUp(tw, MainPanel, true);
tw.width = 500;
tw.height = 500;
mx.managers.PopUpManager.centerPopUp(tw);
tw.addEventListener("close",removePopUp);
Thank you very much for your help -
I need my label to remember the value of the previous number in item renderer
I have a label used as an item renderer and the dataprovider frequently changes. I need my label to remember the value of the previous number it was assigned to {data.ask} but am having trouble doing this.
Any ideas how to do this?You could override the data setter on the item renderer or listen for dataChange and store the value somewhere at that time. This post demonstrates how to override the data setter or listen for dataChange:
http://flexponential.com/2009/11/11/binding-warnings-when-using-object-in-a-list-dataprovi der/ -
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 AMSome 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 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
AmithHello 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 -
Newbie: How can I store a previous value??
I am trying to figure out how to do the following:
int xcoor=0, ycoor=0, hstep, vstep;
while true do
update_step(hstep, vstep); // essentially have a big while loop to generate the necessary hstep/vsteps
xcoor = xcoor + hstep; // I need to add a new hstep to the xcoor
ycoor = ycoor + vstep; // I need to add a new vstep to the ycoor
updategraph(xcoor, ycoor); // and feed the updated xcoor/ycoor to an XYgraph
I think I should use a Master/Slave design? but how do I keep the previous value the first time in the Slave and then add the new values to the stored value??
Attachments:
new_Block_Diagram.bmp 2137 KB
new_Block_Diagram.jpg 174 KBYou probably want to use a shift register.
Right-click on the right edge of the loop. Select the "Add Shift Register" option.
It will add a widget on both the right and left sides of the loop.
An item wired to the right side will appear on the left side during the next pass through the loop. You can initialize the value by wiring an input to the left side widget.
[email protected] -
How to Remove Previous Values in Field Symbols
Hi,
My code goes like this.
Loop at i_vbap.
read table itab assigning <fs>.
if sy-subrc = 0.
endif.
Endloop.
This is good if my subrc for read is always 0. however, if my subrc = 4, my <fs> still contains the previous values. How do i clear my <fs> with the previous values?
Thanks,
JimHi
In your code please do the following
Loop at i_vbap.
Unassign <fs>.
read table itab assigning <fs>.
if sy-subrc = 0.
endif.
The problem would arise if you are using <fs> below without it being assigned.
It would cause a short dump.
So change your coding appropriately.
Endloop. -
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 AMChanna 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 -
How to compare previouse value in pl/sql array
DECLARE
CURSOR stg_raw_cur IS
SELECT RAW_STG_ID,
DEVICE_CD,
MODEL_VERSION,
PLATFORM_CD,
PROFILE_COOKIE,
LOCATION_CD,
SAMPLE_RATE,
EVENT_TYPE_CD,
to_char(to_date(to_date(substr(EVENT_DATE_TIME,1,8),'yyyymmdd')-1 ||
'T' ||
substr(EVENT_DATE_TIME,10,8)
|| 'Z','DD-MON-RR"T"HH24:MI:SS"Z"'), 'YYYYMMDDYY"T"HH24:MI:SS"Z"' ) EVENT_DATE_TIME,
EVENT_SPECIFIC,
BATCH_ID,
DWH_ARVL_DT,
DWH_ARVL_DT_ID,
DWH_CREATE_DT from dwh_stg.stg_raw where batch_id >= 200
order by batch_id asc;
TYPE stgrawarr IS TABLE OF stg_raw_cur%ROWTYPE;
stg_raw_rec stgrawarr;
l_batch_id NUMBER :=0 ;
v_ctr NUMBER :=0;
l_temp_batch_id number :=0;
BEGIN
OPEN stg_raw_cur;
LOOP
FETCH stg_raw_cur BULK COLLECT INTO stg_raw_rec LIMIT 100;
EXIT
WHEN stg_raw_cur%NOTFOUND;
END LOOP;
CLOSE stg_raw_cur;
for i in stg_raw_rec.first..stg_raw_rec.last
loop
dbms_output.put_line('batch id is '|| stg_raw_rec(i).batch_id );
IF l_batch_id != stg_raw_rec(i).batch_id
then
dbms_output.put_line('Different');
end if;
l_temp_batch_id := stg_raw_rec(i).batch_id;
commit;
end loop;
END;
I want to compare previous value of stg_raw_rec(i).batch_id if differnet then increament the value
else leave the same.
thanks.Try this,
FOR i IN stg_raw_rec.FIRST .. stg_raw_rec.LAST
LOOP
IF l_temp_batch_id != stg_raw_rec (i).batch_id
THEN
--increment
l_temp_batch_id := l_temp_batch_id + 1;
END IF;
DBMS_OUTPUT.PUT_LINE ('batch id is ' || stg_raw_rec (i).batch_id||' unique batch id is '||l_temp_batch_id);
-- DBMS_OUTPUT.PUT_LINE ('batch id is ' || stg_raw_rec (i).batch_id);
-- IF l_batch_id != stg_raw_rec (i).batch_id
-- THEN
-- DBMS_OUTPUT.PUT_LINE ('Different');
-- END IF;
l_temp_batch_id := stg_raw_rec (i).batch_id;
COMMIT;
END LOOP; -
How to get the previous value of Potential Revenue, as Number
PRE('<Revenue>') will return the previous value of the Potential Revenue (in Opportunity object), as a string.
However, i need to manipulate the returned value as number in order to evaluate if the previous value is less a certain amount.
PRE('<Revenue>')*.3204<50000
The expression about, is meant to convernt the value to a different currency, and evaluate if its less than 50000.
Is there any way I can be able to achive this?
appreciate you response! :)
Edited by: mack on Apr 15, 2012 1:31 AManswered.
-
How to make slicer to remember selected values while moving from report to another
I have Power View on SharePoint 2013 and OLAP Cube on SQL Server 2014 solution.
1) I select slicer values and graphs are updated
2) I move to next page on same Power View file and use slicers.
3) I come back to original reports. My slicer valuers are empty.
Is it possible to make slicer to remember selected values while browsing from reports to another?
Ken
Kenny_IHi Kenny_I,
This seems to a by design issue. The selected values within a slicer will be stored in Memory. When we go to another report, the memory will be released.
Best Regards,
Black -
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. -
How to create value request for screen field text box tt1
How to create value request for screen field text box tt1
i have a text box name tt1,
i want f4 help for that .
remember i am asking for screen i.e done from screen layout not selectio-screen.
Thank you,
Regards,
Jagrut Bharatkumar Shukla,Hi,
Create one Search Help in the SE11 for the particular Field that u want to display. In the Screen(Transaction SE51),For that Text Box in the Attributes,in Dict Tab ->Search Help Field give that Search Help Name.
For Eg,
If u want Purchase Order Numbers in that F4 Help.Create one <b>Search Help</b> by giving Table Name as <b>EKKO</b> & <b>Search Help Parameter</b> as <b>EBELN</b> with Lpos & Rpos as 0 & 1.Save & Activate it.
Give this Search Help Name in Dict Tab ->Search Help Field of that Screen Attributes.
Regards,
Padmam. -
How to enter values to a database table with data type 'LCHR'?
Hello All,
I have created a database table with five fields, of which the last field is 'Value' field in which i have to enter text with a maximum of 1000characters. I have also specified a 'Length' field preceding the 'Value' field.
The datatype specified for the 'Length' field is 'INT2' and for the value field is 'LCHR' with length 1000.
When i tried inserting values to the table through a report, the report is giving an error that 'Literals that take up more than one line are not permitted', which means 255characters.
Also, when i entered a short text which is less than 250 characters to the 'Value' field,, the report is working fine and the table entry is visible.
Can anyone help me in this?
It would be really helpful if you explain how to use 'LCHR' data type in tables and how to enter values to such a field with more than 255characters.
Thanks in Advance,
ShinoHi shino,
Alternatively,
you can use STRING instead of LCHR.
I too have tried with LCHR and am facing the same issue.. i am not sure why its coming..
i have tried STRING and its working perfectly.
wa-key_field = 'IN4'.
CONCATENATE 'Long text over 200 chars length '
'another Long text over 200 chars length '
'another Long text over 200 chars length '
INTO wa-long_text.
wa-len = strlen( wa-long_text ).
INSERT zshino_table from wa.
SELECT * FROM zshino_table INTO table it.
clear wa.
LOOP AT it INTO wa.
WRITE:/ wa-len, ' ' , wa-long_text.
ENDLOOP.
Also, remember to set the type of the database field as String.
hope this was of some help,
thanks and regards,
Sagar. -
How to get Value of a item of first record when current record is second
How to get Value of a item of first record when current record is second in Form6i ?
get_item_instance_property dose not allow to get value.Gerd,
You're right, there are several other triggers that must be coded, but I was responding to Steve's statement about Inserting or deleting records from the multi-record block. For the record, I use the following to manage a Record Group:
* When-New-Block-Instance - Initialize the RG
* block Post-Query - populate the RG
* When-Create-Record - add new record to RG
* When-Remove-Record - remove record from RG
* block When-New-Item-Instance - capture previous value of the item or row
* When-Validate-Item - Item specific Insert, Update, Delete of values in the RG
There are a few other places as well, but these are the minimum. It might seem like a lot of code, but then again, I don't use this solution for every multi-line block. Like all tools, you use the right tool for the job. :-)
Craig...
Maybe you are looking for
-
Networking my MacBook with iMac
Apologies if this has been posted elsewhere, but i couldn't find a thread, and despite the cost of apple support - they are only open BH...which seems ridiculous. Anyway...I have a G5 iMac which i have just installed an Airport Extreme Card in. I am
-
Hello, Currently we are working on configuration of LDAP AD on GRC(sp13) system. Done with all the required configuration as per the recommendations by SAP. But, while trying to perform repository sync getting error as" USER ADAPTER IS EMPTY". I am a
-
PLD. How to get ProjectName and WareHousename
Hi, is it possible to get Names of Warehouses and (or) Projects which codes are used in Documents into printing documents and how? With regard, Maxim Grunis
-
Loop - checking for lock to clear
My application uses tables that are refreshed from their sources. I have a table with a field in it that if set to "locked" (by an external process or another user of the application). I set an item (P1_LOCK_STATUS) to the results of the select state
-
Ive used youtube converters for ages now, but since i did the last update, its just not working? This hasnt happened before with any of the other updates? Ive tried deleting them and redownloading them, using different MP3 converters, they've all wor