Af:iterator and getting values from a particular row
Hi,
I am using af:iterator to loop through a resultSet in a VO.
<af:iterator binding="#{backingBeanScope.backing_subscribe.i1}"
value="#{bindings.SubscriptionPublicView1.collectionModel}"
var = "row"
id="i1">
For each iteration, I display a row of data from my VO in a panel box.
Each panel box has a command Link.
Usually, from my backing bean, I do something like this to get an attribute off of a view Iterator.
Row currentRow = getIterator("SubscriptionPublicView1Iterator").getCurrentRow();
int sid = (Integer)currentRow.getAttribute("Sid");
However, in this case, I am always getting the 'sid' from the first record in the collectionModel, and not the 'sid' that corresponds to the commandLink that is selected by the user.
What is the best way to do this when using an af:iterator?
Thanks,
Joel
Hi,
Timo - as usual - is correct. Using an iterator does not guarantee that selecting a row is set as current in the ADF binding. For this you need to use an action listener on the command component you click on. To get the rowKey of the selected row, you can use a setPropertyListener on the command link that writes the row key of the selected item into memory
<af:setPropertyListener from="#{row.key} to="#{viewScope.key}" type="action"/>
This value then can be looked up in the managed bean to set the row as current in the ADF binding
Frank
Similar Messages
-
From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?
Hi,
Use NVL or COALESCE:
NVL (col_a, col_b)
Returns col_a if col_a is not NULL; otherwise, it returns col_b.
Col_a and col_b must have similar (if not identical) datatypes; for example, if col_a is a DATE, then col_b can be another DATE or it can be a TIMESTAMP, but it can't be a VARCHAR2.
For more about NVL and COALESCE, see the SQL Language manual: http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions119.htm#sthref1310
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
Explain, using specific examples, how you get those results from that data.
Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
See the forum FAQ: https://forums.oracle.com/message/9362002 -
Send value to BAPI and and get value from BAPI on VB 6.0
Hi All,
I want to connect SAP and send some values and get some results from BAPI with Visual Basic 6.0
I connected SAP successfull But I didn't send value to BAPI.
I want to connect SAP with BAPI_MATERIAL_GET_ALL BAPI and I want to send u2018000000000000980010u2019 parameter. So I want get the result from BAPI.
Could anyone help me about send and get value BAPI with VB 6.0?
Thanks in advanced
captivator
Edited by: captivator on Dec 10, 2010 4:24 PMHi Dinesh,
My full code is below.
I'm getting error when "Set obj = ctlLogon.GetSAPObject("BAPI_MATERIAL_GET_ALL")" code line is working.
Error : Script error in module line 30:(10091) ActiveX Automation:no such property or method
Have you got any idea?
Thanks in advanced.
Esat
Set ctlLogon = CreateObject("SAP.LogonControl.1")
Set sapConnection = ctlLogon.NewConnection
sapConnection.User = "user"
sapConnection.Client = "120"
sapConnection.Password = "1q2w3e4r"
sapConnection.ApplicationServer = "xxxxxx"
sapConnection.Language = "EN"
sapConnection.SystemNumber = "00"
booReturn = sapConnection.Logon(0, True)
If booReturn <> True Then
gSAPConnect = False
Else
gSAPConnect = True
End If
If booReturn Then
'MsgBox "Logged On successfullyu2026"
Debug.Print"Logged On successfullyu2026"
End If
Dim obj As Object
Dim return As Object
Set obj = ctlLogon.GetSAPObject("BAPI_MATERIAL_GET_ALL")
Set return = ctlLogon.DimAs(obj, "000000000000980010", "RETURN") -
How to build Hierarchy and get values from DAX Evaluation Query?
i have create Calander Hierachy for Year,Quarter,Month... in this invisible tabuler model medata properties.
any one give steps for create Hierachy and Get Data From DAX evaluation context ?.
VenkadesanPerumalVenkadesan, is this still an issue?
Thanks!
Ed Price, Azure & Power BI Customer Program Manager (Blog,
Small Basic,
Wiki Ninjas,
Wiki)
Answer an interesting question?
Create a wiki article about it! -
Are you having success and getting value from "Month 13" in GL?
We are looking at using month 13 in the JDE GL. Am interested in use cases of other customers where they have either:
- tried out month 13 and got good value from it (if so what was the value)
- have tried month 13 out and decided not to use it (why?)
- have stayed away from the functionality (why)
ThanksThank you everyone for your 'tips' and 'advice'.
I've managed to get the maximum and minimum value, using the same method, but into my very own while loop.
I used the connection Y value and made the same connection as shown below.
THANK YOU ALL! -
Getting values from a specific row in a table
hi all, i have a table that has the following data
WITH sec AS
SELECT 111 id, 'XPE' cid, 10 alias, 'TLC' Description, 'PEYU' lvl_1, 'IES' lvl_2, ' BAN' lvl_3 FROM dual UNION ALL
SELECT 111 id, 'XPE' cid, 78 alias, 'TLC2' Description, 'SUN' lvl_1, null lvl_2, ' BAN3' lvl_3 FROM dual UNION ALL
SELECT 111 id, 'XPE' cid, 200 alias, 'TLC' Description, null lvl_1, null lvl_2, ' BAN' lvl_3 FROM dual UNION ALL
SELECT 111 id, 'XPE' cid, 54 alias, 'TLC3' Description, 'SUN5' lvl_1, null lvl_2, ' BAN3' lvl_3 FROM dual UNION ALL
SELECT 112 id, 'XPE2' cid, 10 alias, 'PAD' Description, 'PEYU' lvl_1, 'IES' lvl_2, ' BAN' lvl_3 FROM dual UNION ALL
SELECT 112 id, 'XPE2' cid, 78 alias, 'PAD2' Description, 'SUN' lvl_1, null lvl_2, ' BAN3' lvl_3 FROM dual UNION ALL
SELECT 112 id, 'XPE2' cid, 54 alias, 'TLC3' Description, 'SUN5' lvl_1, null lvl_2, ' BAN3' lvl_3 FROM dual UNION ALL
SELECT 112 id, 'XPE2' cid, 200 alias, 'PAD' Description, 'SIN' lvl_1, 'CON' lvl_2, ' UIE' lvl_3 FROM dual UNION ALL
SELECT 113 id, 'XPE3' cid, 10 alias, 'PAD5' Description, NULL lvl_1, NULL lvl_2, NULL lvl_3 FROM dual UNION ALL
SELECT 113 id, 'XPE3' cid, 200 alias, 'PAD5' Description, NULL lvl_1, NULL lvl_2, NULL lvl_3 FROM dual UNION ALL
SELECT 113 id, 'XPE3' cid, 78 alias, 'PAD7' Description, 'SUN' lvl_1, null lvl_2, ' BAN3' lvl_3 FROM dual UNION ALL
SELECT 113 id, 'XPE3' cid, 54 alias, 'TLE' Description, 'SUN5' lvl_1, null lvl_2, ' BAN3' lvl_3 FROM dual
)i want to write a query that give me this output
ID CID ALIAS DESCRIPTION LVL_1 LVL_2 LVL_3
111 XPE 10 TLC PEYU IES BAN
111 XPE 200 TLC PEYU IES BAN
111 XPE 78 TLC2 SUN BAN3
111 XPE 54 TLC3 SUN5 BAN3
112 XPE2 10 PAD PEYU IES BAN
112 XPE2 200 PAD SIN CON UIE
112 XPE2 78 PAD2 SUN BAN3
112 XPE2 54 TLC3 SUN5 BAN3
113 XPE3 10 PAD5
113 XPE3 200 PAD5
113 XPE3 78 PAD7 SUN BAN3
113 XPE3 54 TLE SUN5 BAN3
this is how the logic works:
as you can see the table has many different set of ids, 111,112,113 and each id has a set of alias
for id 111 and alias 200 the sec table has null values for level 1 and level 2 columns. what i want to do
is that if any of the level1,level2 and level3 columns has null VALUES(FOR aliases=200) then the values should be taking from the ROW(s) with alias=10
in this case alias=200 display peyu and ies for level1 and level2 column. this values were taking from the row with alias=10 and id =111.
level3 stay the same since it is not null
for id 112 and alias =200, none of te level columns has null so the value stay the same as in the table
for id 113 alias 200, all level columns has null so the value should be taking from alias=10 id =113.
in this case the row with alias=10 has also null so both rows 200 and 10 gets display with null values
the other rows with different alias should just be display.
i tried using las_value analytic function but i was not successful. i am using ORACLE 9I and ignore null option in last_value function is not supported
the data in the table is not in any particular order.
can someone help write a query that gives me the output above. thanksIf I understand correct,below solution is corect. :-)
col lvl_2 for a10
WITH sec AS(
SELECT 111 id, 10 alias,'PEYU' lvl_1, 'IES' lvl_2, ' BAN' lvl_3 FROM dual UNION ALL
SELECT 111 id, 78 alias,'SUN' lvl_1, null lvl_2, ' BAN3' lvl_3 FROM dual UNION ALL
SELECT 111 id,200 alias,null lvl_1, null lvl_2, ' BAN' lvl_3 FROM dual UNION ALL
SELECT 111 id, 54 alias,'SUN5' lvl_1, null lvl_2, ' BAN3' lvl_3 FROM dual UNION ALL
SELECT 112 id, 10 alias,'PEYU' lvl_1, 'IES' lvl_2, ' BAN' lvl_3 FROM dual UNION ALL
SELECT 112 id, 78 alias,'SUN' lvl_1, null lvl_2, ' BAN3' lvl_3 FROM dual UNION ALL
SELECT 112 id, 54 alias,'SUN5' lvl_1, null lvl_2, ' BAN3' lvl_3 FROM dual UNION ALL
SELECT 112 id,200 alias,'SIN' lvl_1, 'CON' lvl_2, ' UIE' lvl_3 FROM dual UNION ALL
SELECT 113 id, 10 alias, NULL lvl_1, NULL lvl_2, NULL lvl_3 FROM dual UNION ALL
SELECT 113 id,200 alias, NULL lvl_1, NULL lvl_2, NULL lvl_3 FROM dual UNION ALL
SELECT 113 id, 78 alias,'SUN' lvl_1, null lvl_2, ' BAN3' lvl_3 FROM dual UNION ALL
SELECT 113 id, 54 alias,'SUN5' lvl_1, null lvl_2, ' BAN3' lvl_3 FROM dual
select id,alias,
case when alias = 200 and lvl_1 is null
then max(decode(alias,10,lvl_1)) over(partition by id)
else lvl_1 end as lvl_1,
case when alias = 200 and lvl_2 is null
then max(decode(alias,10,lvl_2)) over(partition by id)
else lvl_2 end as lvl_2,
case when alias = 200 and lvl_3 is null
then max(decode(alias,10,lvl_3)) over(partition by id)
else lvl_3 end as lvl_3
from sec
order by id,alias;
ID ALIAS LVL_ LVL_2 LVL_3
111 10 PEYU IES BAN
111 54 SUN5 null BAN3
111 78 SUN null BAN3
111 200 PEYU IES BAN
112 10 PEYU IES BAN
112 54 SUN5 null BAN3
112 78 SUN null BAN3
112 200 SIN CON UIE
113 10 null null null
113 54 SUN5 null BAN3
113 78 SUN null BAN3
113 200 null null null -
LoaderInfo get values from EMBED and OBject Tag (not FlashVars)
hi
i try get values from object and embed tags like bgColor and
allowFullScreen
but i cant find how i can it
loaderInfo.parameters return only flashVars
if some body know it please help
thank you
Sonettic Cinema
Project<forward name="success" path="/jsp/success.jsp" redirect="true" />
but when success.jsp page gets called its not displaying the username and usertype values on page.The request has been redirected to success.jsp(*redirect="true"*) and hence the attributes stored in request object will not be available in success.jsp. Use Session to store login user information instead. -
Getting value from portal or bsp application to selection screen parameter
Daer SDNer's.
Is there any possibility of getting value from bsp application and that value to be passed to selection paramater of bw query varaiable.
concept as follows.
report is based on vendor related information. particular vendor having user id in bsp or portal for accessing reports. if he selects bw query in portal or bsp dash board. that same vendor name or id shoukd be pass to default vendor selection entry in bi... so only that particular vendor details should display.....
HarikrishnaDear Arun,
thanks for the reply. can i dynamically get the values to selection parmaters from bsp or else i need to mantain those user ids(vendor name) in bw. could you explain on it. if possible provide some sample code on it.
Thanks
Harikrishna N -
How to fetch old and new value from of a field(non-key) from LOGDATA
Hello SDNers,
i m fecthing LOgdata from dbtlog table[in our case the log is not getting Updated in CDHDR and CDPOS table]
i m using the same logic as it is used in RSVTPROT
but the problem is
" IT is fetching OLD and NEW VALUE after Update from same field LOGDATA of dbtlog table BUT when i used same logic it is FEtching only OLD VALUEs,
CAN U GUYS PLS TELL ME HOW TO FECTH OLD VALUE and NEW VALUE of a PArticular field(non-key field, fecthing key field is not an issue) From LOGDATA field of DBTLOG.
thx a lot in advance
Regards
KuldeepHi,
May be this link is useful to you.
a® -
JSF:how to get value from dinamically generated HtmlInputText components�H�H
<h:panelGroup binding="#{dynamicInputGroupBean.group}"/>
public HtmlPanelGroup getGroup() {
if (this.getSelectedComp() == null) {
return this.group;
FacesContext facesContext = FacesContext.getCurrentInstance();
Application application = facesContext.getApplication();
this.group = new HtmlPanelGroup();
Set pSet = this.getSelectedComp().getParameterses();
int size = pSet.size();
this.instanceValue = new String[size];
int i = 0;
for (Iterator it = pSet.iterator(); it.hasNext();) {
Parameters tempP = (Parameters) it.next();
HtmlOutputLabel outputLable = new HtmlOutputLabel();
HtmlInputText inputText = new HtmlInputText();
inputText.setId("p" + i);
String valueBindingExpression = "#{dynamicInputGroupBean.instanceValue["+i+ "]}";
System.out.println(valueBindingExpression);
ValueBinding valueBinding = application
.createValueBinding(valueBindingExpression);
inputText.setValueBinding("value", valueBinding);
outputLable.setFor(inputText.getId());
outputLable.setValue(tempP.getParaname() + ": ");
group.getChildren().add(outputLable);
group.getChildren().add(inputText);
i++;
// group.getChildren().add(new HtmlInputText());
return group;
}as codes show above, i successfully genera HtmlInputText dinamicaly�C
but i got problems while i try to print those values...
after the the jsp page presents in my browser,
i input some words in the input components,
and then click a commandButton hold an action to print their value
action code :
String[] tempArray = this.getInstanceValue();
for (int i = 0; i < tempArray.length; i++) {
System.out.println(tempArray);
only NULL has been printed in the consol ....not the word i inputed!!!
so my question is how can i get values from those
dinamically generated HtmlInputText ????This approach is odd. What's the functional requirement after all? You normally attach the inputtext value to a backing bean property and do the desired command button action which is attached to a backing bean action method. In this method you then use the value for the query.
-
Getting values from a datagrid to an ArrayCollection
Hi, I have a drag and dropable datagrid. I fill it with rows of data from another datagrid. Finally, my application demands savings the data from the datagrid into an array collection along with the index of each row. How do i get values from a datagrid into an arrayCollection variable? Please help me..!
Whatever is dropped into the DataGrid automatically goes into its dataProvider property, typically an ArrayCollection. Just access the data grid's dataProvider property to see the values.
-
How to get values from a stored package variable of type record ?
Sir,
In my JClient form, I need to get values from a database stored package variable of type record. And the values are retained in the JClient form for the whole session. The values are copied only once when the form is started.
What is the best way to do that ?
Thanks
StephenStephen,
not sure what your model is, but if it is Business Components, I think I would expose the properties as a client method on the application module. This way all JClient panels and frames will have access to it. You could use a HashMap to store the data in teh app module.
If JDBC supports the record type, then you should be able to call it via a prepared SQL statement. If not, you may consider writing a PLSQL accessor to your stored procedure that returns something that can be handled.
Steve Muench provides the following examples on his blog page
http://otn.oracle.com/products/jdev/tips/muench/stprocnondbblock/PassUserEnteredValuesToStoredProc.zip
http://otn.oracle.com/products/jdev/tips/muench/multilevelstproc/MultilevelStoredProcExample.zip
Frank -
How can I get values from listbox?
Hi all,
I need to get price values from Price List (Inventory -> Item Master Data screen). It's important to get values from field 'Price' BEFORE item will be added/updated.
How can I get values from Pricelist listbox?
Thanks for any suggestions or short sample code.
Best regards,
AndyHi Andy
Here is som sample code that will get the description of the price list and also the price that is displaying at the time. The item master must be open for this snippet of code
Public Sub GetItemPriceFromOpenWindow()
'this is assuming item master is open
Dim oEdit As SAPbouiCOM.EditText
oEdit = SBO_Application.Forms.GetForm("150", 1).Items.Item("34").Specific
SBO_Application.MessageBox(oEdit.Value)
Dim oCmb As SAPbouiCOM.ComboBox
oCmb = SBO_Application.Forms.GetForm("150", 1).Items.Item("24").Specific
SBO_Application.MessageBox(oCmb.Selected.Description)
End Sub
Hope it helps -
How to get values from a table(in jsp) for validation using javascript.
hi,
this is praveen,pls tell me the procedure to get values from a table(in jsp) for validation using javascript.
thank you in advance.Yes i did try the same ..
BEGIN
select PROD_tYPE into :P185_OFF_CITY from
magcrm_setup where atype = 'CITY' ;
:p185_OFF_CITY := 'XXX';
insert into mtest values ('inside foolter');
END;
When i checked the mtest table it shos me the row inserted...
inside foolter .. Now this means everything did get execute properly
But still the vallue of off_city is null or emtpy...
i check the filed and still its empty..
while mtest had those records..seems like some process is cleaining the values...but cant see such process...
a bit confused..here..I tried on Load after footer...
tried chaning the squence number of process ..but still it doesnt help
some how the session variables gets changed...and it is changed to empty
Edited by: pauljohny on Jan 3, 2012 2:01 AM
Edited by: pauljohny on Jan 3, 2012 2:03 AM -
Help: cant get values from a resultset
i have a class that contains all my MySQL statement and i am trying to use the results found from one of my select statements to pass on into another class which displays the results in a gui form. Here is my query:
public void profile(String user)
try
Class.forName(driver);
Connection con = DriverManager.getConnection( url,db_user, db_pass);
String username, name, email, dob, bio, gender, homepage, number;
//find username and select all details
String find = "SELECT Username, Full_name, Email, dob, Biography, Gender, Homepage, Contact_number FROM users WHERE Username = ? ";
PreparedStatement ps1 = con.prepareStatement(find);
ps1.setString(1, user);
ResultSet rs = ps1.executeQuery();
while(rs.next())
//retreive information from the server
username = rs.getString(1);
name = rs.getString(2);
email = rs.getString(3);
dob = rs.getString(4);
bio = rs.getString(5);
gender = rs.getString(6);
homepage = rs.getString(7);
number = rs.getString(8);
User_Profile profile = new User_Profile(username, name, email, dob, bio, gender, homepage, number);
JOptionPane.showMessageDialog(null, username + bio + email, null, JOptionPane.ERROR_MESSAGE);
con.close();
catch( Exception e )
e.printStackTrace();
JOptionPane.showMessageDialog(null, "error," + e.getMessage(), null, JOptionPane.ERROR_MESSAGE);
}As you can see, i am trying to pass on the variables username, name, etc to a new instance of my user_profile class but it doesnt for some reason. i dont get any comple errors so thats ok. i created messege dialog box from within the while statement above to see if a value is stored, and yes their is a value stored in my variables
below is the user profile class which shows my constructor that suppose to get the values from the query class in this code entered above User_Profile profile = new User_Profile(username, name, email, dob, bio, gender, homepage, number);
protected String username;
protected String FullName;
protected String Email;
protected String DOB;
protected String Biography;
protected String Gender;
protected String Homepage;
protected String Con_Number;
protected String crnt_user;
public User_Profile(String user, String name, String email, String dob,
String bio, String gender, String homepage, String number)
initComponents();
addWindowListener( this );
//get values from sql query and store them here.
this.username = user;
this.FullName = name;
this.Email = email;
this.DOB = dob;
this.Biography = bio;
this.Gender = gender;
this.Homepage = homepage;
this.Con_Number = number;
}the code below is used to display one of the values received from the query class, in this case returns null..
txt_name.setText(username)Does the user String match the database String
exactly?
Some databases are case sensative.Sorry posted before done.
Also, ensure you do not have trailing spaces in one or both. I remember Oracle had this problem a few years ago using the Type 4 driver but not through ODBC.
Maybe you are looking for
-
File Adapter--Processing parameter configuration
Hi Experts, I need to configured the sender and reciever FTP Adapter to Archive a 37 MB text file within a FTP server. It is taking 20 min to archive the file. does this requirement requires any change in Parameter configuration(like transfer mode, c
-
Newbie help - refreshing the page and validating?
When entering a userID and password, how would I make the values in the textbox disappear when I refresh the page/press F5? Also how would I check the 2 textboxes in a jsp page, if their empty/null and if they are redirect them to that same page? Tha
-
Is there any way I can read kernel data structure that contains the number of open files on the system? I know I can traverse the /proc tree or use the lsof program, but it creates too much overhead for my application. This parameter must be somewher
-
Cant install SL. help!
Hello all! Iv had this mac for awhile. Im running 10.5.8 and need to update to snow leopard because my iphone 4 iOS 7 needs itunes 11.1 or later which requires me to have OS X 10.6.8 or later (jeez!!!). I have the SL disk but it will not fully instal
-
To View Calc Scripts and Report scripts via MaxL or Esscmd
Hi all, Can somebody tell how to read any calc script or report script in any database with the help of MaxL or Esscmd? For example if there is any .csc or .rep file, I want to read the context of the file i.e. the script that is written in the file.