How to get the attribute of a selected row in a label
Hi all,
I am using Jdeveloper 11.1.1.2 and ADF.
I have a table with two columns, Id and Name. Furthermore I have an outputText where I would like to see the field Name of the selected Row in the table.
How have I to set the property "value" of the outputText to do this?
Thank you
Andrea
Hi Andrea,
If you are using ADFBC, the easiest way is to drop the attribute(Say Name) from the data control palette as outputText component and add partialTriggers property of it to point to table id(to refresh the outputText whenever the row is selected in table)
Sireesha
Similar Messages
-
How to get the values of a selected row and edit it
hi all,
i am using a table component.I am populating it from the database.i used static text to display the data .i have a edit button in the last column. when i click on it that particular rows data should be shown in a text field in that row itself,so that i should be able to edit it and then if i save it it that row should change to statictext with the updated data.
please provide a solution for this...
regards,
rpkHi Andrea,
If you are using ADFBC, the easiest way is to drop the attribute(Say Name) from the data control palette as outputText component and add partialTriggers property of it to point to table id(to refresh the outputText whenever the row is selected in table)
Sireesha -
How to get the values of last selected row in Table?
Hi,
I have one editable table , where i have Create, Delete and Commit operation on it.
When i am clicking on Create button it add new row to my table.
But I want the value of my last selected row from the table in my Bean.
Can anyone suggest me please....... its urgent
Jdev:- 11.1.1.0.3
Thanks,
Ramitjust get this code empTable is the table binding
RowKeySet rks = new RowKeySetImpl();
CollectionModel model = (CollectionModel)empTable.getValue();
RowKeySet selectedRowKeys = empTable.getSelectedRowKeys();
if (selectedRowKeys != null)
Iterator iter = selectedRowKeys.iterator();
if (iter != null && iter.hasNext())
empTable.setRowKey(iter.next());
model.setRowIndex(empTable.getRowIndex());
Object key = model.getRowKey();
rks.add(key);
empTable.setSelectedRowKeys(rks);
AdfFacesContext.getCurrentInstance().addPartialTarget(empTable);
public void setEmpTable(RichTable empTable) {
this.empTable = empTable;
public RichTable getEmpTable() {
return empTable;
} -
How to get the values from html:select? tag..?
i tried with this, but its not working...
<html:select styleClass="text" name="querydefs" property="shortcut"
onchange="retrieveOptions()" styleId="firstBox" indexed="true">
<html:options collection="advanced.choices" property="shortcut" labelProperty="label" />
</html:select>
<td align="left" class="rowcolor1">
<script language="javascript" type="text/javascript">
function retrieveOptions(){
var sel = document.querydefs.options;
var selectedOption = sel[sel.selectedIndex].value;
document.write(selectedOption);
</script><td align="left" class="rowcolor1">
<script language="javascript" type="text/javascript">
function retrieveOptions(){
var sel = document.querydefs.options;
var selectedOption = sel[sel.selectedIndex].value;
document.write(selectedOption);
</script>This java script is not working at all..its not printing anything in document.write();
This is code..
<td class="rowcolor1" width="20%">
<html:select styleClass="text" name="querydefs" property="shortcut"
onchange="retrieveSecondOptions()" styleId="firstBox"
indexed="true">
<html:options collection="advanced.choices" property="shortcut"
labelProperty="label" />
</html:select>i tried with this also. but no use..i'm not the getting the seleced option...
function retrieveOptions(){
firstBox = document.getElementById('firstBox');
if(firstBox.selectedIndex==0){
return;
selectedOption = firstBox.options[firstBox.selectedIndex].value;
}actually , how to get the values from <html:select> ...?
my idea is to know which value is selected from the combo box(<html:select> ) if that value is equal some string i have enable a hyperlink to open a popup window -
How to get the attribute value of an XML file??
How to get the attribute value of an XML file??
For example, how to get name and age attributes?
<student name="Joe" age="20" />What are you using to read the XML file??
On the assumption of JDOM - www.jdom.org. Something along the lines of:SAXBuilder builder = new SAXBuilder(true);
Document doc = builder.build(filename);
Element root = doc.getRootElement();
List children = root.getChildren();
Element thisElement = (Element)children.get(n);
String name = thisElement.getAttributeValue("name")
try
int age = Integer.parseInt(thisElement.getAttributeValue("age"));
catch (Exception ex)
throw new InvalidElementException("Expected an int.....");
}Ben -
How to get the path when i select a directory or a file in a JTree
How to get the path when i select a directory or a file in a JTree
import java.lang.*;
import java.io.*;
import javax.swing.*;
import javax.swing.tree.*;
import java.awt.HeadlessException;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
import java.util.Iterator;
* @author Frederic FOURGEOT
* @version 1.0
public class JTreeFolder extends JPanel {
protected DefaultMutableTreeNode racine;
JTree tree;
protected JScrollPane scrollpane;
final static int MAX_LEVEL = 1; // niveau max de descente "direct" dans l'arborescence
* Sous-classe FSNode
* @author Frederic FOURGEOT
* @version 1.0
private class FSNode extends DefaultMutableTreeNode {
File file; // contient le fichier li� au noeud
* Constructeur non visible
private FSNode() {
super();
* Constructeur par initialisation
* @param userObject Object
FSNode(Object userObject) {
super(userObject);
* Constructeur par initialisation
* @param userObject Object
* @param newFile File
FSNode(Object userObject, File newFile) {
super(userObject);
file = newFile;
* Definit le fichier lie au noeud
* @param newFile File
public void setFile(File newFile) {
file = newFile;
* Renvoi le fichier lie au noeud
* @return File
public File getFile() {
return file;
public JTree getJTree(){
return tree ;
* Constructeur
* @throws HeadlessException
public JTreeFolder() throws HeadlessException {
File[] drive;
tree = new JTree();
// cr�ation du noeud sup�rieur
racine = new DefaultMutableTreeNode("Poste de travail");
// cr�ation d'un noeud pour chaque lecteur
drive = File.listRoots();
for (int i = 0 ; i < drive.length ; i++) {
FSNode node = new FSNode(drive, drive[i]);
addFolder(drive[i], node); // on descend dans l'arborescence du lecteur jusqu'� MAX_LEVEL
racine.add(node);
// Gestion d'evenement sur JTree (on �coute les evenements TreeExpansion)
tree.addTreeExpansionListener(new TreeExpansionListener() {
public void treeExpanded(TreeExpansionEvent e) {
// lorsqu'un noeud est ouvert
// on descend dans l'arborescence du noeud jusqu'� MAX_LEVEL
TreePath path = e.getPath();
FSNode node = (FSNode)path.getLastPathComponent();
addFolder(node);
((DefaultTreeModel)tree.getModel()).reload(node); // on recharche uniquement le noeud
public void treeCollapsed(TreeExpansionEvent e) {
// lorsqu'un noeud est referm�
//RIEN
// alimentation du JTree
DefaultTreeModel model = new DefaultTreeModel(racine);
tree.setModel(model);
setLayout(null);
// ajout du JTree au formulaire
tree.setBounds(0, 0, 240, 290);
scrollpane = new JScrollPane(tree);
add(scrollpane);
scrollpane.setBounds(0, 0, 240, 290);
* Recuperation des sous-elements d'un repertoire
* @param driveOrDir
* @param node
public void addFolder(File driveOrDir, DefaultMutableTreeNode node) {
setCursor(new Cursor(3)); // WAIT_CURSOR est DEPRECATED
addFolder(driveOrDir, node, 0);
setCursor(new Cursor(0)); // DEFAULT_CURSOR est DEPRECATED
* Recuperation des sous-elements d'un repertoire
* (avec niveau pour r�cursivit� et arr�t sur MAX_LEVEL)
* @param driveOrDir File
* @param node DefaultMutableTreeNode
* @param level int
private void addFolder(File driveOrDir, DefaultMutableTreeNode node, int level) {
File[] fileList;
fileList = driveOrDir.listFiles();
if (fileList != null) {
sortFiles(fileList); // on tri les elements
// on ne cherche pas plus loin que le niveau maximal d�finit
if (level > MAX_LEVEL - 1) {return;}
// pour chaque �l�ment
try {
for (int i = 0; i < fileList.length; i++) {
// en fonction du type d'�l�ment
if (fileList[i].isDirectory()) {
// si c'est un r�pertoire on cr�� un nouveau noeud
FSNode dir = new FSNode(fileList[i].getName(), fileList[i]);
node.add(dir);
// on recherche les �l�ments (r�cursivit�)
addFolder(fileList[i], dir, ++level);
if (fileList[i].isFile()) {
// si c'est un fichier on ajoute l'�l�ment au noeud
node.add(new FSNode(fileList[i].getName(), fileList[i]));
catch (NullPointerException e) {
// rien
* Recuperation des sous-elements d'un noeud
* @param node
public void addFolder(FSNode node) {
setCursor(new Cursor(3)); // WAIT_CURSOR est DEPRECATED
for (int i = 0 ; i < node.getChildCount() ; i++) {
addFolder(((FSNode)node.getChildAt(i)).getFile(), (FSNode)node.getChildAt(i));
setCursor(new Cursor(0)); // DEFAULT_CURSOR est DEPRECATED
* Tri une liste de fichier
* @param listFile
public void sortFiles(File[] listFile) {
triRapide(listFile, 0, listFile.length - 1);
* QuickSort : Partition
* @param listFile
* @param deb
* @param fin
* @return
private int partition(File[] listFile, int deb, int fin) {
int compt = deb;
File pivot = listFile[deb];
int i = deb - 1;
int j = fin + 1;
while (true) {
do {
j--;
} while (listFile[j].getName().compareToIgnoreCase(pivot.getName()) > 0);
do {
i++;
} while (listFile[i].getName().compareToIgnoreCase(pivot.getName()) < 0);
if (i < j) {
echanger(listFile, i, j);
} else {
return j;
* Tri rapide : quick sort
* @param listFile
* @param deb
* @param fin
private void triRapide(File[] listFile, int deb, int fin) {
if (deb < fin) {
int positionPivot = partition(listFile, deb, fin);
triRapide(listFile, deb, positionPivot);
triRapide(listFile, positionPivot + 1, fin);
* QuickSort : echanger
* @param listFile
* @param posa
* @param posb
private void echanger(File[] listFile, int posa, int posb) {
File tmpFile = listFile[posa];
listFile[posa] = listFile[posb];
listFile[posb] = tmpFile; -
How to get the attribute values out?
Hi everyone,
<root>
<category name="Mens Clothing" id="0">
<subcategory>Active/Baselayer Tops</subcategory>
<subcategory>Active/Baselayer
Bottoms</subcategory>
</category>
<category name="Womens Clothing" id="1">
<subcategory>aaa</subcategory>
<subcategory>bbb</subcategory>
</category>
</root>
How to get the attribute values out? For example "Mens
Clothing" and "Womens Clothing".
// the line below returns "Active/Baselayer Tops" and
"Active/Baselayer Bottoms"
var myXml:XML = new XML(event.result);
Thanks,
MayHere is attribute identifier operator from FB Help:
@ attribute identifier Operator
Usage myXML.@attributeName
Identifies attributes of an XML or XMLList object. For
example, myXML.@id identifies attributes named id for the myXML XML
object. You can also use the following syntax to access attributes:
myXML.attribute("id"), myXML["@id"], and myXML.@["id"]. The syntax
myXML.@id is recommended. To return an XMLList object of all
attribute names, use @*. To return an attribute with a name that
matches an ActionScript reserved word, use the attribute() method
instead of the @ operator.
Operands attributeName:* — The name of the attribute.
Example
How to use examples
The first example shows how to use the @ (at sign) operator
to identify an attribute of an element:
var myXML:XML =
<item id = "42">
<catalogName>Presta tube</catalogName>
<price>3.99</price>
</item>;
trace(myXML.@id); // 42The next example returns all attribute
names:
var xml:XML =<example id='123' color='blue'/>
var xml2:XMLList = xml.@*;
trace(xml2 is XMLList); // true
trace(xml2.length()); // 2
for (var i:int = 0; i < xml2.length(); i++)
trace(typeof(xml2
)); // xml
trace(xml2.nodeKind()); // attribute
trace(xml2
.name()); // id and color
} The next example returns an attribute with a name that
matches a reserved word in ActionScript. You cannot use the syntax
xml.@class (since class is a reserved word in ActionScript). You
need to use the syntax xml.attribute("class"):
var xml:XML = <example class='123'/>
trace(xml.attribute("class")); -
I use iPhoto and want to know how to get the 'key photo' i select on my McBook Pro to be the same one that gets used on my iPhone 5s when i sync. i also want the events to appear on the iPhone in the same order i have them on my macbook. any ideas there too?
Killerfinch wrote:
My new yahoo account nestles comfortably in iCloud on the mine iPad.
No, your Yahoo account is not in iCloud (which only handles iCloud mail), it is in Yahoo, and the Yahoo mail account is on your iPad.
But the MacBook Pro will have none of it! I write this question now as I fear that I will be totally demented very soon and unable to formulate my thoughts clearly!
Get the correct settings for your account from Yahoo and set it up manually.
By the way, I also find the "password" issue problematical. It seems Apple want my Apple password rather than my eMail password. All very confusing.
That would depend on what you are trying to do. -
How to get the position of a selected cell in a table ?
Hi,
How can I get the position of a selected cell in a table or in a list multicolumn cmd ?
Thanks.Invoke node >>> point to Row Column
Ben
Message Edited by Ben on 07-19-2007 03:14 PM
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction
Attachments:
Point_To_Row_Column.PNG 22 KB -
How to get the Attributes of the UNIX file Directories ?
Hi Guru,
How to find of the Attributes of the UNIX file Directories in sap TC :- u2018 *ZZWT*u2019 .
The file attribute details need to show in the report.
I try on FM : EPS_GET_FILE_ATTRIBUTES
/SDF/GET_FILE_INFO
But not getting the attributes details.
If any idea plz. Help me.
Regards,
SubashWhich basis release do you use?
From 7.0 you have [GET DATASET|http://help.sap.com/abapdocu_70/en/ABAPGET_DATASET.htm] statement
Before, you may only get what you see in AL11 : mimic what is in program RSWATCH0
Or you may register and use [UNIX commands (SM69 transaction / SXPG|http://help.sap.com/saphelp_nw70/helpdata/en/fa/0971e1543b11d1898e0000e8322d00/frameset.htm]) and get the results
Edited by: Sandra Rossi on Aug 2, 2009 12:39 AM -
How to get the last transaction in a row in SQL Developer?
What syntax would I use to get the last transaction of a row in SQL developer?
The way I have my query set-up currently it is not returning the correct data, here is my current syntax:
select ssn, max(tran_id), chng_type,tran_id
from pda_tran
where ssn = 'xxx-xxx-0011'
and chng_type = 'C'
group by ssn, chng_type,tran_id;
It returns a 'C' chng_type but it is not the last one. when I query on this ssn this is what I get:
ssn tran_id chng_type
xxx-xxx-0011 001 A
xxx-xxx-0011 002 E
xxx-xxx-0011 003 C
xxx-xxx-0011 004 S
xxx-xxx-0011 005 C
xxx-xxx-0011 006 T
I only want to return the ssn's with a last transaction chng_type of 'C'. How can I get the correct information returned. Please advise.From what I see and read... there is one to many group by
You wrote
select ssn, max(tran_id), chng_type,tran_id
from pda_tran
where ssn = 'xxx-xxx-0011'
and chng_type = 'C'
group by ssn, chng_type,tran_id;
If you want the max(tran_id), remove it from the "group by"
select ssn, chng_type, max(tran_id)
FROM
(SELECT 'xxx-xxx-0011' ssn, '001' tran_id, 'A' chng_type FROM DUAL UNION
SELECT 'xxx-xxx-0011' ssn, '002' tran_id, 'E' chng_type FROM DUAL UNION
SELECT 'xxx-xxx-0011' ssn, '003' tran_id, 'C' chng_type FROM DUAL UNION
SELECT 'xxx-xxx-0011' ssn, '004' tran_id, 'S' chng_type FROM DUAL UNION
SELECT 'xxx-xxx-0011' ssn, '005' tran_id, 'C' chng_type FROM DUAL UNION
SELECT 'xxx-xxx-0011' ssn, '006'tran_id, 'T' chng_type FROM DUAL )
where ssn = 'xxx-xxx-0011'
and chng_type = 'C'
group by ssn, chng_type; -
ADF: How to get the attributes' values of one single row from a table?
Currently I have a table with 3 attributes, suppose A,B and C respectively. And I've added an selectionListener to this table. That means when I select one single row of this table, I wish to get the respective value of A, B and C for that particular row. How do I achieve this?
suppose the method is like:
public void selectionRow(SelectionEvent se) { //se is the mouse selection event
.......??? //what should I do to get the values of A\B\C for one single row?
Edited by: user12635428 on Mar 23, 2010 1:40 AMHi
Assuming you are using Jdev 11g.
Try with this
public void selectionRow(SelectionEvent se) {
String val = getManagedBeanValue("bindings.AttributeName.inputValue");
public static Object getManagedBeanValue(String beanName) {
StringBuffer buff = new StringBuffer("#{");
buff.append(beanName);
buff.append("}");
return resolveExpression(buff.toString());
public static Object resolveExpression(String expression) {
FacesContext facesContext = getFacesContext();
Application app = facesContext.getApplication();
ExpressionFactory elFactory = app.getExpressionFactory();
ELContext elContext = facesContext.getELContext();
ValueExpression valueExp =
elFactory.createValueExpression(elContext, expression,
Object.class);
return valueExp.getValue(elContext);
Vikram -
How do I get the values from a selected row.
I am using JDeveloper 9.0.5. On my page, I have placed a button within a table. The button has been assigned an event. The event is within my Action class. This class implements DataAction and has overriden the
processComponentEvents(DataActionContext actionContext);
method.
Question: While I am within the processComponentEvents method, is it possible to obtain the values of selected row?Good Morning Jeffery,
First off thanks for your clear explanation. I have a few related questions as noted from your response:
There are two ways to communicate the desired model row between the UIX view and the struts controller. One way is to use the singleSelection component in your table and put your buttons in the singleSelection's contents.
When the user selects the radio button for a particular row and then clicks on one the buttons, a built in event handler in UIX will set the current row in the model to be the user selected row. Therefore, your Struts action can operate on the currently selected model row.
When you drop a UIX table from the data control palette it is automatically set up in this way (with a single selection).
Ok, Lets say that i've set everything up as you described. Not lets say that the button was pressed and I hit the overriddenprotected void processComponentEvents(DataActionContext actionContext) throws IOException, ServletException ;
When I look at the request object, I do not see the values. How do I get access to the rowkey at this point?
Some people, however, want to actually render buttons in their table rows, and have those buttons initiate an action on their row. If you are doing this, then you need to pass the row id to your struts action as a parameter, which means that you need to know the row id when you are rendering a button for a given row. There is an EL expression that will return the row-id for the current row, it is:
${uix.current.rowKeyStr}
which is not so obvious or well documented in the preview release (sorry) but should be for the production release.
A generic code snippet would go a long way to shedding some light on that. I guess I am use to using JDeveloper 9.0.3. It seems,"to me", that JDev 9.0.5 has put a completely new twist on things. I find myself wondering when I can use the 9.0.3 syntax and when
should not. If your team has any short source toys around which demonstrated using rowkeys, or accessing the internal parts of the
struts controller, I would find that invaluable. It dose not matter if this information is documented.
Thank you -
How to get the folder name of selected subitem in tree structure?
Hi All,
I created a tree structure like below.
->Folder1-- 1
2
3
->Folder2-----1
2
3
i.e i have two folders & each folder having the values like above.Now i want to perform some action by clicking on the any of the values.Suppose if i click value 2,i want to do some action.the actions need to perform is varies from floder to to folder.
So How can i get the folder name of clicked Value?
Regards,
RaviHi Kumar ,
the below code should help you.
Register the below action for the leaf node for which u need the subfolder's name above it.
Worked fine in my system ...hope it does in ur scenario too
method ONACTIONGET_PATH .
data : lr_element TYPE REF TO if_wd_context_element,
lr_node TYPE REF TO if_wd_context_node,
ls_path type string,
ls_path_node TYPE string,
lt_string type TABLE OF string,
l_lines type i,
l_lines_1 TYPE i.
lr_element = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).
**-> getting the path of the node/leaf
*which u had clicked and from that getting the node above it
ls_path = lr_element->get_path( ).
SPLIT ls_path at '.' into table lt_string.
-> remove the first 2 entries as they will contain the view name
DELETE lt_string FROM 1 to 2.
l_lines = LINES( lt_String ).
l_lines_1 = l_lines - 1.
-> remove the last 2 entries as they will contain the element in the path
DELETE lt_string from l_lines_1 to l_lines.
LOOP AT lt_string into ls_path.
CONCATENATE LINES OF LT_STRING into ls_path_node SEPARATED BY '.'.
ENDLOOP.
**-> getting access to the node above the leaf element
LR_NODE = WD_CONTEXT->PATH_GET_NODE( path = ls_path_node ).
lr_element = lr_node->get_element( ).
**-> Getting the name of the folder...
*here path is the attribute in my context which stores the name of the folder
lr_element->get_attribute( EXPORTING name = 'PATH' IMPORTING value = ls_path ).
endmethod. -
How to get the display value of selected item in list box?
I have a page with an HtmlSelectOneListbox that is filled with an ArrayList of SelectItem objects.
The SelectItem objects contain a Key and Value. The Value is displayed in the ListBox.
The value parameter of the listbox is bound to a bean property which is called selectedListItem.
The bean property selectedListItem contains the Key of the SelectItem that is selected.
How do I obtain the Value of the selectedListItem?
I need to be able to get the Value field that is displayed, not just the Key to the item that is displayed.
Edited by: burferd on Nov 3, 2007 10:03 PMHow are you filling in the value of the menu? Obtain it back by the same way. Or pass it along the key in a object.
This article may give useful insights: http://balusc.blogspot.com/2007/09/objects-in-hselectonemenu.html
Maybe you are looking for
-
A fellow editor would like to transfer his project from AVID MEDIA COMPOSER to FCP (Windows to Apple). I have absolutely no experience in this and don't even know where to start or what to ask. Does anyone have any thoughts? Advice? Links? Support? I
-
Forecasting and User Settings For Displaying Historical Values
Hello, I am attempting to perform a forecast model. After entering the selection criteria I get the message "Forecast includes only historical values as from P 01/2011 --> F1" . when I expand on the message I see Forecast includes only historical va
-
How text will be redetermined if the ship to party is changed
Hello, The test is maintaining at ship to party level and if the ship to party is changed how the text will be redetermined here in the order the text is not redetermining. kindly give the solution for redetermination on this. Regards, Kishore.a
-
Errors while using funtion module 'POSTING_INTERFACE_DOCUMENT'
Hi All, I have written a rpogram to simulate transaction 'FB01' using the function module 'POSTING_INTERFACE_DOCUMENT'. It is throwing an error - 'Two accounts were transferred but not BSEG-HKONT' What are the possible causes of this error. Thank you
-
Help interpreting verbose GC output
Below is the output of a verbose GC using concurrent market sweep and parallel new GC's (XX:+UseParNewGC -XX:+UseConcMarkSweepGC) java version "1.4.2_07" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_07-b05) Java HotSpot(TM) Client VM