on 04-04-2008 8:27 AM
Hi,
In a view I have created table which contain some data from Database.
Now my issue is
On clickiing the row in the table move to another page where i need to display these row values in label fields.
Can any body please help me the procedure how to get particular row values in second view.
Thanks and Regards,
Shashikiran.B
Hi,
On Action type LeadSelection; you can get the table values and assign to the view context element.
wdContext.currentContextElement().setNameElmt( wdContext.nodeTableRecord().getNameElement());
Create an element of type NameElmt at Controller Context and the second view and map the three using data modeller.
In the second view; bind this NameElmt to the UI element.
This will work.
Regards
- Vinod
*
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shashi,
I believe the node in view1 have been mapped with some node in Component Controller. Now, map the the attributes that you want to display from component controller to view2.
Now create a navigation from view1 to view2. Suppose OutboundPlug in view1 is named as ToView2 and inbound plug in View2 in named as FromView1.
In view1 code create a new action which will be fired OnLeadSelect of the table. In the method associated with this action fire the Outbound plug, ToView2.
Also in view2, create a form using apply template which is bind to attributes of view2's context. (This attributes are mapped to component controller 's attributes as explained earlier).
Regards,
Gopal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thank you for your quick replay .
i have done same thing what you have specified but while selecting the row i am getting the first row values only.
I am unable to get the selected row values.
I need to get the selected row values .
Can any body please help regarding this one.
Thanks in advance.
Regards,
Shashikiran.B
Hi,
For this you need to have mapping of context from parent view to the next detail view via controller.
For navigation purpose you can make use of the navigational plugs.
Fire the plug on the lead select event of the list table of the parent view.
Hope this helps.
thanks & regards,
Manoj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Bind the attributes from the same context which is bound to the table to your text boxes .
Once this binding is done when you select the values it will be shown in the respective columns with out any code.
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 shashi,
Try this
Take a Button(GoToNext) in the First View to copy the First View table selected Selected Row(s) to the Second View Level.
Assuming
First Field table Structure
EmployeeRec(0..n)
|--Ename
|--Eno
|--Esal
Second Filed Level Node Structure
Employee(0..1)
|---Name
|---No
|---Sal
public void onActionGoToNext(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionGoToNext(ServerEvent)
int index = wdContext.node EmployeeRec().getLeadSelection();
wdThis.wdGet<ComponentName>Controller().executeCopy(index);
wdThis.wdFirePlug<Out bound Plug from First view to 2nd view>();
//@@end
}
Take a method (executeCopy) with parameter selIndex of type integer inside component contoller
public void executeCopy( int selIndex )
{
//@@begin executeCopy()
wdContext.nodeEmployee().bind(wdContext.createEmployeeElement());
wdContext.currentEmployeeElement().setName(wdContext.nodeEmployeeRec().getEmployeeRecElementAt(selIndex).getEname());
wdContext.currentEmployeeElement().setNo (wdContext.nodeEmployeeRec().getEmployeeRecElementAt(selIndex).getEno ());
wdContext.currentEmployeeElement().setSal(wdContext.nodeEmployeeRec().getEmployeeRecElementAt(selIndex).getESal());
//@@end
}
Regards,
Mithu
Hi Mithu,
thanks for your quick replay,
I have tried this one but its not matching to my requirements.
My requirement is
I have a table data on selecting a particular row of a table i need to get the field details in next view's text field's.
For that i have mapped same node and attributes for both the views.
By this i am getting only first row values . irrespective to selected row.
But i need to get the selected row values only.
can you please help me out.
Thanks and Regards,
Shashikiran.
Hi Shashi,
Don't know where you are going wrong. For your purpose I created a new project and it's working for me. Follwoing are the steps I had taken:
Step 1:
a. In Component controller created a node "Node1".
b. Under it i created an attribute "att1".
In wdInit() of controller I wrote code as follows:
for (int i = 0; i < 3; i++) {
IPublicComp.INode1Element ele = wdContext.createNode1Element();
ele.setAtt1("" + i);
wdContext.nodeNode1().addElement(ele);
}
Step 2:
Created a navigation from view1 to view2
Outbound plug of view1: ToView2
Inbound Plug of View2: FromView1
Step 3:
mapped Node1 from controller to View1
Step 4:
Mapped attribute att1 from controller to view2's context.
Step 5:
a. In view1, Using apply template created a table for node1.
b. Created an action event for onLeadSelect of table and fired outbound plug as follows:
wdThis.wdFirePlugToView2();
Step6: In view 2
Used apply template, created a form for attribute att1.
After deploying it, when i selected any row of table in view1, i got the respective value in view2.
Regards,
Gopal
Sorry, but why should he write this monster of statement and not just map the node from the view controller and write
wdContext.current<Node>Element()
to get the lead-selected element?
And if he changes the lead-selection of the view controller node (which is mapped to the component controller), then the lead-selection of the origin node is changed automatically.
Armin
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
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.