on 02-17-2008 9:31 PM
Hello Experts,
I am using a interactive forma text element on my view. (java web dynpro)
It's a simple application. I am trying to figure out how it works with java script.
I have a text field. which displays employ is sales or production dept
the values in the data view and its the output element of a BAPI which returns XF,TF,HF and XK,JK,HK
(record.dept)
if its XF, TF, HF on the text field in the adobe form should print sales else production.
I have never used java script on adobe form.
I figured the strip above the form in adobe designer is used for java script.
can any one, let me know how I can manipulate. the record value
Here is what I am trying record.dept = XF |TF|JF . but i dont know how to run the java script or its syntax.
Your help is highly appreciated.
James,
Normal Java programming also works in Javascript.So your normal if-else loop will work in javascript as well.
Try this on form:initialize event and change the language to javascript:-
if(record.dept.equalsIgnoreCase("XF")
|| record.dept.equalsIgnoreCase("TF")
record.dept.equalsIgnoreCase("JF"))
{
xfa.host.messageBox("The value is Sales")
}
else
{
xfa.host.messageBox("The value is Production")
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Right, but xfa.host.message box just wondering how it would set the value of the particular textfield when I have mutiple.
I have like 5 testfields on my adobe form. One of the text field value need to be set depending on the condition above.
Is there any way we can access using the Id of the text field to the set the value.
if(record.dept.equalsIgnoreCase("XF")
|| record.dept.equalsIgnoreCase("TF")
record.dept.equalsIgnoreCase("JF"))
textfieldid.value to be set.
James,
xfa.host.messageBox should show you an alert dialog box to check data you are getting.
And yes you are right. You can set the value of textfield using code you mentioned.
if(record.dept.equalsIgnoreCase("XF")
|| record.dept.equalsIgnoreCase("TF")
record.dept.equalsIgnoreCase("JF"))
{
xfa.host.messageBox("The value is Sales");
<Text-field id>.value = "Sales";
}
else
{
xfa.host.messageBox("The value is Production");
<Text-field id>.value = "Production";
}
You can even set the texfields to be readOnly, hide some of them etc. But for that I would suggest you going thru the LiveDesigner help. It would solve most of your doubts :-).
Chintan
Edited by: Chintan Virani on Feb 19, 2008 3:37 PM
Write the following javascript funciton on the click event of the Submit button in your Form.
if(this.parent.textfield.rawValue.equalsIgnoreCase("XF") ||
this.parent.textfield.rawValue.equalsIgnoreCase("TF") ||
this.parent.textfield.rawValue.equalsIgnoreCase("JF") ) {
// Your sales print logic goes here
} else {
// your production print logic goes here.
}
Thanks!
Surya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.