on 02-13-2008 4:51 AM
HI all
I am trying to create an application which consists of two views
Lets say VIEW 1 and VIEW2
VIEW 1 consists of two input fields and a button
when the user enters the data and click on the button the data must go into the second VIEW which consists of two input fields
inorder to do this i did the required mapping view1 to component controller and component controller to view2
Coming to coding part
In the view1 as I have one button I have created an action for that button Lets say ACITON1 in the implementation of this I have return the coding for getting the values from the first view
My doubt is where I need to write the coding to set the values to the second view
thanks in advance
Hi,
Create 2 value attributes in component controller.
Now map these attributes to view1 as well as view2.
bind the input fields to respective attributes in view1 and view2.
Now create an action in view1 and just fire the plug on that action to navigate to view2.
bind the action to the button.
These are the steps required to pass the values from one view to another.
As the context is defined in component controller so it will share a reference of the context in both the views so that values provided in view1 will automatically be avialable to view2 and no additional coding is required.
Regards,
Murtuza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In your scenario you dont need to code any thing to display data.
What you need to do is create your attributes at the component controller.
map them to both the views
bind them to respective iinputfield and text views.
From the window create a outboung plug from view and an inbound plug in view2
connect the plugs using link.
in the action handler code the fire plug.
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,
In the second view the data will come automatically as you have mapped from view1 to component controller and from component controller to view2.View2 doesnt know any thing about view1 context, but as you have mapped to the component controllers context,the data will appear in the view2.
In the view2 you map the the context attribute to a textview and in view1 button action simply fire the plug which has navigation link to view 2.
Regards,
Sudhir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Whenever u enter the values in the InputFields of first screen those r stored in the value attributes of the context of the first screen.U have told that i have done
context mapping b/n views.So the same data will be
available in the value attributes of the context of the second screen.
If u want to see those values just write the following steps
wdContext.currentContextelement().getVAname();
Regards
Hazrath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
rev!!
If you already mapped two field values from VIEW1 to VIEW2 through Component Context, just the wdFirePlugOut() will get you those to the second view.
in ACTION1() {
wdThis.wdFirePlug<plugname>();
}
regards,
nikhil
xxxxxxxxxxxxxx
Edited by: Armin Reichert on Feb 23, 2008 6:29 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.