Intercepting set current on page load
Hie
I have table on a page and as a default adf behavior the first row of the table is selected and marked as current row.
We have to execute some logic on the current row listener for which I have overrided the table's serCurrentRowListener
But this listener does not gets fired the first time when page is loaded and table is populated. So, is it possible to do any of the below two things:
1. First row of the table is not selected unless user manually does it
2. Or, the setCurrentRow listener fires in this case as well.
Please advise
Vik
1. First row of the table is not selected unless user manually does itFor this to work, remove the selectedRowKeys attribute:
<af:table id="md1" rows="#{bindings.Departments.rangeSize}"
fetchSize="#{bindings.Departments.rangeSize}"
emptyText="#{bindings.Departments.viewable ? 'No data to display.' : 'Access Denied.'}"
var="row" value="#{bindings.Departments.collectionModel}" rowBandingInterval="0"
*selectedRowKeys="#{bindings.Departments.collectionModel.selectedRow}"*
selectionListener="#{bindings.Departments.collectionModel.makeCurrent}"
rowSelection="single" styleClass="AFStretchWidth"
binding="#{MasterDetailTableBean.masterTable}">
</af:table>
Remove the selectedRowKeys from your af:table property.
It should be:
<af:table id="md1" rows="#{bindings.Departments.rangeSize}"
fetchSize="#{bindings.Departments.rangeSize}"
emptyText="#{bindings.Departments.viewable ? 'No data to display.' : 'Access Denied.'}"
var="row" value="#{bindings.Departments.collectionModel}" rowBandingInterval="0"
selectionListener="#{bindings.Departments.collectionModel.makeCurrent}"
rowSelection="single" styleClass="AFStretchWidth"
binding="#{MasterDetailTableBean.masterTable}">
</af:table>
Thanks,
Navaneeth
Similar Messages
-
URL of the current portal page loaded using Javascript ?
Hello:
I am trying to add programmatically the url of the current
page loaded in the portal to the 'Favorites List'. There
is a pre-built KM iview to store your 'favorites'.
I can extract and write to this 'favorites' using KM java
API. But only challenge is to extract the current loaded
page URL and title using Javascript.
I would appreciate any help in this regard.
Thank you very much,
Prasad NutalapatiDude i was having the exact same problem. I solved it using the SAP-provided EPCM (javascript client framework).
Javascript Code
var pageName = "";
var URL = "";
function bookmarkPage()
/* page url */
var fullURL = "https://<%=request.getServerName()%>/irj/portal?NavigationTarget=" + URL;
/* IE bookmark */
if(EPCM.getUAType() == EPCM.MSIE)
window.external.AddFavorite(fullURL , pageName);
else
var msg = "Sorry. The \"Add To Favorites\" feature only works with Internet Explorer. " +
"The URL to this page is " + fullURL;
alert(msg);
/* get pagename from eventObject from subscribed event */
function getPageObject(eventObj) {
pageName = eventObj.dataObject.title;
URL = eventObj.dataObject.URL;
/* subscribe to event in pagetoolbar area */
EPCM.subscribeEvent("urn:com.sapportals:navigation", "AddNavTargetAllowDuplicate", getPageObject);
End of code
Basically, what this does is that everytime a page loads, the innerpage, where the content is, raises an event using the EPCM.raiseEvent() method. EPCM.subscribeEvent subscribes to an event called AddNavTargetAllowDuplicate which has an object holding the page information (i.e. page title and URL (ROLE://...)). Everytime that it notices an event raised, the function getPageObject gets called to go get data from the event object that is available globally in the framework.
You should be able to put this code anywhere in any iview and it should work. Thou i have only tried putting it in the masthead. Try and if you still have questions please let me know. -
Up to about a month ago, I never had any problems setting my Home Page to Using Current Pages. Then, all of a sudden, I am unable to make any changes to my Home Page no matter what I change the settings to. I work for the US Forest Service and I don't know if some program was loaded that prohibits any changes from being made. Any help would be most appreciated.
This link may help - https://support.mozilla.com/kb/Preferences+are+not+saved
-
How to set default date of 3 weeks(21 days) from today's date during page load?
I want to show the default date as 3 weeks from today's date during page load.
For example ,i have given as adf.CurrentDate + 21 in EO for the attribute 'DueDate'. But it is showing me the date as 9.7.2013. 3 weeks default date is not getting set.If i give adf.currentDate also ,it not giving me today's date,it showing the 9.7.2013 only.Kindly provide your suggestions to set the default date as 3 weeks from today's date during page load.Thanks in advance.Hi,
when you set the value on the entity level then you don't want to show it during page load but when the field is empty ? Correct? if so then the use case is a different one. The easiest way to implement this would be to create a Rowimpl class (Java option) and then in the get method of the entity attribute check if the value is null and if it is, set it to the current date + 21 days. This way all rows will be set with the 3 weeks due date but fields are not overridden each time the row is queried
Frank -
Home page loads fine but all othes pages load in no styleeven through it is set to basic page style
started today dident load home page right had to reload it sence then the home page has been loading fine all search pages have loaded in no style. i click view, go down to page style it set to basic page style
That is exactly the procedure I went through. This will allow me to use it as a homepage as long as Firefox remains open. I can return from other pages using the home icon and it works fine.
HOWEVER, as soon as I close firefox it won't load.
I did notice that the upper case letters are somehow turned to lower case for the location arguments of the page in the current page entry and they don't get changed in the bookmark entry. -
Set VO bind variable on page loading programmatically
Greetings everyone!
I use JDeveloper version 11.1.2.3.0
I am currently trying to get some filtered data from a VO, based on a WHERE clause with a bind variable. This process should be done on page load. I have to set this bind variable with the id of the logged user (the part of getting this id is already achieved and used somewhere else). My current approach is defining a managed bean with pageFlow scope. Inside this i have a method in which i retrieve the id and i set it as the parameter value. The code snippet:
BindingContainer bindings = getBindings();
OperationBinding operationBinding = bindings.getOperationBinding("getUserIdFromUsername"); //getUserIdFromUsername is a method defined in the AppModule and exposed in the client interface
operationBinding.getParamsMap().put("username", getUserName());
Object userID = operationBinding.execute();
setUserId(Integer.parseInt(userID.toString()));
System.out.println("THE USER ID IS: "+getUserId());
BindingContainer bindings2 = getBindings();
OperationBinding operationBinding2 = bindings.getOperationBinding("ExecuteWithParams"); // i've dragged and dropped the ExecuteWithParams operation into the page
operationBinding2.getParamsMap().put("userId", getUserId()); // userId is the bind variable which i'm talking about
Object result = operationBinding2.execute();
Then, i call this method on BeforePhase in the page view. It works, i get the filtered data and the println shows me the correct ID. The problem is that each time i select a row in the table showing the data, the page seems to reload and it always get the selection back at the very first row.
What am i doing wrong? May be this is not the right approach, as i've seen some other posts about this topic but they are not very clear to me.
Please adviceApproach1:
Drag and Drop an Application method as Default Method Call Activity, then draw a control flow case from the method to your page.
In the application module method, implement appropriate logic.
Approach2:
Using a combination of client listener and server listener will also help.
<af:clientListener method="onLoadAction" type="load"/>
<af:serverListener type="MyCustomServerEvent"
method="#{backingBeanScope.editBean.onLoadListener}"/>
function onLoadAction(event){
/*alert(':::: onSave ::');*/
AdfCustomEvent.queue(actionEvent.getSource(),
"MyCustomServerEvent",
true);
actionEvent.cancel() ;
actionEvent.stopPropagation(); -
How can I set up new sites to open in new pages and not over the top of the current open page?
how can I set up new sites to open in new pages and not over the top of the current open page?
Middle-click ''(press down mouse scroll wheel)'' <br />
or <br />
{Ctrl + Click} <br />
or <br />
Right-click and use '''''Open in a New Tab''''' -
Dynamically setting where clause parameter before the page load
Hi Experts,
I do have the following requirement.
I am working on jsf page in ADF10.1.3.3. I have a View Object which displays the results on the screen. Can someone provide me some example where I can dynamically set the where clause parameter to my Query in VO before the Page Load happens(By Overriding the Prepare Model) and display results on screen.
ThanksHi,
Thanks for yor advice.
I need to write the method in Prepare Model method when the page loads and not in AM.
Here in the page there is no action as such.
On the Page load we need to directly set the Where Clause on the VO.
Provide me some examples if any.
Thanks -
How to set the bind variable on page load and execute query ?
Hi All,
I am using Jdeveloper 11.1.1.5
I have a table called "Employee"
Columns :- id , name , location
Data :- 1, ,james , chicago
2 ,Raj ,capetown
Now i have another webservice(created as a webservice dataControl) which sends me the "id" on each time my page loads.Now the id which has been returned by webservice should be incorporated in my VO Query as in where clause to fetch the data for the respective "id" in that "Employee" table and should be rendered on form.
Eg :- Id "2" has been sent by the webservice then the record should be fetched from database should be "2","raj","capetown".
I know that there would be necessity of bind variable , but how do i set the bind variable on page load ?
How can i use the bind variable appropriately ??
Please suggest !!!!
Thanks.Hi,
Check
http://www.orastudy.com/oradoc/selfstu/fusion/web.1111/b31974/web_services.htm#CJADCDBG
http://thepeninsulasedge.com/frank_nimphius/2011/02/18/adf-code-corner-sample-73-released-hands-on-creating-a-search-form-using-a-pojo-ws-and-the-web-service-data-control/
-Suresh -
shortcut foe cancelling the current loading page
You should be able to cancel the page loading with the ESC (Escape) key on the keyboard.
Current Firefox versions use a combined Stop/Reload/Go button that is positioned at the right end of the location bar.
*During the page load process it shows as a Stop button and after the loading has finished the button is changed to a Reload button.
*If you type in the location bar then that button becomes a Go button.
*Middle-click or hold the Ctrl key and left-click the Reload button to duplicate the current tab to a new tab. -
How can I set current Page/
If you mean '''How to set the home page''' read here for more information:
https://support.mozilla.com/en-US/kb/How%20to%20set%20the%20home%20page
thank you
Please mark "Solved" the answer that really solve the problem, to help others with a similar problem. -
Basic HTML Can I set Firefox to automatically load pages as 'Basic HTML'?
Will loading pages as "Basic HTML" load faster?
Pages take 30 - 60 seconds, downloads OK at 1 MB a minute.
Some sites, e.g. Yahoo Mail, have a button to load faster as Basic HTML. Can other sites load as Basic HTML?
So: Can I set Firefox to automatically load as Basic HTML if that site can be?
(Firefox 3.6.15, Windows XP, 2MB RAM, ISP is Hughes satellite in Virginia, USA.)You can look at:
* Adblock Plus: https://addons.mozilla.org/firefox/addon/1865
You need to subscribe to a Filter list (e.g. the EasyList).
*http://adblockplus.org/en/subscriptions
*http://adblockplus.org/en/getting_started -
HT1595 My AppleTV seems to be stuck on the "Setting Date and Time" load page
I just moved from a house to an apartment and when I hooked up my appleTV it said "Setting date and time" with a spinning load wheel and it's been doing this for a long time now. I hit MENU on the remote and tried going to Settings> General> Network like it said at the bottom of the screen, but nothing happened. It's connected to the right WiFi network, but the only icons it shows on the home screen are the 'Computers' icon (for Home Sharing) and the 'Settings' icon. My movies, music, tv shows, netflix etc. icons aren't showing up. I restarted it and got as far as the "Setting date and time" load page again, where it just sits and loads.
Welcome to the Apple Community.
Assuming this is not the first time you have used your Apple TV
1. You might try restarting the Apple TV by removing ALL the cables for 30 seconds.
2. Also try restarting the router.
3. If the problem persists, try a restore, you may want to try the previous procedures several times before doing this.
If this is a new Apple TV, it may also be that your network router is not allowing access to the timeserver, check that your router allows access over port 123. -
How do I move the page-load progress meter from the bottom task bar to the top menu bar, or inside the top/header toolbar? I am currently using Firefox Version 3.6.19.
URL Eaddress: [email protected]You see the orange (on Linux gray) Firefox button if the Menu Bar is hidden, so you need to hide the Menu bar to get the new appearance.<br />
If you need to access the hidden Menu bar then press F10 or hold down the Alt key to make the Menu Bar appear temporarily.<br />
You can place the Tab Bar on top.
* View > Toolbars : [ ] Menu Bar
* View > Toolbars : [X] Tabs on Top
The Tab bar only appears on the title bar if the Firefox window is maximized. -
Setting components values in the ADF page load time
Hi,
We are trying to set the components labels dynamically, so each time the page is loaded we are loading the related labels from the database, instead of using the default database column names driven labels.
We get the labels text okay from the database in the afterPhase method, but we do not have access to the output text UI items then, so a call scuh as this getOutputText1() will return null.
We have also tried to use value binding for the output text, e.g. value=#{backing_untitled2.verbiage}, where verbiage attribute was set in the afterPhase method. The method is called okay and sets the attribute, but for some reason the attribute is then set back and displayed as null.
The same code is executed okay in a command button.
Any idea why is that failing, or how to populate these labels dynamically in the page load time better than the above?
Thanks in advance
Mohamed ElmallahHi,
I think you should re-think your strategy and not read the labels from the database all the time. Instead, read it into a class that extends HashMap one time and put it into the session. Then reference the bean #{sessionScope.beanname['label'], which will call the HashMap's getter method. Use the "label" name to find the label for the particular key
If you r application becomes big, you may want to think of handling the session bean size through leaning it under specific conditions
Frank
Maybe you are looking for
-
DOwnload finished but got X RedCircle Runtime Error! PROGRAM: C:\Program Files(x86)\iTunes\iTunes.exe R6034 An application has made an attempt to load the C runtime library incorrectly. Need Support Team to give Resolution to me and others? I have do
-
Table Relation with Payment and Invoice of Vendor
Hi all, I have one question about Table Relation with Payment and Invoice of Vendor. the scenario is. 2 Purchase Order number : 100000001/100000002 1 Invoice document number : 200000001 which include 2 Purchase Order. 1 Paym
-
hey guys. ive got a problem. last night, my 1st gen macbook kind of hung while i was unzipping a 170mb zip file. the process got stuck with no progress and while the rest of the stuff was working, that process could not be cancelled, window could not
-
HT201304 Website restrictions do not work
I'm trying to put in some parent controls on a new iPad mini and I would like to block youtube. I have set up restrictions and entered the YouTube web address in the Never Allow section but it doesn't work!! Any help and guidance would be greatly rec
-
<blockquote>Locking duplicate thread.<br> Please continue here: [/questions/836692]</blockquote> I go to Firefox, Google a question and several options appear. I click on the one that I want to read in full and all I get is an empty page.