How to get selected row from a non-bind ADF table
Hi,
I have an ADF table that is based on a collectionModel built programmatically. The collectionModel is this:
model = new SortableModel(new ArrayList<ArrayList>());
Hence, it is not a binding table. My question is how to get the selectedRows from a non-bind table.
I am used to building binding ADF table and I know we can get it from voiterator.getCurrentRow, since the selectionListener is set to the binding....collectionModel.makeCurrent
<af:table value="#{bindings.ItasLookupTypesVO1.collectionModel}"
selectedRowKeys="#{bindings.ItasLookupTypesVO1.collectionModel.selectedRow}"
selectionListener="#{bindings.ItasLookupTypesVO1.collectionModel.makeCurrent}"
</af:table>
I am thinking maybe I need to write my own selectionListener, but need more advice/ideas of what's the codes in the customer selection Listener to get it from my SortableModel.
Please help.
Thanks
-Mina
I'm not sure if this works in your case, but check out the selection listener I write in this blog http://wp.me/pcBZk-eu
You should use the selection event and check the added set. This should give you access to the selected row.
Timo
Similar Messages
-
How to get selected row from table(FacesCtrlHierBinding ).
I'am trying to get selected row data from table:
FacesCtrlHierBinding rowBinding = (FacesCtrlHierBinding) tab.getSelectedRow();
Row rw = rowBinding.getRow();
But import for oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding cannot be found from my JDev 11.
What is correct package for FacesCtrlHierBinding?Hi, another problem.
I fill table with data manualy from source:
<af:table var="row" value="#{getCompanyData.com}"
rowSelection="single" columnSelection="single"
editingMode="clickToEdit"
binding="#{getCompanyData.tab}"
selectionListener="#{getCompanyData.GetSelectedCompany}">
<af:column sortable="false" headerText="col1">
<af:outputText value="#{row.id}"/>
</af:column>
<af:column sortable="false" headerText="col2">
<af:outputText value="#{row.name}"/>
</af:column>
<af:column sortable="false" headerText="col3">
<af:outputText value="#{row.phone}"/>
</af:column>
</af:table>
and when I'am trying to use method to get selected row:
RichTable table = this.getTab(); //get table bound to UI Table
RowKeySet rowKeys = table.getSelectedRowKeys();
Iterator selection = table.getSelectedRowKeys().iterator();
while (selection.hasNext())
Object key = selection.next();
table.setRowKey(key);
Object selCompany = table.getRowData();
JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding) selCompany;
row = rowData.getRow();
I got an error:
SEVERE: Server Exception during PPR, #1
javax.el.ELException: java.lang.ClassCastException: data.COMPANY cannot be cast to oracle.jbo.uicli.binding.JUCtrlHierNodeBinding
When I created tables by dragging data from date control, all worked fine.
What could be a problem? -
How to get selected row keys from RichSelectManyCheckbox
Adf Table has getSelectedRowKeys but SelectManyChekcbox does not has anything similar. Can you tell me how to get selected row keys programmatically for RichSelectManyCheckbox?
Hi User,
selectManyCheckbox component's value property holds the selected items values. Bind this property to some bean variable(of type list) so that you can get the selected values by accessing the bean property.
Sireesha -
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 selected row index of a Table ?
hi gurus,I'm new to Webdynpro for abap
I'm displaying just Flight details in a Table so
how to get selected row index of a Table and need to be display in Message manager.Hi,
For getting the row index use the following code.
DATA lo_nd_node TYPE REF TO if_wd_context_node.
DATA lo_el_node TYPE REF TO if_wd_context_element.
DATA index TYPE i.
* navigate from <CONTEXT> to <NODE> via lead selection
lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_node ).
lo_el_node = lo_nd_node->get_lead_selection( ).
index = lo_el_node->get_index( ).
node is the name of the node which is binded to the table.
For printing the message u can use code wizard.
Press ctrl-F7. Now Select generate message.
IN this select the method REPORT_SUCCESS
In the code now u can give index to Message text Exporting parameter. Comment receiving parameter.
Write the whole code in onLeadSelect of the table.
Regards,
Pankaj Aggarwal -
How to get selected value from OADefaultListBean.
Hi All,
How to get selected value from OADefaultListBean ?
Thanks,Hi,
To identify the user's selection(s) when the page is submitted, you would add the following logic to your processFormRequest() method:
OADefaultListBean list =
(OADefaultListBean)webBean.findChildRecursive("positionsList");
String name = list.getName();
String[] selectedValues = pageContext.getParameterValues(name);
To retrieve all the values in the list box, call list.getOptionsData().
--Prasanna -
How to get selected items from a tree in backing bean without adfbc
Hi ADF Experts,
Below is my code for af:tree. My question is how can I get selected Items from the selectionListener (without adf bc) this uses formation of tree from backing bean.
Using Jdev 11.1.1.7.0
<af:tree var="node" value="#{pageFlowScope.MerchandizeBean.model}"
binding="#{pageFlowScope.MerchandizeBean.treeModel}" id="tree" immediate="true" autoHeightRows="0"
styleClass="AFStretchWidth" rowSelection="multiple"
selectionListener="#{pageFlowScope.MerchandizeBean.treeNodeSelection}">
<f:facet name="nodeStamp">
<af:commandLink text="#{node.classDescription}"
actionListener="#{pageFlowScope.MerchandizeBean.createListManyItemForMerchandise}" id="displayTable" partialSubmit="true">
</af:commandLink>
</f:facet>
</af:tree>
public void treeNodeSelection(SelectionEvent selectionEvent) {
// Add event code here...
RichTree tree = (RichTree)selectionEvent.getSource();
TreeModel model = (TreeModel)tree.getValue();
//get selected value
Thanks
RoyHi,
in a multi select case, try
RowKeySet rks = tree.getSelectedRowKeys();
Iterator iter = rks.iterator();
while(iterator.hasNext()){
Object aKey = iterator.next();
tree. setRowKey(aKey);
Object rowData ? tree.getRowData();
.... do something with the data here ...
Frank -
How to get the data from multiple nodes to one table
Hi All,
How to get the data from multiple nodes to one table.examples nodes are like A B C D E relation also maintained
Regards,
IndraHI Indra,
From Node A, get the values of the attributes as
lo_NodeA->GET_STATIC_ATTRIBUTES( IMPORTING STATIC_ATTRIBUTES = ls_attributesA ).
Similarily get all the node values from B, C, D and E.
Finally append all your ls records to the table.
Hope you are clear.
BR,
RAM. -
How to get the data from pcl2 cluster for TCRT table.
Hi frndz,
How to get the data from pcl2 cluster for tcrt table for us payroll.
Thanks in advance.
Harisumanth.ChPL take a look at the sample Program EXAMPLE_PNP_GET_PAYROLL in your system. There are numerous other ways to read payroll results.. Pl use the search forum option & you sure will get a lot of hits..
~Suresh -
How to eliminate select message after Radio button in ADF tables
how to eliminate select message after Radio button in ADF tables
example <f:facet name="selection">
<af:tableSelectOne>
</af:tableSelectOne>
</f:facet>
output:
radobutton select
radiobutton select
please help me regarding this issue.Hi,
this usually has a text String in the header saying "Select and .." which can be changed through the property inspector for the TableSelectOne component
Frank -
How to get selected values from tableSelectMany
Hi all,
I have a view object which displays all column names of a table. I created a tableselectmany table with the view object.
the user has to select some rows (for mining function).
how to get the selected rows from tableselectmany table?
what should be in 'action' and 'actionlistener' ?
thanks in advance.test(Set<Key> empKeys){
System.out.println("Inside function");
for(Key keys:empKeys){
Row[] row = getCollectionsView1().findByKey(keys,1);
EewCollectionsViewRowImpl vo = (CollectionsViewRowImpl)row[0];
In the action just call this method(test)
and pass the argument as #{applicationScope.managedBean.firstProperty.selectionState.keySet}
I hope this works for you. -
How to get selected Row Index in a table based ona VO?
Hi All,
I'm writing an ADF form wherein I use a VO based on a SQL query. I'd like to know how to get the index of a selected row. I havea selection Listener in place where I can print the selected Row's data using getSelectedRowData().toString() on the table.
How can I get certain Attributes from this selected row.
One solution I thought of is to get the row index and then read attributes. But I cant seem to figure out how to get rowIndex for a selected row. Any sugestions?
Using JDeveloper 11g.
Thanks
P.If your selected row is marked as current row you can use
// Get a attribute value of the current row of iterator
DCIteratorBinding iterBind= (DCIteratorBinding)dcBindings.get("testIterator");
String attribute = (String)iterBind.getCurrentRow().getAttribute("field1");Where 'testIterator' is the name of the iterator you use for the table and 'field1' is the name of an attribute you want to get.
Or you can iterate over the selected row keys (even if it's only one):
// get selected Rows of a table 2
for (Object facesRowKey : table.getSelectedRowKeys()) {
table.setRowKey(facesRowKey);
Object o = table.getRowData();
JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding)o;
Row row = rowData.getRow();
TestRow testRow = (TestRow)((DCDataRow)row).getDataProvider() ;
}Where TestRow is the row type of the VO of your table.
Timo -
How to get selected values from selectManyCheckbox ?
Hi,
I am a SOA developer and using 'Auto generated adf form' of Human Task. I did some customization in the form. I need to show one dynamic list (contains multiple string values) on a form, from which user will select desired values. For this I have used <af:selectManyCheckbox> adf component.
It has generated code as follows...
<af:selectManyCheckbox value="#{bindings.Response.inputValue}"
label="#{bindings.Response.label}"
id="smc1">
<f:selectItems value="#{bindings.Response.items}" id="si9"/>
</af:selectManyCheckbox>
I am able to show list on a form and can select multiple values also.
Now, I want the multiple selected values back in my BPEL process. I need only those values which are selected by user.
Currently I am getting complete list as it is back in BPEL process.
Please help me out..!
Thanks..
SurajUnwinding ADF: How to retrieve Selected Items from selectManyCheckbox using ValueChnageListener
-
How to get selected value from SelectOneChoice
Hi,
I'm facing a problem to get selected value from SelectOneChoice. I have valueChangeListener event on a (SelectOneChoice)item. After user makes a choice I want to store selected value in a bean property to pass it to a method.
For example List item shows dname from dept table after user makes a choice I want to get deptno and populate into bean which I use to pass into my method.
If I use valueChangeEvent.getNewValue() I always get negative value instead I want deptno selected. Sample code pasted below.
public void setDeptno(ValueChangeEvent valueChangeEvent) {
BindingContainer b = getBindings();
OperationBinding oB = b.getOperationBinding("setDeptno");
//Checking instance of because same method is called from another text inputText item.
if (valueChangeEvent.getSource() instanceof CoreSelectOneChoice){
CoreSelectOneChoice cN = (CoreSelectOneChoice)valueChangeEvent.getSource();
if (columnName.getId().toString().equals("deptDname")){
JSFUtils.setManagedBeanValue("dept.deptDeptno",valueChangeEvent.getNewValue());
}if your selectOneChoice has value equal to #{bindings.deptno} bound to the iterator Dept1Iterator,
then the backing code will look more like
public void setDeptno(ValueChangeEvent valueChangeEvent) {
BindingContainer b = getBindings();
OperationBinding oB = b.getOperationBinding("setDeptno");
//Checking instance of because same method is called from another text inputText item.
if (valueChangeEvent.getSource() instanceof CoreSelectOneChoice){
CoreSelectOneChoice cN = (CoreSelectOneChoice)valueChangeEvent.getSource();
if (columnName.getId().toString().equals("deptDname")){
FacesContext ctx = FacesContext.getCurrentInstance();
Application app = ctx.getApplication();
ValueBinding bind = app.createValueBinding("#{bindings.Dept1Iterator.currentRow}");
Row row = (Row)bind.getValue(ctx);
JSFUtils.setManagedBeanValue("dept.deptDeptno", row.getAttribute("deptno"));
} I haven't tested it, so it could perfectly not work at all -
Dvt:pivotFilterBar - how to get selected values from filter
Hi all,
I have a question: how to programmatically get selected values from pivot table's filter bar?
I have tried to use
pivotTable.getDataModel().getDataAccess().getValueQDR(startRow, startCol, DataAccess.QDR_WITH_PAGE);but for page edge dimensions it returns BAD DATA, it seems that it returns some cached values.
Environment: JDev 11.1.1.3.0 without any patches.
thanks,
MiroslawHi,
You can retrieve the selected value in the PivotFilterBar through the model of PivotFilterBar, instead of dataaccess:
// get the model from the pivot filter bar instance
QueryDescriptior queryDescriptor = (QueryDescriptor)pivotFilterBar.getValue();
// retrieve a list of criterion, each one is used to populate each lov within the pivot filter bar
ConjunctionCriterion conjunctionCriterion = queryDescriptor.getConjunctionCriterion();
List<Criterion> criterionList = conjunctionCriterion.getCriterionList();
for (int i=0; i<_criterionList.size(); i++) {
AttributeCriterion criterion = (AttributeCriterion)criterionList.get(i);
// _selected is the currently selected value
Object selected = criterion.getValues().get(0);
System.out.println(_selected);
Hope that helps,
Chadwick
Maybe you are looking for
-
Changing the Header in a Hybrid Web Container app on BlackBerry
Hello Experts! I am trying to add a custom header to Hybrid Web Container Apps on SUP 2.0. It would be nice to add branding or additional text - even the ability to center the text would be nice. I have tried various jQuery approaches and can see t
-
How do I add more pages in one document?
Hi everyone. In the past I've downloaded a PDF file containing several pages of sheet music. How do I produce a PDF file with several pages in it? I'm only able to convert a BMP file to a PDF file with just one page. How do I include more than one pa
-
Well I bought an album in the Mexican iTunes store and when I try to play the song it says I need to allow because I apparently have 5 devices in use when I just have 1 and this just happens with 2 of the songs of the album... what should I do to get
-
Filling out Website Parameters
Hello, I had a simple question regarding the connecting to a normal html website using a program written in java. The website I am trying to connect to has two text fields that prompt your username and password, as well as a submit button. <input nam
-
VMWare size increase, Vertex/SAP implications
Hello, We are upgrading our physical hardware to increase our disk size in our VMWare servers. Vertex resides on this server we RFC for the tax. Are there any jobs that I should make sure that are not running? I have told everyone to be out of the