Executing code in form of String object
hi to all,
I don't know if it's the right place to ask such a question, but at least, I can try my chance :)
Can I execute code originally written in a text area (JTextArea) (i.e. in form of a String object) as if it was code already embedded in the code flow ??
There are several solutions.
As suggested above use Runtime.exec() to compile it. You can do this either by having the user enter the entire class or by having the enter only a portion which you then wrap (they write a method, or some rules in a method, etc.)
There is a VM/version specific interface that allows you to compile without Runtime.exec() . You can search the site for examples of this.
You can also use one of the java embeddable languages if you just what 'code' rather than supporting the entire java language.....search the following page for "Scripting"...
http://flp.cs.tu-berlin.de/~tolk/vmlanguages.html
Similar Messages
-
How do I read two dimentional string object in C through JNI
HI,
I am new to JNI and Java as well. I want to read two dimentional string object passed by java to a native method written in C/C++. Say for example I have declared a two dimentional string object as below:
In Java
class InstanceFieldAccess {
private String [][] originalAddress = new String[][13];
private static native String [] accessField(String [][] referenceAddress);
public static void main(String args[]) {
/// Java code to get the string object and pass the string object to native method
new InstanceFieldAccess ().accessField(referenceAddress);
static {
System.loadLibrary("ReadStr");
In C/C++
I want to read the passed two dimentional string array in C/C++ native code and do the further processing and pass the string
back to Java class.
Could anybody tell me how to write the corresponding C/C++ native method.
Thanks in Advance.
Pramod.i got it thanks.
-
Execute code from a string?
I have a Java program that draws lots of different types of curves.
I need to program how to save a drawing to a file.
It would be easiest to make a file that has the string of the code which recreates the drawing.
Is it possible to execute the content of a string?
A trivial example would be you declare an integer
int number
and you execute the string
"number = 10"
so that the value of number becomes 10.
Is this possible?However, how does your program draw the curve in the first place? What I mean is, if it draws the curve in response to some informatiion from the user, why not save that information as text and then draw the curve the same way when the text is read again later.
-
i need to run a piece of code which is inside a string object..is it possible?if so how?
i need to run a piece of code which is inside a string object..is it possible?if so how?
How would anyone know?
You haven't said what 'code' you are talking about or what you mean by 'run' it.
Since you are asking us to 'guess' what you need to do I will guess that it is a valid batch file for your OS. So just save the contents of that string to a file and then use a ProcessBuilder to 'run' it.
See the example in the API
ProcessBuilder (Java Platform SE 7 ) -
How to execute a method from String object?
I have some methods in String objects, example:
String methodOne = "someMethod1";
String methodTwo = "someMethod2";
public void someMethod1() {
public void someMethod2() {
How can i execute that methods, when the method names i have only in String objects?You can get the method directly from the name and parameter types if you want to avoid using the loop:public class Foo27 {
public static void main (String[] args) throws Exception{
String methodOne = "someMethod1";
String methodTwo = "someMethod2";
Object foo = new Foo27();
Method method1 = foo.getClass().getMethod(methodOne, new Class[]{});
method1.invoke(foo, null);
Method method2 = foo.getClass().getMethod(methodTwo, null);
method2.invoke(foo, null);
public void someMethod1() {
System.out.println("someMethod1");
public void someMethod2() {
System.out.println("someMethod2");
}The parameter types are required as there could be more than one method with the same name.
For somereason when I tried to create a new Method object and invoke it, an exception was thrownThere isn't a public constructor for Method, so how did you create a new one?
Pete -
How to Execute a code in form postSubmit event
Dear all,
I have a simple code which is executed perfectly when I put it in form :preSubmit: event but when i moved it to the :postSubmit: event it doesn't work at all .
Please let me know where to put my code if I need it just to be executed once the form submitted ??
Thanks in advanced,
Mohammed Al-MoslehTry using this code:
var vMsg = ""; //message to display for the missing required fieldsvar successflag = 1; //flag to determine if any required field is null
//validate all required text fields
for (var nPageCount=0; nPageCount<xfa.host.numPages; nPageCount++) {
var oFields = xfa.layout.pageContent(nPageCount,"field");
var nNodesLength = oFields.length;
for (var nNodeCount=0; nNodeCount<nNodesLength; nNodeCount++) {
if (oFields.item(nNodeCount).mandatory == "error" ){
if (oFields.item(nNodeCount).rawValue=="" || oFields.item(nNodeCount).rawValue==null){ vMsg += oFields.item(nNodeCount).name + ", ";
successflag = 0;
---------write your code
if (successflag == 1)
execute the insert into database code
else
xfa.host.messagebox(vmsg); //displays the missing field names
Regards,
Chaitanya -
Hello,
First off thanks in advance to anyone who helps. I am trying to write a program that using a class string object to convert this kind of "text speech" to english. For example if the user inputs "HowAreYou?", I want the program to output "How are you?" I am having too much trouble with strings for some reason. This is what I have so far and I am not sure where to go from here. Should I use a do loop to check through the input string until it is done seperating the words? And how should I go about doing that?
import java.util.Scanner;
public class P8
public static void main( String args[] )
char choice;
String line = null;
String answer = null;
Scanner scan = new Scanner(System.in);
do
System.out.println();
System.out.print("ENTER TextSpeak sentence(s): ");
line = scan.nextLine();
System.out.print( "Converted to English: \t ");
System.out.print( textSpeaktoEng( line ) );
System.out.println();
System.out.print("Want more TextSpeak?\t\t ");
answer = scan.next();
choice = answer.charAt(0);
if( scan.hasNextLine() )
answer = scan.nextLine();
}while(choice != 'N' && choice != 'n');
public static String textSpeakToEng(String s)
String engStr = null;
if( Character.isUpperCase( s.charAt(j) ) )
engStr += ? ?;
engStr += Character.toLowerCase( s.charAt(j) );
scan.close();
}I got my program to compile and run but I have a problem. If I input something like "ThisForumIsGreat" it will output just "t f i g" in lower case letters. Any suggestions?
import java.util.Scanner;
public class P8
public static void main( String args[] )
char choice; // Repeat until n or N
String line = null; // Sentences to toTextSpeak
String answer = null; // Repeat program scan
Scanner scan = new Scanner(System.in); // Read from keyboard
do
System.out.println();
System.out.print("ENTER TextSpeak sentence(s): ");
line = scan.nextLine(); // Read input line
System.out.print( "Converted to English: \t ");
System.out.print( textSpeakToEng( line ) );
System.out.println();
System.out.print("Want more TextSpeak?\t\t ");
answer = scan.next(); // Read line, assign to string
choice = answer.charAt(0); // Assign 1st character
if( scan.hasNextLine() ) // <ENTER> character
answer = scan.nextLine(); // Read line, discard
}while(choice != 'N' && choice != 'n'); // Repeat until input start n or N
public static String textSpeakToEng(String s)
String engStr = null;
int i;
for ( i = 0; i < s.length(); ++i )
if( Character.isUpperCase( s.charAt(i) ) )
engStr += " "; // Append 1 blank space
engStr += Character.toLowerCase( s.charAt(i) ); // Append lowercase
return( engStr );
} -
Adf valueChangeListener autosubmit=true, execute code after update model
Hello.
I'm working with the valueChangeListener and autosubmit="true". I'll try to explain my situation
with an example.
jsp:
<af:form>
<af:panelForm>
<af:inputText
id="value1"
label="Value1"
value="#{index.myObject.value1}"
autoSubmit="true"
valueChangeListener="#{index.changeListener1}"/>
<af:inputText
id="value2"
label="Value2"
value="#{index.myObject.value2}"/>
</af:panelForm>
</af:form>
backing:
public class Index {
private MyObject myObject;
public Index() {
myObject = new MyObject();
public void changeListener1(ValueChangeEvent valueChangeEvent){
doSomethingWithMyObject(myObject);
// ... get/set of myObject
MyObject:
public class MyObject {
private String value1;
private String value2;
public MyObject() {}
//getters/setters...
}In the line doSomethingWithMyObject(myObject) i need myObject with the actual values in the user form.
in the example above, the first time the page is rendered and shows the inputs
if the user captures something in the 1st input and then hits the tab to go to the other input
the valueChangeEvent is fired, and the code in "index.changeListener1" executed, but at this moment
the model (myObject) hasn't been updated with the data that the user entered (Validation Phase).
So i need a way to execute my code called from the "valueChangeEvent" but after the model has been updated
Some notes about my problem:
- The doSomethingWithMyObject(myObject) could update data in myObject
- About binding="#{x.y}":
I know i can use the binding attribute in the tag <af:inputText binding="#{x.y}"> and then in the code of
the changelistener the binded component always have the most recent value from the user,
but i cant' use that, the method needs a MyObject instance.
- I don't think create a new instance of MyObject and populate it every time the event fires is a good way
- doSomethingWithMyObject" is a black box, so i don't know what is going to do with myObject
- In my problem there are more than 2 inputs there will be N components M listeners.
What I'm trying:
PhaseListener:
I have been implementing a solution with a PhaseListener like
public void afterPhase(PhaseEvent phaseEvent) {
// just after UPDATE_MODEL_VALUES phase
FacesContext f = FacesContext.getCurrentInstance();
Index i = (Index) f.getApplication().createValueBinding("#{index}").getValue(f);
// at this point the model is updated
doSomethingWithMyObject(i.getMyObject);
public PhaseId getPhaseId() {
return PhaseId.UPDATE_MODEL_VALUES;
this works but i don't know if this is the answer according to this post (unanswered at this time):
http://forums.oracle.com/forums/thread.jspa?threadID=611643
says something about that PhaseListener is not thread safe and blocks the application with more
than 1 user.
A wrapper:
using the controls binded to the backing
public class Index {
private MyObject myObject;
private CoreInputText inputValue1;
private CoreInputText inputValue2;
//listener
//getters/setters
} make a wraper like
public class MyObjectW {
private Index index; // wrap the backing index
public MyObjectW(Index index) {
this.index = index;
public String getValue1(){
return (String) index.getInputValue1().getValue();
public String getValue2(){
return (String) index.getInputValue2().getValue();
public void setValue1(Object v){
index.getInputValue1().setValue(v);
public void setValue2(Object v){
index.getInputValue2().setValue(v);
}and then call in the index backing:
doSomethingWithMyObject( new MyObjectW(this)); so it will access to the most actual values from user at the valueChangeEvent
But i really would like some way to execute my code called from the "valueChangeEvent" but after the model has been updated
so i dont need to wrap or implement PhaseListener
what do you think, what do you suggest, have any solution or a way to do what I'm trying?
thank you for your help...
Message was edited by:
akanewstedHello Frank, thanks for the response.
When you say
"If you need an updated object in this listener then you can update it from the value change listener as well"
you mean i can update the object by myself with the value from getNewValue()? or is there another way
to call to update the models at this time ?
I know i have the methods "getOldValue()" and "getNewValue()" in the "ValueChangeEvent" but what if i need
the actual value from the user in other control than the one that fires the event
example
Two inputs:
in the input1 the user enters some data
in the input2 when some data is entered it fires valueChangeListener (autosubmit=true)
in that case what if i need the value the user just entered in the input1 in the valueChangeListener of
the input2.
In general the app I'm working must do:
dynamically generate the controls in the form (inputs, selects etc)
Attach the control values to a model ( <af:inputText value=#{model.x}"/>
sometimes execute some script when a value change in a control (valueChangeListener)
those scripts uses the model (and needs to be an updated model)
script = " if (value2 = 'xyz') then value1='abc'; return true;";
if the model is not updated
the script will use old values and will be wrong
or if the script change some value in the model, when the update model phase occurs the value from
the script is lost.
that's why i need to work directly with the model and not the values in the ValueChangeEvent
Is there a way to use something like an action in the change of a control value?
that way the code will execute in the invoke application phase, can this be done ?
how i can execute code in the invoke application when a valueChangeEvent occurs ?
hope this help to explain more my situation.
Thank you for your help and time. -
Why should I wrap String objects in a class for my HtmlDataTable?
Hi,
Let me describe a basic scenario in which my problem occurs. I have a backing bean and a JSP. The JSP gets a List<String> which is displayed inside a column in an editable HtmlDataTable. Each row in the data table has a UICommandLink that can perform an update to the value in the first column. Hence, the table only has two columns: one input field and one command link.
My problem is this: When I try to execute HtmlDataTable#getRowData() when the command link is pressed, the updated values are not retrieved, but instead the values that have been in the input field before any changes were made. However, if I instead wrap my List objects inside a StringWrapper class (with a String property and appropriate getters and setters) such that I have a List<StringWrapper>, the problem does not occur. Why is this and is there any way to avoid it?
I typed out some code to illustrate my scenario. Example 1 is where the table displays a list of String objects and Example 2 is where the table displays a list of StringWrapper objects.
Example 1: [http://pastebin.com/m2ec5d122|http://pastebin.com/m2ec5d122]
Example 2: [http://pastebin.com/d4e8c3fa3|http://pastebin.com/d4e8c3fa3]
I'll appreciate any feedback, many thanks!Hi,
Let me describe a basic scenario in which my problem occurs. I have a backing bean and a JSP. The JSP gets a List<String> which is displayed inside a column in an editable HtmlDataTable. Each row in the data table has a UICommandLink that can perform an update to the value in the first column. Hence, the table only has two columns: one input field and one command link.
My problem is this: When I try to execute HtmlDataTable#getRowData() when the command link is pressed, the updated values are not retrieved, but instead the values that have been in the input field before any changes were made. However, if I instead wrap my List objects inside a StringWrapper class (with a String property and appropriate getters and setters) such that I have a List<StringWrapper>, the problem does not occur. Why is this and is there any way to avoid it?
I typed out some code to illustrate my scenario. Example 1 is where the table displays a list of String objects and Example 2 is where the table displays a list of StringWrapper objects.
Example 1: [http://pastebin.com/m2ec5d122|http://pastebin.com/m2ec5d122]
Example 2: [http://pastebin.com/d4e8c3fa3|http://pastebin.com/d4e8c3fa3]
I'll appreciate any feedback, many thanks! -
How many java String objects are created in string literal pool by executin
How many java String objects are created in string literal pool by executing following five lines of code.
String str = "Java";
str = str.concat(" Beans ");
str = str.trim();
String str1 = "abc";
String str2 = new String("abc").intern();
Kindly explain thanks in advance
Senthilvirtuoso. wrote:
jverd wrote:
In Java all instances are kept on the heap. The "String literal pool" is no exception. It doesn't hold instances. It holds references to String objects on the heap.Um, no.
The literal pool is part of the heap, and it holds String instances.
[http://java.sun.com/docs/books/jvms/second_edition/html/Overview.doc.html#22972]
[http://java.sun.com/docs/books/jvms/second_edition/html/ConstantPool.doc.html#67960]
You're referring to the JVM. That's not Java.It's part of Java.
There is nowhere in Java where it is correct to say "The string literal pool holds references, not String objects." -
Parse a XML that is inside a String Object???
Hi,
Will I be able to parse a XML that is stored as a String object rather than using a .XML file.Or is there any other way I would be able to access a XML that comes as a parameter to a method call??
~~~~~~~~~~~~~~~~~~~~~
Java Code:
public void notify(org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.NotifyDocument notifyDocument){
//notifyDocument is a XML Response
System.out.println("I am from notify" );
System.out.println(notifyDocument.toString() );
String notifyString = notifyDocument.toString();
String s2="<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
String s3=s2+' '+notifyString;//Want to parse this XML
System.out.println("******************notifyString"+notifyString);
System.out.println("******************s2"+s2);
System.out.println("******************notifyString+S2"+s3);
//Parse the String S3 which contains a well formed XML(I Checked it)
try{
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document document = db.parse(s3);
System.out.println("************** After Parsing **********");
NodeList count = document.getElementsByTagName("wsrf:NewValue");
int number= count.getLength();
System.out.println("**********"+number);
Element f=(Element)count.item(0);
//NodeList count1= f.getChildNodes();
NodeList comment=f.getElementsByTagName("safe:Comment");
int num=comment.getLength();
System.out.println("******** Len 2********"+num);
Element f1=(Element)comment.item(0);
Node n=f1.getFirstChild();
if(n != null)
System.out.println("***********8HEllo**********8");
String s = n.getNodeValue();
System.out.println("***********"+ s);
catch(Exception e){
System.out.println("*****Exception**********"+e);
}~~~~~~~~~~~~~~~~~~~~~~~~~`
Result::
*****Exception**********java.net.MalformedURLException: no protocol <?xml versi
on="1.0" encoding="UTF-8"?> <wsn:Notify xmlns:wsn="http://docs.oasis-open.org/ws
n/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd" xmlns:soapenv="http://schema
s.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns
:xsi="http://www.w3.org/2001/XMLSchema-instance">
<wsn:NotificationMessage>
<wsn:Topic Dialect="http://docs.oasis-open.org/wsn/2004/06/TopicExpression/S
imple" xmlns:safe="http://ws.apache.org/resource/serena/safe">safe:Comment</wsn:
Topic>
<wsn:ProducerReference>
<add:Address xmlns:add="http://schemas.xmlsoap.org/ws/2003/03/addressing">
http://10.236.23.86:8080/pubscribe/services/serenasafe</add:Address>
<add:ReferenceProperties xmlns:add="http://schemas.xmlsoap.org/ws/2003/03/
addressing">
<safe:ResourceIdentifier xmlns:safe="http://ws.apache.org/resource/seren
a/safe">ALF1</safe:ResourceIdentifier>
</add:ReferenceProperties>
<add:PortType xmlns:safe="http://ws.apache.org/resource/serena/safe" xmlns
:add="http://schemas.xmlsoap.org/ws/2003/03/addressing">safe:MySerenaSafePortTyp
e</add:PortType>
<add:ServiceName PortName="serenasafe" xmlns:add="http://schemas.xmlsoap.o
rg/ws/2003/03/addressing"/>
</wsn:ProducerReference>
<wsn:Message>
<wsrf:ResourcePropertyValueChangeNotification xmlns:wsrf="http://docs.oasi
s-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd">
<wsrf:OldValue>
<safe:Comment xmlns:safe="http://ws.apache.org/resource/serena/safe">c
omment</safe:Comment>
</wsrf:OldValue>
<wsrf:NewValue>
<safe:Comment xmlns:safe="http://ws.apache.org/resource/serena/safe">Q
uick test!</safe:Comment>
</wsrf:NewValue>
</wsrf:ResourcePropertyValueChangeNotification>
</wsn:Message>
</wsn:NotificationMessage>
</wsn:Notify>Submitting a string is the equivalent of telling the document builder to fetch the XML from a given URI. If you already have the string in memory:
DocumentBuilder db = null; // initialize in a spiffy way
Document document = db.parse(new StreamSource(new ByteArrayInputStream(xml.getBytes()));- Saish -
How many string objects - please suggest
Hi there,
Can you somebody please tell how many String objects will be created when the following method is invoked?
public String makinStrings() {
String s = Fred;
s = s + 47;
s = s.substring(2, 5);
s = s.toUpperCase();
return s.toString();
Thanks
ShanHi VShan,
This is your code
public String makinStrings() {
String s = Fred; //1
s = s + 47; //2
s = s.substring(2, 5);//3
s = s.toUpperCase(); //4
return s.toString(); //5
EXPLANATION : String is an immutable object, that means the String object cannot change it's contents.It might sound very unfamiliar but it is TRUE. In line 1: You declare a String object by assigning a a String literal "Fred" to the variable s. Now when you concat "47" with the original contents of s , a new memory space is allocated where s is assigned.+It is important to note+ that the previous reference of s i.e. "Fred" will be lost and now s refers to a new memory location where the contents are "Fred47" , so you have created another object in Line 2. Similarly you create another object in line3 & 4.As far my calculations you have created 4 objects.
I would like you to kindly note that s is already a String so you can directly return s and hence there is no need of s.toString() in Line 5.You should also note that each object is also an eligible candidate for Grabage Collection.
So as soon as Line2 gets executed , the object in Line1 becomes eligible for garbage collection.. that means when GC runs that object will be reclaimed and hence memory will be freed. -
Hi, I have setup PowerPivot 2012 for SharePoint, but when I access'PowerPivot Management Dashboard' in Central Admin I get error message 'An error has occured'
Below is the error in the ULS,
Background file fill operation caught exception: System.Data.SqlClient.SqlException: The EXECUTE permission was denied on the object 'proc_FetchChunkFromDocStreams', database 'SharePoint_AdminContent_ca021d58-ef1f-4f30-9aeb-6f24db24862b', schema 'dbo'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.CompleteAsyncExecuteReader()
at System.Data.SqlClient.SqlCommand.InternalEndExecuteReader(IAsyncResult asyncResult, String endMethod)
at System.Data.SqlClient.SqlCommand.EndExecuteReader(IAsyncResult asyncResult)
at Microsoft.SharePoint.CoordinatedStreamBuffer.AsyncSqlSession.EndExecuteReader(IAsyncResult ar)
at Microsoft.SharePoint.CoordinatedStreamBuffer.SPBackgroundSqlFileFiller.OnReadComplete(IAsyncResult result)
BaseWorkbook.CacheStream: Failed to read from stream. Error was: System.Data.SqlClient.SqlException: The EXECUTE permission was denied on the object 'proc_FetchChunkFromDocStreams', database 'SharePoint_AdminContent_ca021d58-ef1f-4f30-9aeb-6f24db24862b',
schema 'dbo'.
at Microsoft.SharePoint.CoordinatedStreamBuffer.SPBackgroundFileFiller.Fill()
at Microsoft.SharePoint.CoordinatedStreamBuffer.SPCoordinatedStreamBuffer.WaitForIntervalFill(SPInterval i)
at Microsoft.SharePoint.CoordinatedStreamBuffer.SPCoordinatedMemoryStream.Read(Byte[] array, Int32 offset, Int32 count)
at Microsoft.SharePoint.SPFileStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at Microsoft.Office.Excel.Server.CalculationServer.BaseWorkbookManager.CacheStream(CachedFile cachedFile, FileLoader loader)
Regards,
Ayaz
SharePoint ArchitectHey Ayaz,
I do had the same error message when I click on "PowerPivot Management Dashboard". After few research I resolved this issue.
You need to provide the dbReader and dbWriter permission to powerpivot app pool account at "SharePoint_AdminContent_ca021d58-ef1f-4f30-9aeb-6f24db24862b"
Have a great day :-)
Santosh sethi -
Problem in showing value of a string object of jsp to on page
hello there
i have a problem that i m fatching a value from a JavaBean in my jsp page now i want to print that value in my jsp page but i is createing problem
my probelm is that the value which i have been fatching from my javabean contain code like
#include<stdio.h>
#include<conio.h>
void main
int a=10;
printf("%d",a);
getch();
i m getting this code in a variable in a String object myCode
and when i m displaying this using
<%=myCode%>
it is giving output as follows
#include<stdio.h> #include<conio.h> void main { int a=10; printf("%d",a);
getch();}
can you tell me why it is creating a problem
plz help me
thanks in advance
pawan guptaHTML formats in its own special way. It ignores spaces/newlines.
Try using <pre> tags to tell the browser "this is pre-formatted text. Don't screw around with it"
ie
<pre><%= myCode %></pre>
Cheers,
evnafets -
Passing values to form bean string array from dynamic added textboxes
Hi,
I am unable to pass values to form bean string array from a jsp in which I have incorporated dynamically adding of textboxes in javascript.
I have given add/delete row option in the jsp. If there is single row, this is working fine. But after adding a row, I am not able to either do any validations on added textboxes or pass the values to the String array form bean variable.
code snippet:
var cell6 = row.insertCell(4);
var element5 = document.createElement("input");
element5.type = "text";
element5.className = "formtext1";
element5.size = "5";
element5.value = "00.00";
element5.name= "qty"; // this is a string array of the form bean.
element5.onchange=function() {checkNumeric(this);};
cell6.appendChild(element5);
<html:text styleClass="formtext1" property="qty" value="" size="5" styleId="qty" onchange="checkNumeric(this)"/></td>
form bean declaration
private String[] qty; Please help.
Edited by: j2eefresher on Jan 12, 2010 11:23 PMShivanand,
There's no need to post that much code when you could create a very short test case that demonstrates only the problem you are having.
You're using &NAME. notation on something that isn't a page or application item. You can't reference PL/SQL variables that way (or any other way) outside the PL/SQL scope. For your situation, you could create a page item named P55_DOCID and assign it a value in the PL/SQL process (:P55_DOCID := DOCID;), then reference &P55_DOCID. in HTML areas like the success message.
Scott
Maybe you are looking for
-
Before anyone posts stuff about resetting to factory settings etc. or unplugging the modem, i have tried it all. Using a macbook pro and airport express. Internet works great and fast when plugged directly into the modem however when trying to run w
-
Buildcluster.sh failing
Hi All, am facing below error while invoking buildcluster.sh script. please let us know how to resolve below error. Running on racnode1 as root... Oracle RAC 11gR2 OneCommand (v1.2) for Oracle VM - (c) 2010-2011 Oracle Corporation Cksum: [11702
-
I am attempting to redact a large pdf file. When I open the file, it has a bar across the top with the message "please fill out the following form". I can mark redactions, but when I attempt to apply them I get a message saying, "In order to procee
-
Opening a file using Webutil_Host.Host Command
Dear Gurus I'm trying to open a file using following command behind a button on my form: Webutil_Host.Host('x:\03\03\39920000023.gif'); I expected from this command to open the given gif file in default image viewer but it takes no action when I pres
-
WBS Element as Sender and Receiver in New GL Allocation
Dear Experts, Please need your advice how to configure WBS Element as Sender and Receiver in New GL Allocation, since this field is not activated in New GL Allocation (FAGLGA11 - General Ledger: Create Act. Assessmt) ? We already tried to activate th