on 07-30-2012 8:30 AM
Hi All,
I am trying to develop Hybrid Workflow app using SUP 2.1.2.
I was wondering, how can we get and set the values to screen elements like input (Edit Box).
I came to an situation where i need to get the value of one Edit Box from one screen and set that value to another Edit Box or Label on other screen.
Can anyone help me, i want to do it using jQuery/HTML....
Your help will be appreciated.
Thanks & Regards
Saket
Hi Saket,
You may try the following code :
Get value from editbox:
var test = $("#<screenName>Form #<editBoxID>").val();
Set to editbox :
var test = "test12";
$("#<screenName>Form #<editBoxID>").val(test);
Regards
Tahir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can use customAfterNavigateForward for both:
function customAfterNavigateForward(screenKey, destScreenKey) {
var test;
// for the first screen
if(screenKey === "startScreen" && destScreenKey === "firstScreen"){
test = $("#<screenName>Form #<editBoxID>").val();
}
// for the second screen
if(screenKey === "firstScreen" && destScreenKey === "secondScreen"){
$("#<screenName>Form #<editBoxID>").val(test);
}
}
Regards
Tahir
Hi Tahir,
I tried your code but field on other screen didnt display the value from fist screen.
I did as following :
Screen and keys and edit box details on screen are as follows:
1. Screens: Start Screen, screenKey:Start_Screen, EbitBox name: Name, EditBoxID: NameKey
2. Screen : First Screen, ScreenKey: First_Screen.
3. Screen: First Screen Details, ScreenKey:First_Screen_Details
4. Screen: Last Screen, ScrenKey: Last_Screen, EditBox name: newName, EditBoxID:newNameKey
I went to Custom.js file and wrote following code:
function customAfterNavigateForward(screenKey, destScreenKey) {
var test;
if(screenKey === "SStart_Screen" && destScreenKey === "First_Screen"){
test = $("#<Start Screen>Form #<NameKey>").val();
}
if(screenKey === "First_Screen_Details" && destScreenKey === "Last_Screen"){
$("#<Last Screen>Form #<newName>").val(test);
}
}
Here i am entering value on Start Screen to EditBox:Name = (eg. John)
Now on click of button: 'Show' of start screen it will navigate to 'First Screen' and then 'First Sreen Details',
where i will click on Button : 'Next' and navigate to Last Screen where i am having another EditBox:newName where i want to display value of Name (John).
So i will enter the value on Start Screen and i want to show that value on Last Screen.
while generating package i uncheck the option of 'Generate'.
Please correct me, where i did the mistake.
Thanks & Regards
Saket
Hi Saket,
If you design some part of the application manually then you have to uncheck "Generate" cause it deletes all design and re-create them.
try the following code
function customAfterNavigateForward(screenKey, destScreenKey) {
if(destScreenKey === "Last_Screen"){
var test = $("#Start_ScreenForm #NameKey").val();
// put an alert make sure u get the value.
alert(test);
$("#Last_ScreenForm #newNameKey").val(test);
}
}
Regards
Tahir
You are welcome saket, actually there is no specific document which related to sup. You can find many jquery exapmles on internet.
And there is also Sup Apps group which discussing only HWC applications you can find some examples
https://cw.sdn.sap.com/cw/groups/sup-apps
Regards
Tahir ÖZ
Thanks Tahir,
Can you please help me in Server Initiated Workflow app, you have already replied to that discussion of mine post, Please help me to complete that.
http://scn.sap.com/thread/3211729
Thanks & Regards
Saket
Hi Tahir,
I have one query related to jquery,
i have one filed which string (eg.: The Purchase Requisition Number(prnum) is 10000212 ).
So I want to get only the prnum and want to prefix with remaining zeros as per the data length of that field.
eg. prnum = 0010000212 .
so how to cut the sting and padd with zeros.
I have open the new discussion you can reply there.
Hi Saket
i just displayed a list of items..normally after cllicking on a list it shows the detail of particular list...instead of it..i was trying to get a value from listview directly and display into editbox which i was creating to display the details of particular list...
For example
xxxx
101
aaaaa
yyyy
102
bbbbb
this is my listview after clicking on particular list it shows the detail view like this..
name : xxxx
number:101
class :aaaaa
instead of it..i had develop my own detail view by creating editbox..i just try to get the value from the listview and show it to the editbox...it's not working
while am getting and just try to display it to alert box..it shows undefined...
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.