on 01-30-2008 6:35 PM
Hi Experts.
I have two views in my applications..
In the first view there is a set of radio buttons which are gouped by key.
with two options debit and credit card. (Type of card is defined as a dictionary type)
on next from first view if credit card is selected it works fine.
but if i try to come back to the view previous view and click the other option second time.
The value of card type is not changed. IT still takes the value which is selected first.
It looks like its gettign cached .
Is there any any way I can refresh the variable value on next button click from first view
Thanks,
James
James,
use the wdDoInit() method of the first View to do the following,
wdContext.node<YourNode>().setLeadselection(-1);
This way u will find selection cleared for the radio button whenever your view is displayed.
Regards
Deepak
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks guys, I will try them and let you know
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
When you switch back try to set the leadselection to -1 for the node bound to the radio button group.
wdContext.node<YourNode>().setLeadselection(-1);
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I am not carrying the selected value in the next view. So, how cna i select the current context element of the view to no selection. Here in my application one debit card is slected the values is in controller context and not in second view. It executes a bapi ans output theresults in second view.
I tried as you suggested it didnt work.
Thanks,
James
Hi ,
When u switch back to your first View ... for outbound Plug a method will be created set to NO_Selection
in that method... this method will be executed when ever you switch back to view1 from view2.
public void onPlug<plugname>
{
//lead select to NO_Selection
wdContext.node<name>().setLeadSelection(wdContext.node<name>().NO_SELECTION);
}
Thanks,
Sunitha Hari
Hi Deepak and Hari,
I got you guys. But under my context, I dont have any node.. All I have is values attributes. When I Set lead selection to no selection or -1. Then it would the cardinality vlaue would not let it do.
In my context, element are in the following struchure
Context (parent)
CardType(child)
verifciation(child)
Her ein my second view init() module
I have
if (wdContext.currentContextElement().getfinancetype().equals("1Pos"))
wdContext.currentContextElement().setCARDVisible(WDVisibility.NONE);
else
if(wdContext.currentContextElement().getFinanceType().equals("2Pos"))
wdContext.currentContextElement().setCARDVisible(WDVisibility.VISIBLE);
This works ifne when I hit next on the first for the first time.
But when I go back from second view and change financetype option on the first view.
Later If I navigate to the second view. I would see the value in context is changed. But, the above given code is not executed. As far as I understand. Every time plug is fired the target view init() statement needs to be executed. But its not happening here.
Can any one let me know how the if I have explicitly call the init() or what to do?
Hi James,
The hook method wdDoInit() i.e. only first time is executed only once in view's life time. If you want to execute the the code whenever you navigate ti the second view, You have to keep this code in onPlugfromXXX() method. Even you can call your init() method in onPlugfromXXX() method but I don't think this is a proper way.
regards,
Siva
Hi James,
You can set radiobutton to default value like this:
wdContext.currentContextElement().set<Attribute>("any default value");
If you want to set it empty
wdContext.node<name>().setLeadSelection(wdContext.node<name>().NO_SELECTION);
It is better to have this part of code when you are navigating back to this view i.e. onPlugFromview2() method;
regards,
Siva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.