How could auto-select customized row(s) when af:table loads?
for example,
the first row be selected at the first start up.
or, if i change/add a row, this updated row should be highlighted
JDev: 11g
any good solution for this use case?
Thanks.
Kevin.
Hi Frank,
but it doesn't work...
Thank you.
Kevin.
Similar Messages
-
How to efficiently select random rows from a large table ?
Hello,
The following code will select 5 rows out of a random set of rows from the emp (employee) table
select *
from (
select ename, job
from emp
order by dbms_random.value()
where rownum <= 5my concern is that the inner select will cause a table scan in order to assign a random value to each row. This code when used against a large table can be a performance problem.
Is there an efficient way of selecting random rows from a table without having to do a table scan ? (I am new to Oracle, therefore it is possible that I am missing a very simple way to perform this task.)
thank you for your help,
John.
Edited by: 440bx on Jul 10, 2010 6:18 PMHave a look at the SAMPLE clause of the select statement. The number in parenthesis is a percentage of the table.
SQL> create table t as select * from dba_objects;
Table created.
SQL> explain plan for select * from t sample (1);
Explained.
SQL> @xp
PLAN_TABLE_OUTPUT
Plan hash value: 2767392432
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 725 | 70325 | 289 (1)| 00:00:04 |
| 1 | TABLE ACCESS SAMPLE| T | 725 | 70325 | 289 (1)| 00:00:04 |
8 rows selected. -
How can i select the rows from the 3 tables by particular column name?
Vehicle Passing Summary table structure
PsngSmry_ID(Number),Vehicle_iD(Number),PsngSmryTime(datetime)
Vehicle table structure
Vehicle_iD(Number),VehicleName(VarChar2),VehicleType(VarChar2)
Here Vehicle_iD is the Primary Key
Equipment Table Structure
Eqpmt_id(Number),Vehicle_iD(Number),EqpmtName(VarChar2),EqpmtType(VarChar2)
Here Eqpmt_id is the Primary Key and Vehicle_iD is the foreign Key
Equipment Component Table Structure
Eqpmt_Cmpnt_id(Number) ,Eqpmt_id(Number),EqpmtCmpntName(VarChar2),EqpmtCmpntName(VarChar2),Parent_Eqpmnt_ID(Number)
Here Eqpmt_Cmpnt_id is the Primary Key and Eqpmt_id is the foreign Key
The rows in the Vehicle Passing Summary table
PsngSmry_ID Vehicle_ID PsngSmryTime
111111 80986246 2010/10/11
111112 80986247 2010/10/12
111113 80986248 2010/10/10
The rows in the Vehicle Table
Vehicle_iD VehicleName VehicleType
80986246 Lorry Four Wheeler
80986247 Van Four Wheeler
80986248 Bus Four Wheeler
The rows in the Equipment Table:
Eqpmt_id Vehicle_iD EqpmtName EqpmtType
109846 80986246 2 Axle Lorry CAR
109821 80986246 4 Axle Lorry CAR
109825 80986246 4 Axle Lorry CAR
109562 80986247 2 Axle VAn CAR
109555 80986247 3 Axle VAn CAR
109777 80986247 3 Axle VAn CAR
109587 80986248 2 Axle Bus CAR
The rows in the Equipment Component Table :
Eqpmt_Cmpnt_id Eqpmt_id EqpmtCmpntName Parent_Eqpmnt_ID
20904146 109846 Truck
20904147 109846 Truck
20904148 109846 Axle 20904146
20904159 109846 Axle 20904146
20904167 109846 Wheel 20904148
20904177 109846 Wheel 20904148
20904185 109846 Wheel 20904159
20904325 109846 Wheel 20904159
20904188 109846 Axle 20904147
20904189 109846 Axle 20904147
20904195 109846 Wheel 20904188
20904196 109846 Wheel 20904188
20904197 109846 Wheel 20904189
20904398 109846 Wheel 20904189
10904146 109562 Truck
10904147 109562 Truck
10904148 109562 Axle 10904146
10904159 109562 Axle 10904146
10904167 109562 Wheel 10904148
10904177 109562 Wheel 10904148
10904185 109562 Wheel 10904159
10904325 109562 Wheel 10904159
10904188 109562 Axle 10904147
10904189 109562 Axle 10904147
10904195 109562 Wheel 10904188
10904196 109562 Wheel 10904188
10904197 109562 Wheel 10904189
10904398 109562 Wheel 10904189
Note : In Equipment Component Table,the hierarchy will be Truck-->Axle-->Wheel.So
1.the Parent_Eqpmnt_ID of Axle is Truck's Eqpmt_Cmpnt_id.
2.the Parent_Eqpmnt_ID of Wheel is Axle's Eqpmt_Cmpnt_id.
Now I want to write the store procedure which will take "PsngSmry_ID(Number)" as input and the o/p will be in the format :
Eqpmt_Cmpnt_id Eqpmt_id EqpmtCmpntName Parent_Eqpmnt_ID
20904146 109846 Truck
20904148 109846 Axle 20904146
20904167 109846 Wheel 20904148
20904177 109846 Wheel 20904148
20904159 109846 Axle 20904146
20904185 109846 Wheel 20904159
20904325 109846 Wheel 20904159
20904147 109846 Truck
20904188 109846 Axle 20904147
20904195 109846 Wheel 20904188
20904196 109846 Wheel 20904188
20904189 109846 Axle 20904147
20904197 109846 Wheel 20904189
20904398 109846 Wheel 20904189
10904146 109562 Truck
10904148 109562 Axle 10904146
10904167 109562 Wheel 10904148
10904177 109562 Wheel 10904148
10904159 109562 Axle 10904146
10904185 109562 Wheel 10904159
10904325 109562 Wheel 10904159
10904147 109562 Truck
10904188 109562 Axle 10904147
10904195 109562 Wheel 10904188
10904196 109562 Wheel 10904188
10904189 109562 Axle 10904147
10904197 109562 Wheel 10904189
10904398 109562 Wheel 10904189
**Please add these columns in the o/p **
1.EqpmtName and EqpmtType from Eqpmt table
2.VehicleName and Vehicle Type from Vehicle table
3.PsngSmryTime from PassingSummary table **
Can anyone tell me the solution?
Edited by: 865216 on Jun 22, 2011 2:14 AMHi,
I am new to this technology;But, just wanted to help you.
Please refer the code it might be atleast helpful for you.
But am facing PL/SQL: ORA-00933: error and unable to resolve it.could anyone please correct this code.
sorry if my code is totally wrong.
Thank you,
Rupa
create or replace procedure Equipment_proc
is
begin
DECLARE
TYPE EQP_record IS RECORD (
Vehicle_iD Vehicle.Vehicle_iD%TYPE,
Eqpmt_Cmpnt_id Equipment_Component.Eqpmt_Cmpnt_id%type,
EqpmtCmpntName Equipment_Component.EqpmtCmpntName%type,
Parent_Eqpmnt_ID Equipment_Component.Parent_Eqpmnt_ID%type,
Eqpmt_id Equipment.Eqpmt_id%type,
vehicleId NUMBER);
EQP_rec EQP_record;
CURSOR EQP_cursor IS
select a.Vehicle_iD,c.Eqpmt_Cmpnt_id,b.Eqpmt_id,c.EqpmtCmpntName,c.Parent_Eqpmnt_ID
from Vehicle a,Equipment b,Equipment_Component c
where a.Vehicle_iD=b.Vehicle_iD
and b.Eqpmt_id=c.Eqpmt_id
and a.vehicle_id=&EQP_rec.vehicleId;
BEGIN
OPEN EQP_cursor;
FETCH EQP_cursor INTO EQP_rec;
dbms_output.put_line(EQP_rec.Vehicle_iD,EQP_rec.Eqpmt_Cmpnt_id||','||EQP_rec.Eqpmt_id||','||EQP_rec.EqpmtCmpntName||','||EQP_rec.Parent_Eqpmnt_ID);
CLOSE EQP_cursor;
END;
END; -
How do I select the entire text when the focus is moved to one TextBox?
How do I select the entire text when the focus is moved to one TextBox?
There are three TextBoxes. I use <TextBox TabIndex="1"/> to set the order they are selected. When I enter one specific TextBox, I would like to have the entire text selected ... one key stroke removes all of the text in that TextBox.
bhs67I do it the following way:
1. Override the OnStartup for the application. Use the following code: (VB.NET)
EventManager.RegisterClassHandler(GetType(TextBox), TextBox.GotFocusEvent, New RoutedEventHandler(AddressOf TextBox_GotFocus))
2. In the event handler use this code (again VB.NET)
Private Sub TextBox_GotFocus(ByVal sender As Object, ByVal e As RoutedEventArgs)
_theTextBox = CType(sender, TextBox)
If setFocusTimer IsNot Nothing Then
RemoveHandler setFocusTimer.Tick, AddressOf setFocusTimer_Tick
End If
setFocusTimer = New DispatcherTimer
setFocusTimer.Interval = TimeSpan.FromMilliseconds(10)
AddHandler setFocusTimer.Tick, AddressOf setFocusTimer_Tick
setFocusTimer.Start()
End Sub
Private Sub setFocusTimer_Tick(ByVal sender As Object, ByVal e As System.EventArgs)
setFocusTimer.Stop()
_theTextBox.SelectAll()
End Sub
What this does is register a handler for every textbox in your application. This will execute when the GotFocus event is raised and will allow you to do whatever (in this case select all) you want. A great way of handling things at the application
level.
Lloyd Sheen -
How to programatically select a row in TableBean and update its column?
Hi,
Can anyone help me on How to programmatically select a row in a TableBean and update its column?
Thanks,
JonHi,
My requirement is I need to update a column in a particular row of the table using fire action...
I have a datefield bean serve as birhdate and base on this I need to update the age column depending on the given dates..
Here's my code under the Process form request for your reference...
if (actionInMainPersonScreen.equals("changeDate"))
String checkId = pageContext.getParameter("paramDatePersonId");
OAFormValueBean depPerId = (OAFormValueBean)depTable.findIndexedChildRecursive("ChildPersonID");
OAMessageTextInputBean depFName = (OAMessageTextInputBean)depTable.findIndexedChildRecursive("FirstName");
OAMessageDateFieldBean dateBirth = (OAMessageDateFieldBean)depTable.findIndexedChildRecursive("BDay");
OAMessageStyledTextBean age = (OAMessageStyledTextBean)depTable.findIndexedChildRecursive("Age");
Date changeBDate = new java.util.Date();
Date dateToday = new java.util.Date();
SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
changeBDate = (Date)dateBirth.getValue(pageContext);
Calendar cal = Calendar.getInstance();
ResultSet empAge = null;
String newAge = null;
OADBTransaction trans = personam.getOADBTransaction();
System.out.println("BirthDate: " + changeBDate + " Date Today: " + sdf.format(dateToday));
String expQuery = "SELECT Trunc((sysdate - To_Date('" + pageContext.getParameter("paramDateBirth") + "'))/365) compAge, Sysdate from dual";
System.out.println("SQL: " + expQuery);
PreparedStatement expPreparedStatement = trans.createPreparedStatement(expQuery ,1);
try
empAge = expPreparedStatement.executeQuery();
} catch (SQLException e) {}
try
while (empAge.next())
newAge = empAge.getString("compAge");
age.setText(pageContext, newAge);
empAge.close();
} catch (SQLException e) {}
regards,
Jon -
Randomly selecting some rows from the database table
Hi can some one help me in selecting some rows from a database table which has around 90,000 rows.
Thanks.One thing you might try is the "sample" clause if you have 8i which is supposed to return a random percentage of the table. Say for example, you have a sequence number on your table as the pkey. Then you might try:
select * from <table_name> where pkey in(select pkey from <table_name> sample(10));
This should give you a random 10 percent of the rows in the table but I tried this once and the results seemed unpredictable. For example it returned a different number of rows each time even though the number of rows in the table didn't change.
Hope this works for you. -
How to freeze column and row headers of a table
How to freeze column and row headers of a table in jsp and javascript. An example is available in
http://www.massless.org/_tests/grid1/ pls help to find a solutionj
Thanks in anticipation
SreejeshAt least I don't stop you from that. I also don't see any benefits in this topic.
Success. -
How do i select a row when a table is loaded?
Hello Guys
could somebody help me? I'm new to ADF and I'm trying to make a SearchPage. It works but I get this behavior:
#1: I bound the Table with the ResultSet of a EJB-SessionBean find-Method. When the SearchPage is loaded, a the SessionBean-find-Mehod is called. I want, that the Table only shows the ResultSet when the CommandButton "Search" is clicked not on PageLoad.
#2. In the ResultSet shown in the table no row is preselected. How can i change that?
# 3. The Table is placed in a TabbedPanel in a showDetailItem "SearchResult". After i select a row I want to show the Details of the selected row-Object in anoteher showDetailItem "Details". How could i handle that?
Thnx a lot for your Help!Hello Frank,
thank you for responding!
#1) I tryed #1 but i got the Exception Illegal . I followed the steps you recommended as follow:
a) On the button "Search" add an af:setPropertyListener. It looks like this:
<af:commandButton actionListener="#{bindings.getDelegateFindAllBySearchCriteria.execute}"
text="Suche starten"
disabled="#{!bindings.getDelegateFindAllBySearchCriteria.enabled}"
id="cb1" inlineStyle="margin-left:8px;">
<af:setPropertyListener from="#{true}" to="#{viewScope.executeOK}" type="action"/>
</af:commandButton>
b) Have the RefreshCondition property on the iterator in the pageDef file looking for a memory flag e.g #{viewScope.executeOk==true?true:false}. In the ExpressionBuilder I get "#{adfFacesContext.viewScope}" but not #{viewScope}
I got an error message writing this in de pageDefinition. It accepted: #{viewScope.executeOk==true}. It is right, if TRUE -> TRUE, if FALSE -> FALSE
The compiler says: "executeOK is an unknown property"
After that i started the Application and got an
<14.04.2011 16:59 Uhr MESZ> <Error> <HTTP> <BEA-101020> <[ServletContext@17109869[app:EHRCPD_PISA_TT module:EHRCPD_PISA_TT-ViewController-context-root path:/EHRCPD_PISA_TT-ViewController-context-root spec-version:2.5]] Servlet failed with Exception
java.lang.IllegalStateException
at oracle.jbo.uicli.binding.JUSearchBindingCustomizer.getViewCriteria(JUSearchBindingCustomizer.java:2161)
#2) I set DisplayProperty to "selected" but it did not works. I checked the rows (they are 2) but they are the same. If i debbug the application i see, that the resultSet got from the Database (JPA) is OK. The size of the resultSet is 2 and the Objects retrieved are different. What i'm doing wrong?
#3) This worked perfectly! Thank you!
I hope, I get this working.
Thnx again -
How to create a custom row selector
I am using APEX_ITEM.CHECKBOX in a form. How can I add a row selector checkbox to the heading of the table to select/deselect all of my custom checkboxes? I tried to simply add the build-in row selector function to the report but that just added an additional column of checkboxes. I just need the header row checkbox added.
This is Apex 3.2.x
Edited by: user9108091 on Oct 14, 2010 1:32 PMHello,
>> How can I add a row selector checkbox to the heading of the table to select/deselect all of my custom checkboxes?
Please check the following. I believe it’s simpler than the hijacking business.
Re: How to add row selector column attribute to report region?
Regards,
Arie.
♦ Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
♦ Author of Oracle Application Express 3.2 – The Essentials and More -
How can I select the row after a cfgrid refresh?
I have a form that is bound to a cfgrid. The grid is populated from a database. When you navigate in the grid the data displayed in the form changes to match the selected row. I can edit the data in the form and update the database. After updating the data I refresh the cfgrid, which then displays the updated data.
Unfortunately the cfgrid always highlights the first row, row 0, after a refresh. I want to highlight the same row that was highlighted when the data was edited and saved. Can anyone advise as to how I can do that?
I have tried setting a listener when the grid is initiated that responds whenever the store is refreshed and triggers the function refreshSelection():
g.getStore().on('load', refreshSelection) ;
Before the form data is saved, the row number is stored in selectedRow[0]. When the grid is refreshed, refreshSelection is run:
function refreshSelection() {
if (0 >= selectedRecords.length)
return;
alert('Selected row is Row ' + selectedRecords[0] ) ;
g.getSelectionModel().selectRow(selectedRecords[0]) ;
selectedRecords[0] = 0 ;
The alert shows the correct row number each time, but highlighting the last row viewed works intermittently, and only if the alert line is active. If I comment out the alert, this fails every time, with row 0 being highlighted. selectedRecords[0] is reset to 0 after the attempt to select the row so that navigation through the grid, such as choosing "Next Page," will properly highlight the first row of the page rather than the last row number that was edited.
-RickMassage?
Why not ask the masseuse who gave you the massage? -
How to avoid selection/deselection of TreeItem when changing expandedProp?
Hello,
i have an application that uses several TreeViews for Assets and Objects.
These TreeViews are working with Groups and Subgroups, Sub-Subgroups, and so on ...
My Problem is: Always when i toggle the expandedProperty of any Group, selected or not, it will change the selection in the TreeView.
If the Group was selected, it will be deselected, if it was not selected, it will be selected, clearing any other selection.
How can i prevent this?
I tried eventFiltering and Handling of the mousePressed events without any success.
Hopefully someone could help me?
Thanks in Advance!
JeweHello Krishnan,
i tried to switch all object types from "not changeable" to "changeable original", but still get the popup when switching cube loading mode.
Do you know the particular object type to manage ?
Hello Vishnu,
same thing, whatever the option is (switch on / off standard) I have the transport popup.
Anyway thanks for your try. -
How to avoid duplicated customer ref. no when create new sales order?
Hi,
In my company, we need input customer ref. no when create a new sales order, but I found there was no any validation to avoid input a existed number.
Can somebody show me how to add some check function on this filed?
thanks.Hi,
This can be handled in standard system.
Go to Administration> System Initialization> Document Settings>Per Document (Tab)> Select Sales Order-->Tick Block release (When duplicated customer reference no. occurs).
Thanks,
Joseph -
How can you get custom sounds for when you sign into iChat?
When you sign into my friend's iChat account on her computer, a computer voice says "Sarah is awesome!", and she obviously custom made that, and I was wondering how you can make custom sounds like that when you sign in.
Thank you so much, I appreciate it!It can be done two ways.
1) as the other poster describes in making an Alert Sound and placing it in Users/(your account)/Library/Sounds and then selecting it in iChat > Preferences > Alerts fro the action you want.
2) In Tiger/iChat 3 only
Go to the iChat Alert Preferences details above and there is an option to have iChat Speak a text phrase which you can type in the Phrase. (this is not there in iChat 4)
8:14 PM Saturday; April 19, 2008 -
How to: Auto-select character in Chinese handwritting mode
The default is you have to click on the very character even if it is the correctly recognized one in the Chinese hand-writing input. This is extremely cumbersome and I'd say, insane, and I thought, OMG, only M$ could think of such thing to torture the user and now... I hope it is something that I have overlooked and can be set easily, anyone?
Those 3rd party programs (HWPen, iAccess) have done much better works than this Apple built-in, sadly, they are still not supporting the iPhone 2.0 f/w...HI
http://melick-rajee.blogspot.ae/2012/02/how-to-set-current-user-name-to.html
Link has the complete article.
In generally we can not set a default value to InfoPath Person/Group Picker. On the other hand we can not get Current Username in the InfoPath. (Yeh it is true that we can use userName() function. But this will return the Current User Account ID not the name).
So we want to use SharePoint user profile services to do this.
First we need to create a user profile connection.
Thus First go to Manage connection and click add connection.
Then go to receive data option and SOAP Web service and specify the User Profile Service
URL. The URL will be something like (http://sever/sites/site/_vti_bin/UserProfileService.asmx).
This is depends on your site or site collection. if it is a site collection you can omit /sites/site/ part from your URL.
then proceed to next , select UserProfileByName and un select the Automatically load.Now you have created the connection.
Now you have User Profile connection to receive profile data.
For an example we will design a form like below. You need to set the current user automatically when the form load.
Then Go to the Form Load Rules.
Melick Rajee http://melick-rajee.blogspot.com -
How to Auto Select some RadioButton on page load using ADF/JSF
Hi,
I am learning ADF and need some help. I have multiple radio buttons and couple of text boxes on my page. How can I make some radio button be selected based on some value from a database table and also populate the text boxes with the corrosponding value when a page loads. Any tips on how it can be done using ADF. Any sample tutorial will be helpful.
ThanksHi,
when you e.g. use ADF BC then the radio button should be selected automatically based on the value of the attribute. If the row is new then you can have a default value specified in the ADF BC ViewObject attribute.
However, if you just dragged the radio button and checkboxes onto the page - not using any ADF binding - then you will have to create a managed bean with a field variable (incl. setter/getter methods) to link the radio button's value property to it using Expression Language
Frank
Maybe you are looking for
-
I am having major problems with the Flash Player Download
I have downloaded it probably 12 times +. I have tried everything I know and keep coming back to the boards for more. I don't know what else to do. I have I/E 8. I use AVG 8.5. I use Net zero and their proprietary pop up blocker. I download 10.1.82.7
-
Hi can't download any tv series from videos
Pls help
-
Unable to join Linksys router guest network
I have the Cisco Linksys E1000 and have had a guest access setup on it ever since I bought the router about 2 years ago. Now randomly I can't get either the iPad 2 or 3 to connect with that guest access. I select the "guest" network from the list of
-
Unable to connect to CMS prdapp22. A wrong connection is made to @@PRDAPP22(PRDAPP22, PRDAPP22:6400). Logon cannot continue. I have reconfigured (manually) Tomcat to point at a virtual IP on the hostname above. I have this running in another environ
-
Upgrading windos xp 32 to 64 bit xp?
Hi all, I am running windows xp 32 bit version with boot camp on macbook pro.Now i want to upgrade my 32 bit xp to 64 bit version ( xp only) assuming it will support my 4GB RAM upgrade. I want to know how to proceed for this? Can we upgrade from 32 b