Is it possible to programaticaly change active row in ADF table?
JDev 11.
I have a table which is filled with data programaticaly.
When I add new row, it appears in table and I want to make this row active automatically, so last insert row should become active.
Is it possible?
Hi Julian, thanks for your response, but your example is different from my case
My source:
public String SaveCompany() {
// get company details from input fields
GetCompanyDetails();
// save changes to DB
SaveCompanyToDB(com);
//refresh company list
AdfFacesContext.getCurrentInstance().addPartialTarget(table);
return null;
I'am adding new entry into DB and I want to populate table after that action, and automatically select that new row (new row should become lighted).
I have found that there is a atribute First(), I have tried to use it, but it didnt help.
So question is, does ADF table have atribute to define active table row from code?
Similar Messages
-
I'm trying to add a new row to ADF table. Here are my steps:
1. Create new entities from tables (New -> EJB -> Entities from Tables)
2. Create Session Bean (New -> EJB -> Session Bean) with all requested methods for earlier created entity
3. Create Data Control out of it (right click on session bean -> Create Data Control) - it creates "testFindAll"
4. After these steps, I drag&drop my "testFindAll" from data controls to form and create table
5. Now, I drag&drop operation Create from my "testFindAll -> Operations", create button and change action from Create to CreateInsert
And now, the troubles : ((.. When I click button to add new row I get null pointer exception. Here is part of trace:
java.lang.NullPointerException
at oracle.adf.model.adapter.bean.UpdatableBeanDataControl.createRowData(UpdatableBeanDataControl.java:137)
at oracle.adf.model.bean.DCBeanDataControl.createRowData(DCBeanDataControl.java:642)
at oracle.adf.model.bean.DCDataVO.doCreateData(DCDataVO.java:870)
at oracle.adf.model.bean.DCDataRow.create(DCDataRow.java:306)
at oracle.jbo.server.ViewRowImpl.callCreate(ViewRowImpl.java:432)
at oracle.jbo.server.ViewObjectImpl.createInstance(ViewObjectImpl.java:4679)
at oracle.adf.model.bean.DCDataVO.createInstance(DCDataVO.java:567)
at oracle.jbo.server.QueryCollection.createRowWithEntities(QueryCollection.java:1818)
at oracle.jbo.server.ViewRowSetImpl.createRowWithEntities(ViewRowSetImpl.java:2211)
at oracle.jbo.server.ViewRowSetImpl.doCreateAndInitRow(ViewRowSetImpl.java:2257)
at oracle.jbo.server.ViewRowSetImpl.createRow(ViewRowSetImpl.java:2233)
at oracle.jbo.server.ViewObjectImpl.createRow(ViewObjectImpl.java:9404)
at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1223)
at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2120)
at oracle.adf.model.bean.DCBeanDataControl.invokeOperation(DCBeanDataControl.java:464)
at oracle.adf.model.adapter.AdapterDCService.invokeOperation(AdapterDCService.java:307)
at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:693)
at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.executeEvent(PageLifecycleImpl.java:394)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding._execute(FacesCtrlActionBinding.java:217)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding.execute(FacesCtrlActionBinding.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
I know that I it possible to do this if you create ViewObject instead of Entities from Tables and SessionBean. But I need this approach.
Thanks a lot!Hi Goran,
What is your JDev version? Are you trying with EJB 3.0 or 2.1? I just tried (with 3.0) and it is working fine (tested in JDev 11.1.1.2.0).
Here is my pagedef
<action IterBinding="deptFindAllIterator" id="Create"
RequiresUpdateModel="true" Action="createRow"/>Infact, i don't have to change the Create action to CreateInsert. By default it was CreateInsert only.
-Arun -
How to set a row as default row in adf table
Hi,
I have a requirement: when page is launched there are multiple records with different status displayed on the page and i had to make the first record with Status = XXX as default selected row in adf table. How to code it?
Thanks!
SusanHi Frank,
Thanks a lot for your quick response!
We are using Jdev 11g. After received your response, i went through all of your responses in ADF coner and OTN for the related topics (setting detail row) and got some ideas(Specially, i got your detail coding for moving makeCurrent expression into selection listener method into backing bean, etc ) and was ready for coding this function. But our PM changed their mind and we dont need this function. So, I had to move to another area......
Your articles and your responses really help me!
Thanks again for your help!
Susan -
Focusing a field/column in the new row of adf table
Hi all,
I am using JDeveloper 11.1.2.4.0. and UI-Shell Template in Main application and sub applications are added to this master application as ADF library jar files. Application is working fine.
I am trying to focus to make focus on a column in the newly created row in one of the sub application by referring the below link
http://adfnbpel.wordpress.com/2013/08/14/focusing-a-fieldcolumn-in-the-new-row-of-adf-table/
I created a single application and found that its working
But in my application focus is not working.
When i checked the java script by using FireBug console it is found that comp = AdfPage.PAGE.findComponent(‘”+inputId+”‘); is getting as "undefined" , where inputId = table.getClientId(facesCtx) + “:” + rowId + “:” + “it3″; I am getting the exact row id also. When i tried with by passing the table id as input id like inputId = table.getClientId(facesCtx) ; the fire bug console then showing the table id. So its sound strange.
What may be the cause of not able to find the input text it3 by using findComponent ?
Is any body can suggest a solution for this.
Thanks in advance,
GijithHi,
read up about "findComponentByAbsoluteLocator" in http://www.oracle.com/technetwork/developer-tools/jdev/1-2011-javascript-302460.pdf
or check ...
AdfPage JS doc
Frank -
Fixed number of rows in ADF table
Can we specify fixed number of rows for ADF table so even no rows displayed it will still show 10 empty rows.
the rangesize property determines how many rows will be displayed and controls paging. If there are no rows to begin with (if I understand the question correctly) rangesize won't have any effect.
-
Change the background color of selected row in adf table
Hi,
Can somebody guide me in changing the background color of a row when its being selected. In my ADF table, one of the column is of type Command Link. So whenever i click this command link on any particular row that complete row color should change as an indication of that row being selected.
Please guide me to do this. I referred to other forum posts, but they couldnt meet my need.
Thanks
riHi Frank,
you're right. This should work. But the result is not perfect from my point of view.
I use
<af:table ...>
<af:column ...>
<af:outputText value="#{row.col1}" inlineStyle="#{row.mystyle}"/>
</af:column>
</af:table>and I get e.g. this in HTML:
<table ...>
<tr>
<td class="af_column_cell-text OraTableBorder1111"><span style="font-weight:bold;">qqq</span></td>
</tr>
</table>while I would prefer to get somethig like this:
<table ...>
<tr>
<td style="font-weight:bold;"><span>qqq</span></td>
</tr>
</table>, which looks much smarter. Is it possible?
Thanks,
Alexandre. -
How to delete multiple rows from ADF table
How to delete multiple rows from ADF table
Hi,
best practices when deleting multiple rows is to do this on the business service, not the view layer for performance reasons. When you selected the rows to delete and press submit, then in a managed bean you access thetable instance (put a reference to a managed bean from the table "binding" property") and call getSeletedRowKeys. In JDeveloper 11g, ADF Faces returns the RowKeySet as a Set of List, where each list conatins the server side row key (e.g. oracle.jbo.Key) if you use ADF BC. Then you create a List (ArrayList) with this keys in it and call a method exposed on the business service (through a method activity in ADF) and pass the list as an argument. On the server side you then access the View Object that holds the data and find the row to delte by the keys in the list
Example 134 here: http://blogs.oracle.com/smuenchadf/examples/#134 provides you with the code
Frank -
Refreshing only the single row of ADF Table
Hi All,
I have a webcenter application where the ADF Applications has been deployed.Now the Data is coming onto the ADF Tables from a webservice.In that particular table i need to refresh only the single row(whichever selected by the user to edit ) or even a particular field with the updated values as well as need to validate and to create a message box saying about the errors if the validation goes wrong.
Please suggest!!Hi,
if "updated value" mean that the value got changed on the middle tier (not the browser client) then the update requires the table to be partially refreshed. If the user edits a row and in this row has dependent fields, then this can be achieved by partially refreshing the column. Note that ADF Faces tables don't refresh just one cell
Frank -
Moving Rows in ADF Table Using Drag and Drop
I implemented a drag and drop functionality it works fine, I want to accomplish the following functionality:
The user selects the rows and what if he drags the selected rows and wants to move to section beyond the limit of the table I want to scroll the table in the direction the user is dragging.
I think it should be a default behavior in the ADF table but it doesn't, could you please anyone tell me how to scroll the table while dragging the selected rows?
Thank you,What make you think that this is a default behavior?
Adf tables a data bound. So the data appears in an order (mostly defined by a sort condition on the db).
Even if you implement this behavior (which is possible but hard to do) you loose the new order by the next round trip to the db.
You may try to use trinidad tables but then you don't have the drag & drop featur (I guess).
Timo -
How to programmatically change style in an ADF table
Hi,
I got an ADF table generated form my data controls.
But I need to change de style of every cell in my backing bean.
I can't really find anything usefull on google, hopefully you guys can provide me with some usefull information.I got my answer somewhere else :
>
Based on the comments we now know that you use jdev 11.1.2.2.0. What you can do is to bind the styleClass property of the table to a backing bean property. The property in the bean has a getter and a setter method. In the setter method you can get all the values you need from the row and do you calculation. Based on the outcome you return the name of a style class suitable for the cell. The different style classes you define in a skin fro the application. If you e.g. defien the following style classes in your skin
.high_value { background-color:green; }
.negative_value { background-color:red;}
and in a bean in request scope, which you access from the page the table is on
private String styleForCell;
public String getStyleForCell()
// get the value of the cell
FacesContext lContext = FacesContext.getCurrentInstance();
ELContext lELContext = lContext.getELContext();
ExpressionFactory lExpressionFactory = lContext.getApplication().getExpressionFactory();
Number val;
val = (Number) lExpressionFactory.createValueExpression(lELContext, "#{row.valargument}", Object.class).getValue(lELContext);
if (val == null)
return "";
// do the calculation and return the suitable style class
int ival = val.intValue();
if (ival >= 100000 )
return "high_value";
else if (ival < 0)
return "negative_value";
else
return "";
public void setStyleForCell(String aStyleForCell)
this.styleForCell = aStyleForCell;
}Now you can access the calculated style class from the tables column styleClass property as #{beanname.styleForCell} This will call the method for each cell of the column. -
How to change "next" "previous" in ADF table ?
**hi ,**
**I am using oracle jdev 10.1.3.4**
**I want to put my own text instead of "next" "previous" in ADF table , also I have the same problem in shuttle box ,**
**I want to change the default javascript validation (ex: shuttle box alerts)**
**I do not know to customize it or where these files saved ?**
**any one can help ?**Hi Dave,
Thank you so much for the email. I tried every object and method I can
posibly think about such as
myTable.Rows.Item(1).PointSize = 24
myCell.Characters.Item(1).PointSize = 24
I got error message all the time. These objects don’t support PointSize.
All I need is to change point size of the text in InDesign tables created
using VBScript. Could you help me with this? Thanks,
Regards,
Li -
How to limit no of rows in ADF table
Hi all,
i want to limit the number of rows displayed in ADf table. I tried using range size, but it didn't work. In the post
Limiting ADF table number of rows is not working
it was stated that it is a bug. Is it fixed now or is there any work around to fix this.
Thanks in advance,
NadHi Nad..
Hope this would help you..
Suppose you have these..
Jspx Page - RangeTable.jspx
Backing Class - RangeTable.java
Iterator used to load Table in page definition - ViewObjTableData
First of all In your pagedefinition page change the RangeSize value to -1 to display all rows in your table like
<iterator id="ViewObjTableDataIterator" RangeSize="-1"
Binds="ViewObjTableData" DataControl="AppModuleDataControl"/>Now Goto your Backing bean and there put the setter getter method to limit your Table to show data as you want.. Like..
public static int rangeSize = 10;
public void setRangeSize(int rangeSize) {
this.rangeSize = rangeSize;
AdfFacesContext.getCurrentInstance().addPartialTarget(table1);
public int getRangeSize() {
return rangeSize;
}Line having this is your default no of rows which you will get on table load..
public static int rangeSize = 10;and
this will forcely refresh your table according to your choise
AdfFacesContext.getCurrentInstance().addPartialTarget(table1);Now come to Your Jspx page and
Add af:selectOneChoice to Action facet of your table and add some selectItem having value of *10*,*20*, and *30* According to your choise
<af:selectOneChoice label="Row Limit" autoSubmit="true"
binding="#{backing_RangeTable.selectOneChoice1}"
id="selectOneChoice1"
value="#{backing_RangeTable.rangeSize}">
<af:selectItem label="10" value="10"
binding="#{backing_RangeTable.selectItem1}"
id="selectItem1"/>
<af:selectItem label="20" value="20"
binding="#{backing_RangeTable.selectItem2}"
id="selectItem2"/>
<af:selectItem label="30" value="30"
binding="#{backing_RangeTable.selectItem3}"
id="selectItem3"/>
</af:selectOneChoice>set its autoSubmit property to true and bind the value property to the rangeSize of your backing beans
now in your table change binding property of Rows to your backingbean's rangeSize like
rows="#{backing_RangeTable.rangeSize}"and also set this
partialTriggers="selectOneChoice1"That all dear..
Now check it out and let me know that you got your solution or not?
and if you got your right answer then dont forget to put \[SOLVED\] tag with your subject line. and mark this answer as correct and helpful.. :-)
Thanks,
Fizzz... -
Commit multiple rows of ADF table at once?
Hi All,
I’m using Jdeveloper 10.1.3.3 and ADF BC technology. I’ve created jsp which consist of ADF table and submit (commit) button. There is one column editable, where the user can choose from SelectOnechoice component the value Yes OR No. I tried to save all changes in each row at a time, in order to do that I used commit from Operations but the changing in first row is saved. How can I make the commit save all changes at once.
Thanks in advanceHi,
a commit is performed on the transaction, not the rows you see on the screen. So you need to make sure that changes get submitted using the autosubmit functionality or by submitting the form before pressing commit
Frank -
Row Curr/No Rows and ADF Table- Found the issue but no solution Attn: Frank
I have an ADF table that has ten rows of data. I have set it to show 5. When I try to go to the next page by clicking "Next" and do a "Show All" I get Row Currency error and "No Rows." However, if I set the ADF Tbale to shopw 10 rows, it shows them all. Any ideas?
I have been looking at it for a week.Error
JBO-35007: Row currency has changed since the user interface was rendered. The expected row key was oracle.jbo.Key[]
On the jspx, I have:
***** No rows yet. ******************
In the message log, I have
oracle.adf.controller.faces.lifecycle.FacesPageLifecycle addMessage
WARNING: JBO-35007: Row currency has changed since the user interface was rendered. The expected row key was oracle.jbo.Key[]
Oh, by the way, I see the message below, before any error happened
Jun 11, 2008 12:29:38 PM oracle.adfinternal.view.faces.taglib.ValidatorTag createValidator
SEVERE: attribute 'validatorId' is missing
Jun 11, 2008 12:29:38 PM oracle.adfinternal.view.faces.taglib.ValidatorTag doStartTag
WARNING: could not create validator for validatorId:null and binding:#{bindings.MenuId.validator}
Jun 11, 2008 12:29:42 PM -
Delete operation is not working to delete selected row from ADF table
Hi All,
We are working on jdev 11.1.1.5.3. We have one ADF table as shown below. My requirement is to delete a selected row from table, but it is deleting the first row only.
<af:table value="#{bindings.EventCalendarVO.collectionModel}" var="row"
rows="#{bindings.EventCalendarVO.rangeSize}"
emptyText="#{bindings.EventCalendarVO.viewable ? applcoreBundle.TABLE_EMPTY_TEXT_NO_ROWS_YET : applcoreBundle.TABLE_EMPTY_TEXT_ACCESS_DENIED}"
fetchSize="#{bindings.EventCalendarVO.rangeSize}"
rowBandingInterval="0"
selectedRowKeys="#{bindings.EventCalendarVO.collectionModel.selectedRow}"
selectionListener="#{bindings.EventCalendarVO.collectionModel.makeCurrent}"
rowSelection="single" id="t2" partialTriggers="::ctb1 ::ctb3"
>
To perform delete operation i have one delete button.
<af:commandToolbarButton
text="Delete"
disabled="#{!bindings.Delete.enabled}"
id="ctb3" accessKey="d"
actionListener="#{AddNewEventBean. *deleteCurrentRow* }"/>
As normal delete operation is not working i am using programatic approach from bean method. This approach works with jdev 11.1.1.5.0 but fails on ver 11.1.1.5.3
public void deleteCurrentRow (ActionEvent actionEvent) *{* DCBindingContainer bindings =
(DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding dcItteratorBindings =
bindings.findIteratorBinding("EventCalendarVOIterator");
// Get an object representing the table and what may be selected within it
ViewObject eventCalVO = dcItteratorBindings.getViewObject();
// Remove selected row
eventCalVO.removeCurrentRow();
it is removing first row from table still. Main problem is not giving the selected row as current row. Any one point out where is the mistake?
We have tried the below code as well in deleteCurrentRow() method
RowKeySet rowKeySet = (RowKeySet)this.getT1().getSelectedRowKeys();
CollectionModel cm = (CollectionModel)this.getT1().ggetValue();
for (Object facesTreeRowKey : rowKeySet) {
cm.setRowKey(facesTreeRowKey);
JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding)cm.getRowData();
rowData.getRow().remove();
The same behavior still.
Thanks in advance.
Rechin
Edited by: 900997 on Mar 7, 2012 3:56 AM
Edited by: 900997 on Mar 7, 2012 4:01 AM
Edited by: 900997 on Mar 7, 2012 4:03 AMJDev 11.1.1.5.3 sounds like you are using oracle apps as this not a normal jdev version.
as it works in 11.1.1.5.0 you probably hit a bug which you should file with support.oracle.com...
Somehow you get the first row instead of the current row (i guess). You should debug your code and make sure you get the current selected row in your bean code and not the first row.
This might be a problem with the bean scope too. Do you have the button (or table) inside a region? Wich scope does the bean have?
Anyway you can try to remove the iterator row you get
public void deleteCurrentRow (ActionEvent actionEvent) { DCBindingContainer bindings =
(DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding dcItteratorBindings =
bindings.findIteratorBinding("EventCalendarVOIterator");
dcItteratorBindings.removeCurrentRow();Timo
Maybe you are looking for
-
Screen sharing and "command tab"
Hi, is there a way to "command tab" within a Screen sharing screen. When I use "command tab", it's doing this on the host, and not on the remote machine... Or is there another way to jump from application to application? Cheers, Roger
-
Using a background image for the buttons in spry menu
Hi All, Going nuts here. I'm using the vertical spry menu widget w DW CS3 and trying to alter the css style sheet, so that I can use a li class for each of the 14 links on this page, with an upstate and a hover state only. (the focus, and hover while
-
Cannot install Camera Raw 7.2 update
Hi there, i used abobe download asstant to download and install elements 11. then used elements - help - updates to download and install raw 7.2. however i cannot open any of my rx100 raw .arw files. camera raw is not listed in help - about plugin
-
Firewire Interface and Microphone Choices?
Was looking to drop no more than 500 dollars on a firewire interface and less than 175 in a microphone to do some decent quality recording onto my MB (primarily trumpet, ukulele and acoustic guitar). For the interface I've been looking at the: Apogee
-
Unable to create a new sheet in the excel
Hi, We are using BO Dashboards 4.1 SP2 with MS Office 2013 32bit. Problem is we are not able to add extra sheets to the work book. The option to insert additional sheet is greyed out. Is there a solution?? Thanks Anil