How to get a parameter from each request in a session scope BackingBean
While calling my JSF page, I pass an id as parameter in the URL, and in the Backing bean I retrieve it from the request.
On each request I need to get the id and populate the page accordingly.
But I am forced to create my Backing Bean in session scope b'cos otherwise ValueChangeListener method does not work properly.
So where and how do I get the id on each request?
Pls. help
What you can do is create it in the request scope like this:
<managed-bean>
<managed-bean-name>personBean</managed-bean-name>
<managed-bean-class>
com.PersonBean
</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>id</property-name>
<property-class>java.lang.Long</property-class>
<value>#{param.id}</value>
</managed-property>
</managed-bean>And then in the page use a hidden field to set the id in case of a postback (validation error):
<h:inputHidden id="id" value="#{personBean.id}"/>Does that help you?
Thomas
Similar Messages
-
How to get the parameter from Java Script into the Parameter crystal Report
Hi All,
Crystal Report is integrated with Oracle 10g. I created the base SQL query for col1, col2, col3 and col4. Java Script pass parameter value (185) to Col1.
My question is how to create crystal report to make Col1 as parameter and how to get the parameter value 185(Col1) from Java Script. Is there any additional code I need to include in the crystal report?
FYI.
Java script sends the right parameter value.There is no issue in java script.
This is an automatic scheduled process when batch runs, Java script should pass the parameter value and the crystal report should get the value and produce the output report.Not sure if this is an application question or if you are trying to hook into Crystal Reports parameter UI? If the later then no option other than report design. If an application then I can move this to the Java Forums.
If you are asking how to alter the parameters I suggest you remove the Java reference and post a new question so it's not confusing the issue.
Please clarify? -
How to get a parameter from BPC and use it in ABAP program
Hello gurus!
I got a problem...
SAP BPC will send parameters such as year, division, category, company code and so on via script logic to SAP BW.
I need to get these parameters from BPC and use them in a ABAP program as a filter.
This ABAP program will do several routines and return new values to BPC. It must be made on ABAP and I need to filter data to avoid performance issues.
Does anybody knows how to do it? or have a example of it?
Thank you in advance.
Regards,
Rubens KumoriHello, I'm looking for a suggest.
I need to pass two parameters (users can input them in a data manager package in bpc) to a BAdI.
In this BAdI I write a code that store those parameters in a InfoObject.
The problem is:
- one parameter is for CATEGORY value. CATEGORY is a dimension of the application and I read the value with a code like this:
READ TABLE it_cv INTO l_s_it_cv
WITH TABLE KEY dim_upper_case = 'C_CATEGORY'.
- other parameter is a generic DATE. this parameter is not a dimension of the application and I don't know how I can retrieve this value in BAdI.
READ TABLE it_cv INTO l_s_it_cv
WITH TABLE KEY dim_upper_case = '.....'.
The data manager dynamic script is:
PROMPT(SELECTINPUT,,,,"%CATEGORY_DIM%")
PROMPT(TEXT,%SELECTED_DAY%,"Write the date (format YYYYMMDD)",)
I also have a dynamic constant that assign the name %CATEGORY_DIM% to "C_CATEGORY" value.
Can anyone help me?
thanks a lot
Edited by: Luca Novali on Feb 13, 2012 3:49 PM -
Get a parameter from a Request
Hello everybody,
I noticed that there is not a method like request.setParameter(...,...), so i was wondering if i can use the method request.setAttribute(...,...) to put an object in the request and then get it with the method request.getParameter().....;anyway what is the difference between a Parameter and an attribute in the request object?
Cheers.
StefanoHello,
Basically the difference I see is that a request's parameter is information that is already part of the request. An attribute is something that you add into a request and is not essential to the object. As for putting an object in there it can be done with the setAttribute just as you mention.
Hope this helps -
Display tag: how to get pagesize parameter from TableDecorator?
Hi all,
I'm designing�org.displaytag.decorator.TableDecorator wrapper for our project, but I need to get pagesizeparameter from TableDecorator and I don't know - how to do it :(
Any ideas?
ps. http://www.displaytag.org usedNot sure if this is an application question or if you are trying to hook into Crystal Reports parameter UI? If the later then no option other than report design. If an application then I can move this to the Java Forums.
If you are asking how to alter the parameters I suggest you remove the Java reference and post a new question so it's not confusing the issue.
Please clarify? -
How to get a parameter from a HTML select list in a servlet
Hi!
I have the following problem :
In a HTML form I have the following select list:
<select name="tickets">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
</select>And in the servlet I try to read the value I have selected doing : String tickB = (String) request.getParameter("tickets");But for my amazement tickB always has the value 1, althought I have selected in the list the value 2,3,4,5 or 6
�Where is the error ? �Have I to do with getParamaterValues instead getParameter to obtain the correct value?
Bye
Edited by: bladu on Jun 4, 2008 1:25 AMWhere is the error ? No error in portion of code you have shown.
But for my amazement tickB always has the value 1, althought I have selected in the list the value 2,3,4,5 or 6Are you sure there are no other form element(hidden field, text field) with same name tickets ? If you are using GET method, you may check the url to see if there are more than one parameters named tickets set in it
Have I to do with getParamaterValues instead getParameter to obtain the correct value? Not required. -
We have more than one computer at home. How do we get the songs from each computer onto one I-Pod?
Copy the songs to a computer that is running iTunes, add those new tracks to the current library, and then synch those tracts to the iPod.
You might take a look at iTunes Help.... -
How to get a formula from the user from a text box in a webpage
Hi. I would like to know how to get the formula from the user who enters in a textbox. This formula can have any number of variables starting with a and goes on.
The complexity of the formula can go upto sin, cos, ln, exp. Also user enters the minimum and maximum values of these variables. Based on a specific algorithm (which I use) I would calculate a *set of values, say 10, for each of these variables, substitute in the formula and based on the result of this formula, I select ONE suitable value for each of the variables.
I don't know how to get this formula (which most likely to be different each time) and substitute the values *which I found earlier.
Kindly help me out in this issue.
ThanksThe textbox is the easy part. It's no different than getting a String parameter out of an HTTP request.
The hard part is parsing the String into a "formula" for evaluation. You'll have to write a parser or find one.
Google for "Java math expression parser" and see what you get.
Or write your own with JavaCC.
% -
How to get selected value from selectOneRadio ???
Hi...i want to how to get selected value from selectOneRadio and use it in another page and in backing bean.
Note i have about 10 selectOneRadio group in one page i want to know value of each one of them.
Plzzzzzzzz i need helpYou have a datatable in which each row is a question, correct?
Also in each row you have 5 possible answers that are in a radio, correct?
So,
You need to put in your datatable model, a question, and a list of answers (5 in yor case) and the selected one.
So you will have a get to the question, an SelectItem[] list to populate the radios and another get/set to the selected question.
ex:
<h:selectOneRadio value="#{notas.selectedString}" id="rb">
<f:selectItem itemValue="#{notas.valuesList}"/>
</h:selectOneRadio>
Search the web for examples like yours. -
How to get the value from a JavaScript and send the same to Java file?
Hi.
How to get the value from a JavaScript (this JS is called when an action invoked) and send the value from the JS to a Java file?
Thanks and regards,
Leslie VYes, I am trying with web application.
In the below code, a variable 'message' carries the needed info. I would like to send this 'message' variable with the 'request'.
How to send this 'message' with and to the 'request'?
Thanks for the help :-)
The actual JS code is:
function productdeselection()
var i=0;
var j=0;
var deselectedproduct = new Array(5);
var message = "Are you sure to delete Product ";
mvi=document.forms[0].MVI;
mei=document.forms[0].MEI;
lpi=document.forms[0].LPI;
if(null != mvi)
++i;
if(null != mei )
++i;
if(null != lpi)
++i;
if(null != mvi && mvi.checked)
deselectedproduct[++j]="MVI?";
if(null != mei && mei.checked)
deselectedproduct[++j]="GAP?";
if(null != lpi && lpi.checked)
deselectedproduct[++j]="LPI?";
if( 0!=j)
if(i!=j)
for (x=0; x<deselectedproduct.length; x++)
if(null != deselectedproduct[x])
message =message+ "-" +deselectedproduct[x];
alert(message);
else
//alert(" You cannot remove all products!");
return false;
return true;
} -
How to get maximal value from the data/class for show in Map legend
I make WAD report that using Map Web Item.
I devide to four (4) classes for legend (Generate_Breaks).
I want to change default value for the class by javascript and for this,
I need to get maximal value from the class.
How to get maximal value from the data/class.
please give me solution for my problem.
Many Thx
Eddy Utomouse this to get the following End_date
<?following-sibling::../END_DATE?>
Try this
<?for-each:/ROOT/ROW?>
==================
Current StartDate <?START_DATE?>
Current End Date <?END_DATE?>
Next Start Date <?following-sibling::ROW/END_DATE?>
Previous End Date <?preceding-sibling::ROW[1]/END_DATE?>
================
<?end for-each?>
o/p
==================
Current StartDate 01-01-1980
Current End Date 01-01-1988
Next Start Date 01-01-1990
Previous End Date
================
==================
Current StartDate 01-01-1988
Current End Date 01-01-1990
Next Start Date 01-01-2005
Previous End Date 01-01-1988
================
==================
Current StartDate 01-01-2000
Current End Date 01-01-2005
Next Start Date
Previous End Date 01 -
Can viewObject get a parameter from sessionScope to binding variable?
hello,
using Jdev11g ADF Fusion application
Can viewObject get a parameter from sessionScope and assign into binding variable ? without using executeWithParameter
Thanks
greenAppleA. Safwat,
As I said before, I was not trying to be offensive, but simply to explain some of the shortcomings of one solution over another. One of the reasons people give such short answers is that many questions (including this one) have been asked and answered many many many times before on the forum. As to my reasons:
1). Overkill - overkill because you are writing code to do what the framework already provides for you.
2). Not bind-variable friendly - you are gluing in literals into a SQL statement. That means that Oracle will have to hard parse the query for each new value of the filter clause, yielding to poor performance, particularly in a multiuser environment. It should ideally be done using bind variables.
3). Insecure (think about what happens if you put "'xyz' or 1=1" into the filterValue there) - not using bind variables is a security hole. Think through what happens if a filter criteria comes through like the one I mentioned.
4). Inflexible - because you are overriding executeQueryForCollection, this VO becomes inflexible and can only be used in this particular place. Using the declarative approach outlined by Timo is more flexible
5). Bad (ok, that's my opinion there) - OK, perhaps this was a bit offensive ;)
Please don't take a critique of a post as offensive, as I assure you it was not intended to be in that spirit. As I mentioned, I greatly appreciate when people point out issues/problems/etc with my ideas, as that is the best way for me to learn. I have in the past written applications that were not bind-variable friendly, and I learned the downsides the hard way (system was horribly non-performant) - I wish someone had reviewed my approach and told me "bad idea" before the application made it into production.
Respectfully,
John -
How do get the role from ldap session.
i am using the follwing getting the role from the request in openldap and j_security_check:
f(request.isUserInRole("manager")){
how can i use this in the session:You might wanna change permissions for that attribute ...
Change it from Admin to OWNER and you should be able to then get it for any user ...
HTH .. -
How to Get Missing Dates for Each Support Ticket In My Query?
Hello -
I'm really baffled as to how to get missing dates for each support ticket in my query. I did a search for this and found several CTE's however they only provide ways to find missing dates in a date table rather than missing dates for another column
in a table. Let me explain a bit further here -
I have a query which has a list of support tickets for the month of January. Each support ticket is supposed to be updated daily by a support rep, however that isn't happening so the business wants to know for each ticket which dates have NOT been
updated. So, for example, I might have support ticket 44BS which was updated on 2014-01-01, 2014-01-05, 2014-01-07. Each time the ticket is updated a new row is inserted into the table. I need a query which will return the missing dates per
each support ticket.
I should also add that I DO NOT have any sort of admin nor write permissions to the database...none at all. My team has tried and they won't give 'em. So proposing a function or storable solution will not work. I'm stuck with doing everything
in a query.
I'll try and provide some sample data as an example -
CREATE TABLE #Tickets
TicketNo VARCHAR(4)
,DateUpdated DATE
INSERT INTO #Tickets VALUES ('44BS', '2014-01-01')
INSERT INTO #Tickets VALUES ('44BS', '2014-01-05')
INSERT INTO #Tickets VALUES ('44BS', '2014-01-07')
INSERT INTO #Tickets VALUES ('32VT', '2014-01-03')
INSERT INTO #Tickets VALUES ('32VT', '2014-01-09')
INSERT INTO #Tickets VALUES ('32VT', '2014-01-11')
So for ticket 44BS, I need to return the missing dates between January 1st and January 5th, again between January 5th and January 7th. A set-based solution would be best.
I'm sure this is easier than i'm making it. However, after playing around for a couple of hours my head hurts and I need sleep. If anyone can help, you'd be a job-saver :)
Thanks!!CREATE TABLE #Tickets (
TicketNo VARCHAR(4)
,DateUpdated DATETIME
GO
INSERT INTO #Tickets
VALUES (
'44BS'
,'2014-01-01'
INSERT INTO #Tickets
VALUES (
'44BS'
,'2014-01-05'
INSERT INTO #Tickets
VALUES (
'44BS'
,'2014-01-07'
INSERT INTO #Tickets
VALUES (
'32VT'
,'2014-01-03'
INSERT INTO #Tickets
VALUES (
'32VT'
,'2014-01-09'
INSERT INTO #Tickets
VALUES (
'32VT'
,'2014-01-11'
GO
GO
SELECT *
FROM #Tickets
GO
GO
CREATE TABLE #tempDist (
NRow INT
,TicketNo VARCHAR(4)
,MinDate DATETIME
,MaxDate DATETIME
GO
CREATE TABLE #tempUnUserdDate (
TicketNo VARCHAR(4)
,MissDate DATETIME
GO
INSERT INTO #tempDist
SELECT Row_Number() OVER (
ORDER BY TicketNo
) AS NROw
,TicketNo
,Min(DateUpdated) AS MinDate
,MAx(DateUpdated) AS MaxDate
FROM #Tickets
GROUP BY TicketNo
SELECT *
FROM #tempDist
GO
-- Get the number of rows in the looping table
DECLARE @RowCount INT
SET @RowCount = (
SELECT COUNT(TicketNo)
FROM #tempDist
-- Declare an iterator
DECLARE @I INT
-- Initialize the iterator
SET @I = 1
-- Loop through the rows of a table @myTable
WHILE (@I <= @RowCount)
BEGIN
-- Declare variables to hold the data which we get after looping each record
DECLARE @MyDate DATETIME
DECLARE @TicketNo VARCHAR(50)
,@MinDate DATETIME
,@MaxDate DATETIME
-- Get the data from table and set to variables
SELECT @TicketNo = TicketNo
,@MinDate = MinDate
,@MaxDate = MaxDate
FROM #tempDist
WHERE NRow = @I
SET @MyDate = @MinDate
WHILE @MaxDate > @MyDate
BEGIN
IF NOT EXISTS (
SELECT *
FROM #Tickets
WHERE TicketNo = @TicketNo
AND DateUpdated = @MyDate
BEGIN
INSERT INTO #tempUnUserdDate
VALUES (
@TicketNo
,@MyDate
END
SET @MyDate = dateadd(d, 1, @MyDate)
END
SET @I = @I + 1
END
GO
SELECT *
FROM #tempUnUserdDate
GO
GO
DROP TABLE #tickets
GO
DROP TABLE #tempDist
GO
DROP TABLE #tempUnUserdDate
Thanks,
Shridhar J Joshi
<If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'> -
Qry:How to get different price for each price list (variable area) in order
1-How to get different price for each price list (variable area) in order for sale. for the opportunity to display and select multiple prices.
2- I add a location store from a table in line item and I want to see this area in order,.
I 'm created 2 field location(item line and order), 1 table location
I tried this for exemple : select $ [userfieldlocation.OITW]Thanks Suda for your answer,
the Formatted Search for prices is OK, but for the Item locations in warehouse this is not so simple,
I must have several (at least 2) locations for the item in the Warehouse and a track of this location and search possibilities.
read carefully and imagine how (Management warehouse locations)
I added a user table '@Location' who linked to a user field 'U_Location in Item master data --> lnventory data line and an ather user field 'U_Location' in sales order
I met the value of location in the table (list of locations for any warehouse), I select the location of each item while receiving merchandise in the user field of inventory data line (Item M data) and this value appears in the sales order 'U_Location' user field ( only the location value in the default warehouse for this Item)
or
create an user field 'location' in Good receipt PO to fill it while receiving merchandise that appears in the sales order to give possibility to find/select the location of the item at this order and in Item master data
I think we will use all these tables
@LOCATION
PDN1
OITM
OITW
OWHS
RDR1
Juste a another question : where you found this and What is: ' 38.1.0 '
Is it in document (System information):Item=38 Pane=1 ??
Thanks,
Ouchen
Maybe you are looking for
-
Apple Mail color coding both font and background
Is there a way to color-code both the font and the background of emails via Rules? As soon as you set a rule to color code one of them another becomes unavailable. This is probably by design but then I'd say this is very stupid design. I do not see a
-
Need driver for display (ATI Mobility Radeon 7000 IGP)
Necessary driver for display ATI MOBILITY RADEON 7000 IGP under operating system Win 98, ME
-
Mac Book Pro will not start on Battery Power
Mac Book Pro will not start on Battery Power although battery at 98% need to connect charger. When started date and time incorrect, comes up as 1st Jan 2012.
-
Why is my ichat 5.0.3 video chat not working?
i've had my macbook pro for a week and the video chats been working perfectly fine. however, yesterday i tried to video chat, and it just said, this computer does not support video chats. the computer still recognizes the camera, and i can take pict
-
I made a simple fade in, in flash, ublished it, now what do i do to get it to play on my website? when i drag it on it just plays as a quicktime video not a photo. Also i don't want it as a gif. can someone help?