Where to call the javascript function
Hi,
I am using JSF and ADF.
I have a javascript function called by the body onload.
The javascript is to set the first the first column of a table fixed.
But when I click the next page link which is generated by defaut,
the function from the javascript disappears.
Can I call a javascript function when pressing the next page link which is
generated by default ?
Thanks.
Ivan
Hi Frank,
My javascript function is to make the first column of the table fixed which
is something like the function in the Excel.
The function is called by body onload.
But when the 'next page' link is clicked, it will not refresh the whole page.
The above cannot be called.
So I wanna add it during the action of pressing the link.
any alternatives ?
Ivan
Similar Messages
-
How to call a javascript function from XSL
I'd a requirement to take an action each time a page loads
I called the javascript function from addLoadEvent() available in javascript.
But my reviewer commented that it should be called using XSL as we are using XSLT,
What is preferred?
To pass function name to the already available function or somehow call it from xsl ? if second is preferred option then,
how to call a function through XSLT, if it is to be called aftr the page loads?Thank u..
but i'd seen that link wen i searched in google..
Is it possible without using any 3rd party JARs and all?
and more importantly plz tell me what should be preferred way to call a javascript function?
Do it using addLoadEvent() or Windows.Load etc
OR
Call it thru Xsl? (I donno how to do dis)
Thanks in Advance..
Edited by: ranjjose on Jun 3, 2008 8:21 AM -
Calling the javascript FM and R/3 FM in BSP page
HiExperts ,
I want to know how can I use the javascript code and function modules(R/3) in bsp ., please let me know how can i call the function modules and javascript in my bsp page,
Please provide me a sample piece of code for calling the javascript function module and r/3 function moduless.
Thx in advance,
KiranHi,
These are 2 very different things.
Function modules are called on the server-side in the BSP controller or event-processing... No fancy thing here, this is only ABAP.
Javascript is used on the client side and called from the view of your BSP. You can write Javascript code directly in a BSP view or use MIME repository to store your .js files
In advanced aspects, you can use Javascript to call server using AJAX but you should get familiar with the basic aspects first.
/people/sap.user72/blog/2005/08/15/ajax-and-htmlb--a-sample-bsp-application
/people/salil.patel/blog/2008/07/27/chat-application-using-bsp-and-ajax
/people/renald.wittwer/blog/2007/05/07/bsp-htmlb-tree-view-with-ajax
Best regards,
Guillaume -
Where should i call the rfc function module? in xi or in r/3
where should i call the rfc function module?
for the synch scenario: file < -- > xi <---> rfc
i know the type of rfc is tcp/ip; but i'm not sure with the followings,
and with some trials i can not even see any message via rwb even all the setting
can be activated without errors.
where should i create the rfc destination? in r/3 or xi
where should i call the rfc via abap program? in r/3 or xi
i guess the calling program should belong to the different server with the rfc itself....
so confused....
Thanks for your reply!!
Junif i create the destination in xi point to r/3, then i call the rfc use the destination in r/3 right ?
The call doesnt use the destination in R3. XI has the RFC destination which is just used to connect to the R3 system
but where i need to create the fm via se37? in xi or r/3 ?
In R3
Regards,
Prateek -
Help needed in calling a javascript function from a jsp
Hey guys,
I need help.
In my jsp I have a field called date. When i get date field from the database, it is a concatination of date and time field, so I wrote a small javascript function to strip just the date part from this date and time value.
The javascript function is
function formatDate(fieldName)
var timer=fieldName;
timer = timer.substring(5,7)+"/"+timer.substring(8,10)+"/"+timer.substring(0,4);
return timer;
Now I want to call this javascript function from the input tag in jsp where I am displaying the value of date. Check below
This is one way I tried to do:
<input size="13" name="startDate" maxLength="255" value=<script>formatDate("<%=startDate%>")</script> onChange="checkDate(this)">
I even tried this:
<input size="13" name="startDate" maxLength="255" value="'formatDate(<%=startDate%>)'" onChange="checkDate(this)">
But it dosen't work
Please help. I am struggling on this for days.
Thanks,
RubyHey all you developers out there , Pleaseeee help me with this one.
-
How do you call a JavaScript function from a Java applet
I have an Applet that needs to run on the following platforms: Internet Explorer (Windows-NT, Windows -2000), Netscape (Windows-NT, Windows-2000, Sun(Solaris), RedHat(Linux), HP(11.0), IBM(AIX)).
The Applet needs to call a JavaScript function that is included on the HTML page that contains the applet. In JRE-1.3.1 I used the AppletContext.showDocument(url,"_self" ) where the url is "javascript:MyScript('param1')". This works just fine. I tried using showDocument without the second parameter and all the other choices for the second parameter and none of them worked (nothing happened).
I tried the same code with JRE version 1.4-beta. It seems that version 1.4-beta no longer supports a URL that starts with "javascript" in the AppletContext.showDocument(url,"_self" ) method. The error is:
netscape.javascript.JSException: call does not support self.open
at sun.plugin.javascript.navig.Window.call(Unknown Source)
at sun.plugin.ActivatorAppletContext.showDocument(Unknown Source)
I tried to catch the JSException but I cannot seem to.
I then tried a completely different approach. I then grabbed the JSObject for the page and tried to call my javascript function (MyScript) directly:
JSObject theObj = JSObject.getWindow(this);
Object paramArray[] = new Object[1];
paramArray[0] = Param1;
theObj.call("MyScript", paramArray);
This worked fine on Netscape[Windows-NT, Windows-2000]. HP throws a JSException on getWindow() and Solaris just hangs. I did not even try IE.
What is the recommended approach here?you can try this, it worked for me:
JSObject win = JSObject.getWindow(this);
win.eval(function_call);
I have other ways also, so if this doesn't work, let me know. -
How can I have a backing file call a JavaScript function?
I have a Weblogic portal with a JSP portlet. The portlet has a backing file. How can I get the backing file to call a JavaScript function in my portlet?
thanksHi
your questions are not correct because you are mixing up server side operations with client side operations.
First server side code executes then the page is sent to the browser , then any javascript executes on the browser. So asking for javascript to be called from backing file (server side) doesn't make sense or asking for javascript to read a parameter doesnt exactly work either.
However in your server code suppose you have a variable action in the request that you want javascript to know then in your JSP you would add something like
<script type="text/javascript">
var action = '${requestScope.action}';
alert(action);//or whatever you want to do
<c:if test="${requestScope.someOthervariable == ''xyz'}"><%-- this check is done on the server --%>
callSomeJavascript(); <%--this javascript is only executed when the server side value of someOtherVariable is xyz --%>
</c:if>
</script>
i.e. you can output the javascript that has the variables you need or the function calls you want.
Like I said understand whats server side and whats client side. -
How to call a Javascript function from backing bean without any event
Hi,
Someone knows how to call a Javascript function from backing bean without any event ?
thanksPlease review the following thread:
ADF Faces call javascript
Luis. -
Help in Calling the C Functions in ECC 6.0
Hi All,
We are in process of Upgrading from 4.6C to ECC 6.0.
There is a particular report which calls the C function 'C_DIR_READ_NEXT' .
In this the Parameter " ID 'TYPE' FIELD FILE-TYPE" is showing as (???)not getting the file type in ECC 6.0 where as in 4.6C it was working fine.
Can any body please tell me why this so and is there any other C function which i can use in the place of this .
Awaiting a favourable reply
wih rgds
A.K.Ranjith SinghHi Ranith,
i know there is a new authotity-Object S_C_FUNCT included in this Function.
Look at Note 766771.
If you search in OSS with C_DIR_READ_NEXT, there are some Notes too.
Hope it helps.
Regards, Dieter
You cal also look in RSWATCH0 (AL11) the use of this FM.
Regards, Dieter
Message was edited by:
Dieter Gröhn -
Calling a javascript function from an Applet
I am trying to make an applet that works on as many browsers as possible, so I am sticking to Version JCK 1.1
I am trying to call pass the javascript function into a URL object like this
URL url = new URL("javascript:" + function, "_self");but I keep getting a MalformedURLException. I've read some of the other comments, but they all say to use the netscape.javascript package and the JSObject class, but I can't find that object anywhere inside the API posted on Sun's website.
Any help would be greatly appreciated.To access JavaScript methods, properties, and data structures from your Java applet, import the Netscape javascript package:
import netscape.javascript.*
public class myApplet extends Applet
{ public void init()
{ /* Use the following syntax to call JavaScript methods:*/
JSObject.getWindow().eval("expression")
/*expression is a JavaScript expression that evaluates to a JavaScript method call. */ } -
Calling a JavaScript function from an JApplet...
Can anyone help? Is it possible to call a JavaScript function from within a JApplet? If so, what is the syntax? I've seen reference to the Netscape package but I've been led to believe it doesn't always work within Internet Explorer 6 which is the target browser.
If the above is not possible can anyone tell me if and how it is possible to load images from outside the init() method of a JApplet? This would allow me to work around the problem.
Thanks in advance - Jim.Call javascript you use the JSObject
Please note the MAYSCRIPT int the html file.
html file:
<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
height="0" width="0" >
<param name="code" value="someApplet.class" />
<!--[if !IE]> Mozilla/Netscape and its brethren -->
<object classid="java:someApplet.class"
height="0" width="0"
mayscript=true>
</object>
<!-- <![endif]-->
</object>
<LABEL id="lblOutputText">This text is the HTML text </LABEL>java class:
// new class for jsObject!!!! compile this: javac -classpath "C:\Program Files\Java\jre1.5.0\lib\plugin.jar" someApplet.java
// since jaws.jar does not exsist anymore
// in 1.4.0 to compile: javac -classpath "C:\j2sdk1.4.0_03\jre\lib\jaws.jar" someApplet.java
// for msjvm use the -source 1.3 -target 1.1 option so the command looks like this:
// javac -source 1.3 -target 1.1 -classpath "C:\j2sdk1.4.0_03\jre\lib\jaws.jar" someApplet.java
import netscape.javascript.*;
public class someApplet extends java.applet.Applet {
JSObject win;
public void init() {
try{
win = JSObject.getWindow(this);
// you need win.eval("window.close();"); // to close the window. if the current window is not a popup
// opened by a parent with window.open than the user will get a waring, your next question probably will
// be "can I stop this warning" and the answer is simple: NO
JSObject textBoxLabel = (JSObject) win.eval("document.getElementById('lblOutputText')");
textBoxLabel.setMember("innerHTML", "<center><h1>Some text</h1></center>");
}catch(Exception e){
e.printStackTrace();
} -
Call a Javascript function without JSObject
Hi all,
With j2 sdk 1.4.2_08 the JSObject doesn't seem to ship anymore. I need to find a solution to either:
1. call a javascript function from within an applet without the JSObject
2. or find a different way of executing the http: or mailto: protocols in a new browserwindow.
Would getAppletContext ().showDocument (new URL (oURLString),"Titlet"); be able to do this trick for me? The thing is that with this applet people can click on an image of a map, and then a new browserwindow opens up which calls an asp which shows certain database information. The mailto: protocol is used to enable users to send an email from the applet with certain informations about the map as well.
TIA,
Stefanhmmmm. That might do the trick for me as well, but I had hoped I would not have to change the page in which the applet loads ...
I think I'll give showDocument a couple of tries, and I also think I should download the docs for this version.
BTW, it could very well be that the JSObject was never part of the JRE/plugin. It's just that this project is a very old solution revisited (I first developed it in 1998 or 1999, then worked again on it in 2001/2003, and now it's come back to haunt me again). It's just that when I do a javac it complains about not being able to find netscape.javascript.*. For now I've commented them out, which means two of my commands don't work anymore, and before I deliver I have to fix that.
Thanks,
Stefan -
Call a javascript function (in ASPX) page from a javascript file
I have a javascript file (viewer.js) situated in Scripts/viewer.js My
default.aspx has a javascript functions that calls a c# function in the
default.aspx.cs ( it sends a http webrequest)
Now I want to call from the viewer.js the function in default.aspx which calls the c# function.
How can I handle this in my viewer.js?
I need to do this because I work with 3D objects and the select event is on the viewer.js
When I select the 3D object it needs to call the function in default.aspx...
Scripts/viewer.js
function ClickPickItem(item) {
$("#properties").show();
/*Call function App() */
Default.aspx
function App() {
PageMethods.Connect(callback);
Default.aspx.cs
[WebMethod]
public static string Connect()
string rsp = DigestAuthFixer.GrabResponse("http://<username>:<password>@nextbus.mxdata.co.uk/nextbuses/1.0/1");
... CODE TO MAKE HTTPWEBREQUEST}
Sorry if I'm not clear enough
I don't see another option like this
What I need to do?
Thanks!If my understanding is not wrong, you are trying to call a Javascript function in a separate script block from a linked Javascript page. rite?
When it comes to Javascript, all scripts will be posted to the client side browser and we can access any method between pages provided those JS files are linked to the page.
So you can directly call
App()
function from your
ClickPickItem()
function.
Please try and let us know your result. -
Is it possible to call a JavaScript function from a dialog?
Hi there,
At the moment I have created a dialog, that consists of three text fields that a user fills out, and then clicks next.
What I am attempting to do, is pass the result of these three textboxes to a JavaScript function I have laying in a file in Web Resources. I've done some research, and I can't find anything.
So my question is - is it possible to call a JavaScript function from a dialog?
Thanks for your time.Hi,
It is not possible unfortunately. We can start dialog from script but not the other way unfortunately. However, you can always write server side code for this and it will surely execute. So instead of javascript, write plug-in.
Hope this helps.
Minal Dahiya
blog : http://minaldahiya.blogspot.com.au/
If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful" -
Browser Javascript call Acrobat Javascript function
What I want to do is call a function in Acrobat Javascript by clicking a button in my browser.
So if you click the browser button it executes a javascript function that calls an acrobat javascript function.
I found this example:
Browser javascript
function printDocument() {
var pdfObject = document.getElementById(\"PDFObj\");
pdfObject.postMessage([\"alert\", \"Hello from HTML\"]);
Acrobat javascript
In the secure folder (C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Javascripts\kassa.js) my folder level script
so this is executed for each pdf document.
this.hostContainer.messageHandler =
onMessage: function(aMessage)
for(var i = 0; i < aMessage.length; i++)
console.println("Recvd Msg[ " + i + "]: " + aMessage[i]);
onError: function(error, aMessage){ },
onDisclose: HostContainerDisclosurePolicy.SameOriginPolicy
This should do the job...
But if i look at the javascript debugger window(acrobat)
it shows:
this.hostContainer has no properties
9:Folder-Level:App:kassa.js
this.hostContainer has no properties
9:Folder-Level:App:kassa.js
Any solution for my problem?hi levi,
Thank u very much for responding,
to be precise i have to show the user a small window saying that the excel sheet is being prepared and once the sheet is prepared this window has to be closed. So to open and close this child window i need to use the javascript functions.
currently my jsp looks this way
<script>
function open()
funciton close()
</script>
<body>
<script>
open();
</script>
include x.jsp //sets the content type to excel
include y.jsp //writes to the excel sheet
<script>
close();
</script>
<body>
My x.jsp looks this way
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "filename=" + "abc.xls");
response.setHeader("Cache-Control","no-cache");
response.setHeader("Pragma","no-cache");
response.setDateHeader("Expires",0);
response.addHeader("Cache-control", "no-store");
response.addHeader("Cache-control", "max-age=0");
The issue is the javascripts are not getting called at all. Is there any other way to solve this. Since i am the beginner in this field i dont have much idea about this. A code snippet will be of great help.
Thanx
Maybe you are looking for
-
How to assign Javascript variable to ABAP variable
Hi All, I have a requirement to create a page where each of the table cells will have drop down boxes with Red, Yellow and Green colors. When the user selects the color it has to be saved to database. Now the problem is, I'm using HTML as HTMLB was v
-
How to differentiate a Goods receipt ?
hello gurus how to differentiate the Goods receipts which are done only against an Inbound Deliveries from that of direct POs. Is there any table to check the same ? Thanks in advance
-
I was at a friends and on Itunes on his computer.. with my apple ID i bought some songs. How can i get those songs onto my computer without going back over to my friends house? They said i have to have his computer and mine in order to get it onto my
-
To expand the message list to cover the advertise area when preview pane is below the message list, click on the expand control symbol to the right of the scroll bar. This shows in IE. This does not show in firefox.
-
Reinstalling photoshop elements 10
I purchased and downloaded photo shop elements 10 from your website. I had computer problems and need to reinstall the software. Where can I find the download link? It is not under my past orders but I do have a serial number and product information