How to bind dynamic columns in ADF table to view object
In the below piece of code i am trying to bind a dynamically added column to my newly added attribute in view object, but the value expression does not set the value of this attibute in the view object please help on what is wrong in this code ??
<af:table value="#{bindings.ViewObj1.collectionModel}" var="row"
rows="#{bindings.ViewObj1.rangeSize}"
emptyText="#{bindings.ViewObj1.viewable ? 'No rows yet.' : 'Access Denied.'}"
fetchSize="#{bindings.ViewObj1.rangeSize}"
filterModel="#{bindings.ViewObj1Query.queryDescriptor}"
queryListener="#{bindings.ViewObj1Query.processQuery}" varStatus="vs"
selectedRowKeys="#{bindings.ViewObj1.collectionModel.selectedRow}"
rowSelection="single"
binding="#{backingBeanScope.backing_createDTpg1.table1}"
id="table1"
columnSelection="single"
partialTriggers="::addCol ::addColAfter ::addColBefore ::removeCol ::addRow ::addRowAfter ::addRowBefore ::removeRow ::addAction ::addActionAfter ::addActionBefore ::deleteAction :::dialog1 :::d1"
allDetailsEnabled="true" verticalGridVisible="false"
horizontalGridVisible="true" width="100%" disableColumnReordering="true"
selectionListener="#{bindings.ViewObj1.collectionModel.makeCurrent}"
immediate="true" contentDelivery="immediate"
editingMode="clickToEdit" autoHeightRows="-1">
<af:column sortProperty="Sno" filterable="false" sortable="false"
headerText="Sno"
align="center" width="28" rowHeader="true"
inlineStyle="font-style:italic;" frozen="true"
id="sno" selected="true" headerNoWrap="true"
displayIndex="0">
<af:outputText id="ot0" value="#{vs.index+1}"/>
</af:column>
<af:column id="separatorColumn" align="center"
width="15" frozen="true" displayIndex="1"
rowHeader="unstyled" sortable="false"
filterable="false" selected="false"
inlineStyle='background-image:url("jheadstart/images/jsp_forward.png"); background-repeat:no-repeat; outline-color:InactiveCaption; outline-style:solid; outline-width:thin;'
headerText=""/>
</af:table>
DCBindingContainer dcBindings =
(DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding iterBind =
(DCIteratorBinding)dcBindings.get("ViewObj1Iterator");
ViewObject decisionTableView1 = iterBind.getViewObject();
System.out.println("before getAttributeCount :"+decisionTableView1.getAttributeCount());
int counter = decisionTableView1.getAttributeCount() + 1;
AttributeDef attribute =
decisionTableView1.addDynamicAttribute("condition_" + counter);
RichColumn column = new RichColumn();
column.setId("condition_" + counter);
column.setHeaderText("condition_" + counter);
column.setNoWrap(true);
RichInputText inputtext = new RichInputText();
inputtext.setId("condition_"+counter);
inputtext.setAutoSubmit(true);
inputtext.setValueExpression("condition_"+counter,
getValueBinding("#{row.bindings.condition_" +
counter +
".inputValue}"));
column.getChildren().add(inputtext);
RichCommandImageLink headerLink = new RichCommandImageLink();
headerLink.setText("<<Select Fact>>");
headerLink.setId("conditionLink_" + counter);
column.setHeader(headerLink);
List columnList = this.table1.getChildren();
int separatorColumnIndex =
findColumnIndex(columnList, "separatorColumn");
if (columnIndex == -1 || columnIndex > separatorColumnIndex) {
columnIndex = separatorColumnIndex;
System.out.println("Column Index :" + columnIndex);
column.setDisplayIndex(columnIndex);
this.table1.getChildren().add(columnIndex, column);
Sorry Frank i could not figure out what u rtrying to say.
In my case i have ADF table with two predefined coulmns :
1 : a serial number read only column
2 : a separator coumn
I need help to bind the newly created dynamic attribute in the VO with my newly created column in the ADF table which has a input text as child.
My problem is binding the is not working properly as values entered in the Table are not reflected in the VO.
And when i insert a new column in between two columns which has already filled values the data in the rows does not shift coreespondingly..
Edited by: user10281080 on Jul 27, 2009 12:22 AM
Similar Messages
-
HOW to add Dynamic Columns in ADF Faces CORE Table
In ADF im going to display the dynamic column in Coretable,
Header are displaying very fine. but im unable to display rows sucessfuly,how to resolve.
Second thing is that JSF page isn't getting the value from dataList, whats wrong in JSF code.
// JSF PAGE CODE
<af:table binding="#{backing_test1.table1}" id="table1"
value="{backing_test1.dataList}" var="myRec"/>
public void setTable1(CoreTable table1) {
this.table1 = table1;
public CoreTable getTable1() {
//create this table
table1 = new CoreTable();
CoreColumn dynamicCol;
CoreOutputText outText;
Application app=FacesContext.getCurrentInstance().getApplication();
DCIteratorBinding iter = (DCIteratorBinding)bindings.get("listAllMonthsIter");
RowSetIterator rsIter = iter.getRowSetIterator();
rsIter.reset();
Row row;
while (rsIter.hasNext()) {
row = rsIter.next();
String header = (String)row.getAttribute("element");
// element contain the value JAN, FEB...
dynamicCol = new CoreColumn();
dynamicCol.setHeaderText(header);
String currRec = table1.getVar();
outText = new CoreOutputText();
ValueBinding vb = app.createValueBinding("#{myRec.value}");
outText.setValueBinding("value",vb);
outText.setRendererType("Text");
dynamicCol.getChildren().add(outText);
table1.getChildren().add(dynamicCol);
public void setDataList(List dataList) {
this.dataList = dataList;
public List getDataList() {
BindingContainer bindings = getBindings();
OperationBinding operationBinding =
bindings.getOperationBinding("listAllMonths");
if (operationBinding == null)
return null;
List dataList = (Vector)operationBinding.execute();
return dataList;
}Well issue is that
I have a list of values that can be chnaged any time during application execution sya its list of Fav Fruits..
and in an other page i need a data table having these fruits as coulmns and their details as rows...
how to achieve this..
we can not guess the number of columns before time.. so can make the estimate and hide them. -
Dynamic columns in ADF Table don't work as they do in dataTable
Hello!
I've tried the sample from http://forum.java.sun.com/thread.jspa?forumID=427&threadID=560252 and all is working perfectly fine.
Since my company has decided to go with ADF I've tried to port this sample to ADF. However I am experiencing one major problem. The dynamically created columns all have the same ID in different rows. That's why only the last row displays the correct values. Has anyone tried to port the sample from the JSF Forum to the ADF Table and succeeded? Is there a way to manipulate the IDs manually and if so, where do we do it?
Any help would be greatly appreciated.The Develop the JSF/Tiles Application section explains the procedure to dynamically bind column values to a JSF data table. ADF JSF table column binding is similar to the JSF datatable.
http://www.oracle.com/technology/pub/articles/vohra_tiles.html -
How to bind dynamic checkbox to a table
Hi,
I have a table that holds many fields. I put these fields on the screen dynamically.
I would like to bind a checkbox to select a field row.
I tried to bind the checkbox to the table but with no success. I keep getting the binding to the first element.
Does anyone has an example?
Thanks,
ItayHi P,
here is my code:
LOOP AT lt_available_items ASSIGNING <item>.
ADD 1 TO lv_col.
IF lv_col > lv_cell_per_col.
lv_col = 1.
ADD 1 TO lv_row.
lv_new_line = 'X'.
ENDIF.
* Add dynamic group
CONCATENATE 'GROUP_' lv_col '_' lv_row INTO lv_str.
lr_new_group = cl_wd_group=>new_group( id = lv_str view = view design = '02' ).
IF lv_new_line = 'X'.
CLEAR lv_new_line.
cl_wd_matrix_head_data=>new_matrix_head_data( element = lr_new_group ).
ELSE.
cl_wd_matrix_data=>new_matrix_data( element = lr_new_group ).
ENDIF.
lr_new_group->set_width( '230' ).
cl_wd_matrix_layout=>new_matrix_layout( container = lr_new_group ).
lr_group->add_child( lr_new_group ).
* Left side container
CONCATENATE 'CONT_L_' lv_col '_' lv_row INTO lv_str.
lr_new_container = cl_wd_transparent_container=>new_transparent_container(
id = lv_str view = view ).
cl_wd_matrix_head_data=>new_matrix_head_data( element = lr_new_container ).
cl_wd_matrix_layout=>new_matrix_layout( container = lr_new_container ).
lr_new_group->add_child( lr_new_container ).
* Add checkbox
CONCATENATE 'CHK_' lv_col '_' lv_row INTO lv_str.
lr_checkbox = cl_wd_checkbox=>new_checkbox( view = view
id = lv_str ).
lr_matrix_head = cl_wd_matrix_head_data=>new_matrix_head_data( element = lr_checkbox ).
lr_checkbox->set_layout_data( lr_matrix_head ).
lr_checkbox->bind_checked( 'AVAILBLE_ITEMS.SELECTED' ).
lr_new_container->add_child( lr_checkbox ).
endloop.
my node is AVAILABLE_ITEMS and it has the attributes: SELECTED, MATNR, MAKTX...
thanks,
Itay -
How to bind a user selected value to a view object bind variable?
Hi
I have two pages in ADF BC application. In the first page ,i will give a drop down menu to user which displays all the table names in my databse.
when the user selects a table and goes to the second page..he should be given a menu or a check list of all the columns in the user selected table....
to display the columns i have used the query
Select COLUMN_NAME from user_tab_columns where table_name = : table_name in the view object.
now how to bind the user selected table value in the first page to the table_name bind variable in view object ?
thanks
swathi.Hi,
depends on how the select box is implemented. With ADF and ADF Faces, the default value selection is the list index. In a value change listener you could look up the selected value from the underlying iterator. Store this value e.g. in a session attribute and point the NDValue of the ExecuteWithParams operation to #{sessionScope.your_attribute}
Frank -
Problem in using MultiSelect ADF table with view Object
I have a requirement of displaying a table with multi select option. On page load table will be displayed with all columns as output text except last column as input text. User can update the last column of the selected row and only checked rows should get updated in the DB Table.
Is there any document or Tutorial available?Hi,
this is an individual implementation. Tutorials are written for common usecases. However, the way to implement this is to set the read-only property on the last column's text field (turn it into a textinput field) based on whether or not the row is selected. Make sure that the row selection PPRs the table
for a code example download
http://thepeninsulasedge.com/frank_nimphius/wp-content/uploads/2008/05/OldAndLostBlogBusterTips.zip
and look at page 272 "ADF Faces: Conditional table row manipulation on table row select"
Frank -
How to use C:when test... inside column in ADF table
I am using ADF table with below two columns
in First column i have to check the Type of document if it is doc type then i have to use commondlink to download that file ,Otherwise i need to show only text.
for that i added
*<c:when test="{boolean($favoriteType eq 'doc')}">*
which is not working .
please let me know how to use <C:when test... inside column in ADF table
<tr:column sortProperty="favoriteName" sortable="true"
headerText="#{res['favorite.favoritename']}"
width="500" noWrap="false">
<c:choose>
*<c:when test="{boolean($favoriteType eq 'doc')}">*
<tr:commandLink actionListener="#{bindings.downloadFile.execute}"
text="#{row.favoriteName}"
disabled="#{!bindings.downloadFile.enabled}"/>
</c:when>
<c:otherwise>
<af:outputText value="#{row.favoriteName}"/>
</c:otherwise>
</c:choose>
</tr:column>
<tr:column sortProperty="favoriteType" sortable="true"
headerText="#{res['favorite.favoriteType']}" rendered="true">
<af:outputText value="#{row.favoriteType}" id="favoriteType"/>
</tr:column>Hi Frank,
Thanks it is working like cham..
related to same page i am facing new problem which i posted at below thread
How to get row data runtime @ trinidad table , set rowSelection="multiple"
can u reply on same.
Thanks for all help.
Jaydeep -
How to display dynamic column added by vo.addDynamicAttribute in jspx?
Hi,
I met problem when programmatically add cloumn and display it on screen. Here are my steps:
0. define a ViewObject using xml. Define a transient column Addtion2. later will add a dynamic column Addtion3, but not defined here.
1. Implement Application Module, adding a method init() and expose it to client.
2. In init() method, get target VO and use vo.addDynamicAttribute("Addition3"). Then iterate it use row.setAttribute("Addition3", Math.random()). Add init() to page binding and invoke it.( it's invoked )
3. In jspx, use dynamic table. But Addition3 never shows up.
This is my last question: Re: How to display dynamic column added by vo.addDynamicAttribute in jspx? People say I should use dynamic table.
please have a look at my code:
Application Module: when it runs, it will print 6 coulmns. vo.getAttributeCount() is <font color="red">6</font>.
<pre>
public void init() {
ViewObject vo = this.getCountryView1();
if (vo.getAttributeIndexOf("Addition3") == -1) {
vo.addDynamicAttribute("Addition3");
vo.executeQuery();
for (AttributeDef deft : vo.getAttributeDefs()) {
System.out.println(deft.getColumnName() + ": " + deft.getName());
RowSetIterator it = vo.createRowSetIterator("i1");
while (it.hasNext()) {
Row r = it.next();
r.setAttribute("Addition2", Math.random());
r.setAttribute("Addition3", Math.random());
it.closeRowSetIterator();
for (AttributeDef deft : vo.getAttributeDefs()) {
System.out.println(deft.getColumnName() + ": " + deft.getName());
System.out.println(vo.getAttributeCount()); //vo.getAttributeCount() is 6
</pre>
jspx: when it runs, only 5 columns are shown. Column Addition2's values are set as expected. but Column Addition3 never shows up. And #{bindings.CountryView1.attributeCount} shows <font color="red">5</font>.
<pre>
<af:table rows="#{bindings.CountryView1.rangeSize}"
fetchSize="#{bindings.CountryView1.rangeSize}"
emptyText="#{bindings.CountryView1.viewable ? 'No data to display.' : 'Access Denied.'}"
var="row" rowBandingInterval="0"
value="#{bindings.CountryView1.collectionModel}"
selectedRowKeys="#{bindings.CountryView1.collectionModel.selectedRow}"
selectionListener="#{bindings.CountryView1.collectionModel.makeCurrent}"
rowSelection="single" id="t1">
<af:forEach items="#{bindings.CountryView1.attributeDefs}" var="def">
<af:column headerText="#{def.name}"
sortable="true" sortProperty="#{def.name}" id="c1">
<af:outputText value="#{row[def.name]}" id="ot1"/>
</af:column>
</af:forEach>
</af:table>
<af:forEach items="#{bindings.CountryView1.attributeDefs}" var="def">
<af:outputText value="#{def.name}" id="ot2"/>
</af:forEach>
<af:outputText value="#{bindings.CountryView1.attributeCount}" id="ot3"/>
</pre>
it's quite weird for me. The vo.getAttributeCount() is 6, but #{bindings.CountryView1.attributeCount} shows 5. And column Addtion3 never shows up.
what's the matter? How can I show the dynamic added column Addtion3?
Edited by: simon li on 2012-9-10 下午7:31
Edited by: simon li on 2012-9-10 下午8:00Hi,
Can you check the tree binding (CountryView1 - in the pagedef) and see it has the 5 attributes hardcoded in it. If yes, try removing everything and then run the page to see if it works fine.
-Arun -
How to delete a column from the table control in module pool?
Hi,
can any one please tell How to delete a column from the table control in module pool?
thanks in advance
warm regards
HareeshKumar Nhi hareesh,
I think it is better to hide it.
How to hide: You can check this link
Dynamic Hide column in table control -
How to insert static data into ADF Table
Hi
I have a requirement , As a part of development of my prototype. I have to populate some static data into table.How to achieve this without using any java is there any way to simply hard code the values into adf table rows.?
Thanks in advancehttp://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/devguide/table.html
http://otndnld.oracle.co.jp/document/products/as10g/101300/B25221_03/web.1013/b25386/web_MasterDetail006.htm
http://andrejusb.blogspot.com/2006/12/displaying-all-columns-in-adf-table.html -
How to sum the column in a table seperated by sign.
How to sum the column in a table separate by sign.
For Example:
A B
10 MOHAN
-15 KUMAR
-25 MARCH
50 MAYSELECT SUM(CASE SIGN(A) WHEN 1 THEN A ELSE NULL END) SUM_POSTIIVE,
SUM(CASE SIGN(A) WHEN -1 THEN A ELSE NULL END) SUM_NEGATIIVE
FROM tbl
/SY. -
How to Delete a Column in Internal Table
Hi All,
Does any one know ,How to Delete a Column in Internal Table?Hi,
For deleting the column in the internal table, you have to eliminate the field which you want to delete.
loop at itab into wa.
move corresponding wa to wa1.
append wa1 to itab1.
clear wa1.
clear wa.
endloop.
wa1 is the workarea without the field which you want to delete.
itab1 is the internal table which consists of the deleted column. -
How to bind JtextFields in Swing to Table fields in the database
Can some one give the code of how to bind JtextFields in Swing to Table fields in the database
Am really new to java programming and have interest in learningThe standard JDK doesn't do this for you. If you search on Google, you may find some 3rd party packages that will do this.
You need to create your own form add execute the appropriate SQL yourself. Read the tutorial on [url http://java.sun.com/docs/books/tutorial/]JDBC Database Access to get started. -
How to find the column name and table name with a value
Hi All
How to find the column name and table name with "Value".
For Example i have value named "Srikkanth" This value will be stored in one table and in one column i we dont know the table how to find the table name and column name
Any help is highly appricatable
Thanks & Regards
Srikkanth.M2 solutions by Michaels (the latter is 11g upwards only)...
michaels> var val varchar2(5)
michaels> exec :val := 'as'
PL/SQL procedure successfully completed.
michaels> select distinct substr (:val, 1, 11) "Searchword",
substr (table_name, 1, 14) "Table",
substr (t.column_value.getstringval (), 1, 50) "Column/Value"
from cols,
table
(xmlsequence
(dbms_xmlgen.getxmltype ('select ' || column_name
|| ' from ' || table_name
|| ' where upper('
|| column_name
|| ') like upper(''%' || :val
|| '%'')'
).extract ('ROWSET/ROW/*')
) t
-- where table_name in ('EMPLOYEES', 'JOB_HISTORY', 'DEPARTMENTS')
order by "Table"or
SQL> select table_name,
column_name,
:search_string search_string,
result
from cols,
xmltable(('ora:view("'||table_name||'")/ROW/'||column_name||'[ora:contains(text(),"%'|| :search_string || '%") > 0]')
columns result varchar2(10) path '.'
where table_name in ('EMP', 'DEPT')
TABLE_NAME COLUMN_NAME SEARCH_STRING RESULT
DEPT DNAME ES RESEARCH
DEPT DNAME ES SALES
EMP ENAME ES JONES
EMP ENAME ES JAMES
EMP JOB ES SALESMAN
EMP JOB ES SALESMAN
EMP JOB ES SALESMAN
EMP JOB ES PRESIDENT
EMP JOB ES SALESMAN
9 rows selected. -
How can I select columns from a table EMP, using Select statement?.
Hi Friends,
How can I select columns from a table EMP?.
I want to select columns of EMP table, using select statement.
Please reply me urgently.
ShahzadSomething like this:
scott@DBA> select empno,ename,job from emp;
EMPNO ENAME JOB
7369 SMITH CLERK
7499 ALLEN SALESMAN
7521 WARD SALESMAN
7566 JONES MANAGER
7654 MARTIN SALESMAN
7698 BLAKE MANAGER
7782 CLARK MANAGER
7788 SCOTT ANALYST
7839 KING PRESIDENT
7844 TURNER SALESMAN
7876 ADAMS CLERK
7900 JAMES CLERK
7902 FORD ANALYST
7934 MILLER CLERK
14 rows selected.Check the documentation:
http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_10002.htm#sthref9697
Message was edited by:
Delfino Nunez
Maybe you are looking for
-
Using the Remote App and playing iTunes from a shared Library
I have a playlist set up in my main iTunes library on my iMac. This is a shared library on my local network at home. I can access and play the library remotely from my MacBook. I want to move my MacBook outside with external speakers for a party.
-
How to run Servlet in Tomcat 5.5.7 Server
Hi, How to run Servlet in Tomcat 5.5.7 Server. I mean where I should copy my *.class file. Thanks in Advance. bbye.
-
Seems it's finally released. Happy coding!
-
The burn tool is acting as a brush and leaving a series of circles any idea how to return it to normal please ?
-
IOS 8/iphone 6 photo auto - orientation
I was taking some pictures with my iPhone 6 and realize a lot of times the pictures coming out with the wrong orientation. some of the horizontal shots came out to be vertical. Anyone has the same issue? is this a bug or hardware issue? Thanks.