on 05-20-2015 9:23 AM
Hello,
I am trying the next:
If I have the check box selected return the birthday in a textfield.
If I have not the check box selected return "nothing"
************************************************************************
var check = session.findbyid("wnd[0]/usr/boxpersonas_40/chkpersonas_46").selected; // to know if the check box is selected
Go to transaction and get the value // OK
var birth = session......................................
Return to main screen // OK
session.findbyid("wnd[0]/usr/boxpersonas_40/chkpersonas_46").selected = check; // to activate o desactivate the check box, I think that after press the button the checkbox is always NOT SELECTED.
if (check == "true")
{
session.findbyid("wnd[0]/usr/boxpersonas_40/txtpersonas_51").text = birth;
}
else
{
session.findbyid(wnd[0]/usr/boxpersonas_40/txtpersonas_51").text = "Nothing";
}
Thanks!!!
Hi Asier,
It is a challenge to make a global var stored correctly via UI flows. The reason your test is not working could be that your global var also lost its value. Pls do check it first before using it - I will store the value liek args.val before calling other tocde, and after coming back, I can press a test btn to display the global var value is a tmp textbox to see if the value is maintained (I guess it is not in your case). By this way you are 100% sure that global var is working or not. Then, you have to try some ways - in Personas 2.0, I notcied that the "global" values stored in args.val does not always working - but if all your actions are performed inside one main script button which calls a lot other buttons or do tcode, then the value is maintained when come back and you can do check in teh same btn. You can alsso write the value into a hidden text field in some screen as a tmp backup and read it at some other time as a hack. Try it anyway.
Hope this helps you.
Dong
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Let's simplifly the code:
var check = session.findById("wnd[0]/usr/chkPersonas_1").selected;
session.findById("wnd[0]/tbar[0]/okcd").text = "su01";
session.findById("wnd[0]").sendVKey(0);
session.findById("wnd[0]/tbar[0]/btn[3]").press();
session.findById("wnd[0]/usr/chkPersonas_1").selected = check;
Always the value of check is FALSE.
I am stuck with this problem.
I think you need to update your system. Both the things were most likely fixed.
I would recommend you to update both kernel patch and personas. If you are still able to reproduce, then create an OSS.
If you are part of Personas 3.0 ramp up phase, you can send me your email. I will add you to our jam group where we make all these announcements about releases for Personas 3.0, so that you remain on top of things!!
Regards,
Sushant
Without updating your system (of course it would be nice if possible to do so), a workround can bedoing this:
window.myCheckStatus="checked" or "unchecked".
You can change this value in any flavor no matter where you go and back as long as the window is not closed, this value remains. Then you can paste this value to a textbox or check if in JS. I am sure you can restore the check status when coming back. Try it.
Hope this helps. Thanks.
Dong
Hello,
The main problem that I am having, is that when I return to the main screen the checkbox is always unselected.
Do you know how can I solved the problem?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey,
what exactly do you want to achieve? Do you want to have the check box selected as default or do you want to select it, execute your script and have it selected when your script returns to your main screen again?
I think it is possible to store your variable "check" in a "global storage" so the script has the value available when you return to your main screen. I just can't check the command for this right now.
Hi,
I want to press the button and if the checkbox is selected, after press the script button appears selected, and if it is unselected, after press the script button appears unselected.
First I save the varible "check"
After go to the transaction and return to the main screen, a return the value of the variable "check" to the check box but doesn't work.
Can you help me with the javascript code?
Hi Asier,
stupid question but i gotta ask this: Did you debug your script to make sure your variable "check" contains a value at the point you want to select your checkbox? Is this a single script or are there any steps in between that could manipulate the checkbox during execution?
Regards,
Christoph
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Normally its shown by mouseover as you can see here: Debugging options in Personas 3.0 - SAP Imagineering - SCN Wiki
Hi Asier,
Please see the following link:
Debugging options in Personas 3.0 - SAP Imagineering - SCN Wiki
Regards,
Sushant
Hi,
When you go to a new transaction to get the birthday and back, the local UI settings (ie previous ckecked or unchecked status) is simply lost (thus it is always as Unchecked). I guess you have to store the previous "check status" globally. Does this help? Thanks.
Dong
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.