Calling java script from HTMLInputText component of java server faces
Iam attempting to do some thing like this
HtmlInputText component = new com.ntrs.wcm.ui.components.inputtext.HtmlInputText();
component.setId(componentId);
component.setValueBinding("value",
FacesContext.getCurrentInstance().getApplication().createValueBinding(backingBeanEL));
component.setSize(length);
component.setMaxlength(length);
now on the component iam calling the followng jav ascript function
component .setOnkeydown("DisableCtrlKey(event)");
The java script
iam calling is
function disableCtrlKey(e)
//list all CTRL + key combinations you want to disable
var forbiddenKeys = new Array(a, n, c, x, v, j);
var key;
var isCtrl;
if(window.event)
key = window.event.keyCode; //IE
if(window.event.ctrlKey)
isCtrl = true;
else
isCtrl = false;
else
key = e.which; //firefox
if(e.ctrlKey)
isCtrl = true;
else
isCtrl = false;
//if ctrl is pressed check if other key is in forbidenKeys array
if(isCtrl)
for(i=0; i<forbiddenkeys .length; i++)
//case-insensitive comparation
if(forbiddenKeys.toLowerCase() == String.fromCharCode(key).toLowerCase())
alert(Key combination CTRL +
+String.fromCharCode(key)
+ has been disabled.);
return false;
return true;
I have this function in the correct js page of my application but the script doesnt get executed and still iam able to do ctrl+v on the text box can anyone suggest waht i might be doing wron
You can try this..
Instead of using button
Edit the Item to which you want to associate a button.
Go to Element tab
Under Post Element Text enter
</ br> <a href="#" -onclick=call_me() class="t20Button">Click me</a>Note : you need to change class="t20Button", i'm using theme 20 and in that the look and feel of button is derive from t20Button.
remove the hyphen before onclick ..
Regards,
Shijesh
Similar Messages
-
How to call Java script from java code?Can Jscript be executed at server?
Hi All,
We are using 'WebTrends' tool to analyze our site usage pattern.
To use WebTrends, we need to :
1) call Java Script code from the java code
2)Java script has to be executed at server.
Please comment on two points mentioned above. If yes, please let me know how to do them?
Thanks in advnce,
Regards,
GangaYou can check out Rhino project.
[http://www.mozilla.org/rhino/] -
Calling javaFX script from Java program
I am trying to call JavaFX script from a simple Java program. code as follows:
import java.io.*;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
public class My{
public static void main(String[] args) {
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByExtension("fx");
try {
InputStreamReader reader = new InputStreamReader(My.class.getResourceAsStream("first.fx"));
engine.eval(reader);
reader.close();
} catch (Exception e) {
e.printStackTrace();
my first.fx file code is here:
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.text.Text;
import javafx.scene.text.Font;
import javafx.scene.text.TextAlignment;
Stage {
title: "My First JavaFX Sphere"
scene: Scene {
width: 250
height: 250
content: [
Text {
font: Font { size: 24 }
x: 20, y: 90
textAlignment: TextAlignment.CENTER
content:"Welcome to \nJavaFX World"
} //Text
] // content
} // Scene
} // Stage
I am not able to run My.java. runtime error as follows:
java.lang.NullpointerException
Kindly correct me, where I am wrongI am able to call .fx file from Java. Thank you all for helping me to resolve this problem
Regards,
Ritu -
I am facing a problem in running a PERL script in JAVA in UNIX box..
I am able to call ther perlscript.
Perl script has
#! /usr/local/bin/perl
print "\nEnter Your Name :";
$name = <>;
print "\nYour Name is : $name\n";
exit 0;
Perl script request for the INPUT(name) .
My Java program is
File perlfile = new File("test.pl");
Runtime runtime = Runtime.getRuntime();
Process process = runtime.exec("perl "+perlfile);
Here is the problem tat IT IS says error =2 ..What has to be the solution so tat i can CALL PERL SCRIPT as similiar to running it separatly in prompt { >perl test.pl }
PLEASE help me on this....In the PERL SCRIPT (test.pl)
LINE 1 : #! /usr/local/bin/perl
LINE 2 : print "\nEnter Your Name :"; .
LINE 3 : $name = <>;
LINE 4 : print "\nYour Name is : $name\n";
LINE 5 : exit 0;
When i run this script in perl test.pl in prompt (UNIX BOX), i am gettin the request for name "Enter Your Name:____ " but when i call this script from Java it doesn't request for name and moreover the process doesnt ends (use ctrl+c to come out of the process).When i come out forcefully it shows the ERROR=2.
My requirement is such tat need to call a PERL SCRIPT from java so tat java process give the control to PERL script and it will continue the process..
Sample scenario:
Java move a file and store it in a new FOLDER
MY perl script will read the file in new FOLDER.
here the perl script will get the file name for processing... My issue comes here .$name is not be prompted while calling thro java.. -
Run Java Script from a page proccess
How do I run the following java script from a page process (PL/SQL anonymous block e.g.):
javascript:popUp2('f?p=&APP_ID.:70:&SESSION.::&DEBUG.::P70_HEADER_ID:', 700, 700);
Adding this to a button URL target is not a problem. Is this possible at all?
Denes KubicekI dont quite understand. Page processing occurs inside the Oracle database server. After page processing is complete, the HTML DB engine branches to the page as per your branching logic and proceeds to render that page. Javascript is a client-side scripting language.
What does it mean for a Page process to launch a Javascript popup window? Where would that window show up?
What you probably want is to set some session state in your page process and then write a Javascript function to do whatever you want and attach that to the body onLoad event to popup your windows when the page renders.
Thanks -
Calling JavaFX Script from JavaScript on mobile
Hi,
We are developing a application which would run on a mobile. We have to call javafxscript from javascript in this application. Is there a way to do this on a mobile application. I am able to do this for application running on browsers.
Will javafx mobile application support this Calling JavaFX Script from JavaScript?
Please share any information related to this.
Regards,
SherlynI doubt it (but I can be wrong!).
javafx.stage.AppletStageExtension is only on the desktop profile.
[Calling From JavaScript to JavaFX Script|http://javafx.com/docs/tutorials/javafx-javascript/] article states "+this functionality requires Java SE 6 Update 10 at minimum+" which seems incompatible with mobile usage.
Beside, a quick Google search hints that JavaScript support on mobile browsers is weak or inexistent (depending on browsers). -
Calling ASP script from APEX button passing Bind variable
I am looking for some examples or best form for calling asp script from apex button that will pass apex bind variable to asp script to process.
Thanks,s
BobI am surprised by the degree of no replies. I have solved this by using asp redirects such as:
Response.Redirect("test.aspx?UserName="&user)
My formulated solution contains a page with a manually built interactive report. I have a number of bind variables at the top of the reoprt where users can query the information they want based on desginated database columns for this particular report. Once they have the "manual" interactive report displaying what they want, they click a button where a asp script is called with parameters passed that calls a Java based Crystal Reports plugin with the called correspnding report displayed with passed parameters.
Works like a charm!
This solves our reporting needs without having to resort to Bi Publisher (much too expensive) and other third party applications that kinda indicate it can work with apex but provide limited help or best form for doing so.
Bob -
Calling SAP scripts from WEBDYNPRO
Hi
We need to call SAP scripts from WebDynpro application. As per my understanding we need to do following steps
Create a new RFC function module and create sap script output in PDF format.For this
- use OPEN_FORM , by assigning TDGETOTF='X' in the Options(Structure
ITCPO).
- call function module CLOSE_FORM with option OTFDATA
- convert OTF data to PDF by using function module CONVERT_OTF_2_PDF
Now I would like to know how to display the PDF string from WebDynpro.
Please help....
Regards
SujithHi,
You can call by creating external window method.
create LINK to URL or LINK TO ACTION according to requirement, for this. write code in onaction of that.
data: iv_url type string value 'http://<server>:<port>/sap/bc/gui/sap/its/webgui?~transaction=*se38 RS38M-PROGRAMM=rsparam;DYNP_OKCODE=SHOP'.
data: api_component type ref to if_wd_component,
window_manager type ref to if_wd_window_manager,
window type ref to if_wd_window.
api_component = wd_comp_controller->wd_get_api( ).
window_manager = api_component->get_window_manager( ).
window = window_manager->create_external_window(
url = iv_url
modal = abap_false ).
window->open( ).
Cheers,
Kris. -
Calling GUI Scripting from ABAP program
Is it possible to call GUI Scripting from ABAP and thus to use GUI Scripting as an alternative to CALL TRANSACTION?
Is the class CL_JAVA_SCRIPT suitable to access GUI Scripting engine? Accessing ABAP data object would work as well in this case as i think. What SAP Logon and WAS releases are required? Is the 6.20 release sufficient for this case?
I would appreciate if somebody could post an example.Hi,
CL_JAVA_SCRIPT has nothing to do with SAPGUI Scripting.
Calling SAPGUI Scripting API from ABAP could be possible for programmes experienced with OLE automation calls from ABAP coding.
The hardest thing will be, to access the scripting engine handle as an entry point. Once you have a handle in your abap session, any api function can be invoked.
Best regards
Jens
BTW: SAP testtool eCATT does call SAPGUI-Scripting from ABAP. -
Calling Python Script from LabVIEW
Hello Everyone,
I want to call the Python script from LabVIEW.
I tried with using at the command line but i am unable to run that script file..
i have gone through LabPython but i am unable to call the scripts from there also..
If someone has an example of a VI which invokes a python script, it will be very helpful...
Thanks a lot in advance
Regards
Avniavni wrote:
I have to invoke the Script file at command prompt.
Can you descriobe your restriction(s) concerning "invoke the script at the command prompt"? There may be ways around that. -
Calling Ant script from Jdeveloper
Hello Gurus,
I am trying to call Ant script from Jdeveloper.
I am able to call it when i don't use any javac in ant script.
But as soon as i include a javac command
<javac srcdir="${src}" destdir="${build}"/>
I get below error
C:\ant\windows\svn\AntJava\Project1\build.xml:20: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "C:\Oracle\jdk160_24\jre"
Needless to say i already have implemented all the steps mentioned in the internet.
I have my JAVA_HOME correctly set in my PATH environment variable.
I have tools.jar in the CLASSPATH
Please give a solution from JDeveloper perspective and not a generic one as i am done with all the steps provided in internet.any one?????
-
Call TCL script from TestStend or CVI
Hi
I would like to call TCL script from TestStand or CVI.
It’s possible ? and what do I need for it ?
T.UHi,
here is a link to an example
http://zone.ni.com/devzone/explprog.nsf/6c163603265406328625682a006ed37d/e1d9dbb13c6119f786256a3000696642?OpenDocument
Hope this helps
Regards
Ray Farmer
Regards
Ray Farmer -
Not able to call sql script from shell program
Hi Gurus,
I am facing issue while calling sqlplus script from my shell program. Please find below my shell script. This program I've written and registered as for one of concurrent program
in oracle applications.
p_userid_passwd=$1
p_appl_login=$2
p_user_name=$3
p_request_id=$4
v_conc_request_id=${5}
p_to_role=${6}
p_from_role=${7}
p_subject=${8}
p_body=${9}
p_dist_list=${10}
v_request=${11}
v_file_path_name=/u01/oraspt/REQUEST
cd $APPLCSF/$APPLOUT
echo "v_conc_request_id" $v_conc_request_id
echo "p_to_role" $p_to_role
echo "p_from_role" $p_from_role
echo "p_subject" $p_subject
echo "p_body" $p_body
echo "p_dist_list" $p_dist_list
echo "v_request" $v_request
ls -l $v_request
if [ $? -ne 0 ]
then
echo "No output request generated"
else
echo "Output request generated"
fi
echo "connecting to ftp for placing out file to DB server"
echo FTP to 99.60.17.11
echo username: "oraspt"
echo pw:
ftp -i -n 99.60.17.11 << EOF2
user "oraspt" orakdk
cd $v_file_path_name
put $v_request
bye
EOF2
output=`sqlplus -s /nolog <<EOT
whenever sqlerror exit failure;
connect apps/apps
set verify off;
set serveroutput on size 120000;
DECLARE
l_errbuf varchar2(300);
l_retcode varchar2(300);
BEGIN
XXFND_SEND_MAIL.SEND_NOTIFICATIONS( errbuf => l_errbuf
, retcode => l_retcode
, p_request_id => $v_conc_request_id
, p_to_role => $p_to_role
, p_from_role => $p_from_role
, p_subject => $p_subject
, p_body => $p_body
, p_dist_list => $p_dist_list);
EXCEPTION
when others then
dbms_output.put_line('Error encountered :'||SQLERRM);
END;
EOT
`
echo "connecting to ftp for deleting output file"
echo FTP to 99.60.17.11
echo username: "oraspt"
echo pw:
ftp -i -n 99.60.17.11 << EOF2
user "oraspt" orakdk
cd $v_file_path_name
delete $v_request
bye
EOF2
echo "Deleted successfully"Output for script is as below
v_conc_request_id 451906
p_to_role DC.DKHOO
p_from_role DC.DKHOO
p_subject Receivable audit report10
p_body Please find Audit Report Attachment.
p_dist_list
v_request o451906.out
-rw-r--r-- 1 applspt dba 2368 Dec 28 15:06 o451906.out
Output request generated
connecting to ftp for placing out file to DB server
FTP to 10.60.17.11
username: oraspt
pw:
connecting to ftp for deleting output file
FTP to 10.60.17.11
username: oraspt
pw:
Deleted successfullyPlease let me know how to trigger pl/sql script.
Thanks in advance for your help.
Regards
Nagendra
Edited by: 838961 on Dec 27, 2011 11:25 PMPlease find output as suggested, I've placed set -x in script.
+ p_userid_passwd=APPS/APPS
+ p_appl_login=1110
+ p_user_name=DC.DKHOO
+ p_request_id=451949
+ v_conc_request_id=451945
+ p_to_role=DC.DKHOO
+ p_from_role=DC.DKHOO
+ p_subject=Receivabless
+ p_body=report
+ p_dist_list=
+ v_request=o451945.out
+ v_file_path_name=/u01/oraspt/REQUEST
+ cd /u01/applspt/inst/apps/SPT_nfs-stg-app1/logs/appl/conc/out
+ echo v_conc_request_id 451945
v_conc_request_id 451945
+ echo p_to_role DC.DKHOO
p_to_role DC.DKHOO
+ echo p_from_role DC.DKHOO
p_from_role DC.DKHOO
+ echo p_subject Receivabless
p_subject Receivabless
+ echo p_body report
p_body report
+ echo p_dist_list
p_dist_list
+ echo v_request o451945.out
v_request o451945.out
+ ls -l o451945.out
-rw-r--r-- 1 applspt dba 2368 Dec 28 15:54 o451945.out
+ '[' 0 -ne 0 ']'
+ echo 'Output request generated'
Output request generated
+ echo 'connecting to ftp for placing out file to DB server'
connecting to ftp for placing out file to DB server
+ echo FTP to 10.60.17.11
FTP to 10.60.17.11
+ echo username: oraspt
username: oraspt
+ echo pw:
pw:
+ ftp -i -n 10.60.17.11
++ sqlplus -s /nolog
+ output=Connected.
+ echo 'connecting to ftp for deleting output file'
connecting to ftp for deleting output file
+ echo FTP to 10.60.17.11
FTP to 10.60.17.11
+ echo username: oraspt
username: oraspt
+ echo pw:
pw:
+ ftp -i -n 10.60.17.11
+ echo 'Deleted successfully'
Deleted successfully -
Calling shell script from apex application
Please let me know if anyone has tried Calling shell script from apex application, it would be nice enough if you can share how you did it? Thanks
Hi,
Requirements
* CREATE JOB (10g Rel.1)
* CREATE EXTERNAL JOB (10g Rel.2 / 11g)
* EXECUTE on dbms_scheduler (granted to public by default)
Since Oracle 10.2.0.2 the commands are executed as user nobody.
Code:
--Create a Program for dbms_scheduler
exec DBMS_SCHEDULER.create_program('RDS2008','EXECUTABLE','c:\ WINDOWS\system32\cmd.exe /c echo 0wned >> c:\rds3.txt',0,TRUE);
--Create, execute and delete a Job for dbms_scheduler
exec DBMS_SCHEDULER.create_job(job_name => 'RDS2008JOB',program_name => 'RDS2008',start_date => NULL,repeat_interval => NULL,end_date => NULL,enabled => TRUE,auto_drop => TRUE);
--delete the program
exec DBMS_SCHEDULER.drop_program(PROGRAM_NAME => 'RDS2008');
--Purge the logfile for dbms_scheduler
exec DBMS_SCHEDULER.PURGE_LOG;
This is one way as suggested by Trent.
We can also achieve as follows.
http://www.dba-oracle.com/t_execute_shell_script_plsql_procedure.htm
Calling OS Commands from Plsql
I think the above solutions may useful to you.
Let me know if you are facing any problem.
Thanks and Regards
Maheswara -
Calling PERL script from scheduler
Hello All,
I am trying to call PERL script from dbms_scheduler which makes the database connection using DBD module to read some values to perform the operation. My scheduler job kept failing with the following error:
ORA-27369: job of type EXECUTABLE failed with exit code: No such file or directory
STANDARD_ERROR="install_driver(Oracle) failed: Can't load '/usr/lib/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.10.1: cannot open shared object file
It can't open libclntsh.so.10.1 file when I run the job, I guess because in job session, it creates a new shell and doesn't inherit the .profile and none of the environmental variables get set. When I run the PERL script manually it works because of all the env variables, so I put all those variables from my .profile into PERL script itself using ENV function but it still doesn't work, failed with very same error. And yes I do set LD_LIBRARY_PATH to point to $ORACLE_HOME/lib directory. Moreover, if I run the PERL script manually from a shell where I dont inherit .profile, it fails with very same error, so it is related to the environment issues but I have no idea how to fix it. I read somewhere the setting those env variable in PERL script itself doesn't help because by the time PERL get executed all the compilers are already initialized and and they don't use those environement variables anymore then. So the question is how to make it work?
I would really appreciate if someone can help me fixing this, it's gonna change my life here :)
DB Version: 10.2.0.2 (also tested on 11R2, same problem)
OS: SUSE Linux 64 bit
And here is my libclntsh file in $ORACLE_HOME/lib
$ls -l libclnt*
lrwxrwxrwx 1 epsora epsdba 52 2009-09-15 13:39 libclntsh.so -> /u01/app/epsora/product/10.2.0/lib/libclntsh.so.10.1
-rwxr-xr-- 1 epsora epsdba 20274415 2009-09-15 13:39 libclntsh.so.10.1
-rw-r----- 1 epsora epsdba 36840968 2009-09-15 13:38 libclntst10.a
Please let me know if you need more information about this setup.
Thanks
Daljit Singh
Edited by: Daljit on Jul 6, 2010 10:06 AMNothing in your post indicates that you created a directory object and granted privileges.
http://www.morganslibrary.org/reference/directories.html
did you?
Maybe you are looking for
-
Problem after I upgrade pacman to 3.1.0
I have this message after I upgrade pacman to 3.1.0: [root@xxxx ~]# pacman -Syu :: Synchronizing package databases... core is up to date extra is up to date community is up to date :: Starting full system upgrade... resolving dependencies... looking
-
Copy of Report created using Report writer
Hi All Can anybody please let me know, how to create a copy of a report created using Report Writer. I dont have a copy of what is there in production and would like to make a copy before changing it. Also if it is possible , can I have a copy of it
-
Hi Friends , Here i am creating 3/4 querys and i want to load the result of these querys results into an transactional ODS ,i want to create varient for each of the query and use in this process .I am not sure that whether we can use Varient in APD P
-
Black screen, red light flashing
I was downloading an app when a screen message told me to restart to continue installation. I pressed the Off button but now, despite pressing the start button, the phone will not come alive, although it was recently charged. There is just a black sc
-
Forms Data-Block based on stored procedures - REF CURSOR feature NOT FUNCTIONING
This topic is related to another topic in this forum titled "FORMS HOW TO SET QUERY SOURCE ARGUMENTS??" I posted my message there as well. I am posting as a NEW TOPIC so that it catches the attention of Oracle Support. I built a data form based on a