on 05-15-2008 8:46 AM
hi
i have 3 itemlistbox and a table
i am calling the RFC in the init()v method
so all the three itemlistboxes are getting filled
ans also table , but i want only the three
itemlistboxes to get filled with data and the table
to be empty , and as soon as i click the button
table should be populated .
Hi,
In this case nodeM_alldef is my model node and nodeCtx_va_crntxisettings is my value node.Just make sure that watever attributes u r creating must of same type as there in model node.
Even copy service can help but this is a better approach.
wdContext.nodeXiconfcommandbean().bind(new Xiconfcommandbean());
wdContext.currentXiconfcommandbeanElement().modelObject().findAll();
wdContext.nodeCtx_va_crntxisettings().invalidate();
for(int i=0;i<wdContext.nodeM_alldef().size();i++)
{
IPrivateSLDAdminView.ICtx_va_crntxisettingsElement l_xiele;
wdContext.nodeM_alldef().setLeadSelection(i);
l_xiele=wdContext.nodeCtx_va_crntxisettings().createCtx_va_crntxisettingsElement();
l_xiele.setCtx_va_request(wdContext.currentM_alldefElement().getRequest());
l_xiele.setCtx_va_username(wdContext.currentM_alldefElement().getUsername());
String l_pass="";
for(int j=0;j<wdThis.wdGetSLDAdminCompController().mdecoder(wdContext.currentM_alldefElement().getPassword()).length();j++)
{
l_pass=l_pass+"*";
}
l_xiele.setCtx_va_password(l_pass);
l_xiele.setCtx_va_url(wdContext.currentM_alldefElement().getUrl());
wdContext.nodeCtx_va_crntxisettings().addElement(l_xiele);
}
regards
Surender Dahiya
Edited by: Surender Dahiya on May 15, 2008 1:56 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kishore,
You have a model node which you have directly bound to Table. Try doing like this,
1.Create a value node with the similar name as model node name
2. In the model node, you should have used some or all the context attribute. Create a value attribute in value node with the same name as model node value attribute. i.e. for all the attributes used in table.
3. remember, the name should be same and the type of value attribute should be same as model node.
4. Once created, say the model node name is ModeTestNode and value Node name is ValueTestNode. Us the following code in onAction method
WDCopyService.copyElements(wdContext.nodeModelTestNode(),wdContext.nodeValueTestNode());
for this you should also use the following import statment in the Beginning.
import com.sap.tc.webdynpro.progmodel.api.WDCopyService;
Remember, this is a easiest way to copy from node to other. Other wise, you can get the size of model node, loop through the node and fetch the data and populate the data in value node in appropriate value attribute. For do this, the name of attribute need not be same but the type should be compatible.
Bind this Value node to table. and Populate using above code in on action
Hope this helps.
Edited by: shabir rahim on May 15, 2008 1:45 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dont bind table to the model instead create a value node and bind that table to that value node.
This will do one thing as soon as u call RFC in init method ur model node will get filled as u have bind ue table to model node u r getting data.Binding table to other node(value) will make sure that ur table remains empty and whenever u want to display the data fill this value node.Copy data from model node to value node.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Easiest option is to have a seperate node that is populated when you click the button.
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
thanks for response
but in the wddoinit() method i am
calling the rfc , so the table and all the three
itemlistboxes are getting filled , before i click
the button , i have to write code in the init()
such that as soon as the rfc is called only
3 itemlistboxes get filled and tables remains empty.
and next after i click button table should filled
but problem is as iam calling the rfc in the init() method
all the itemlistboxes and table is getting filled
and that should not happen . table should be empty.
Hi,
In this case u need to create a value node with the attributes and bind it to the table.
whenever u want to populate data in this table just create an element of this node copy data from model node to this value node row by row.and display.
This would serve ur purpose.
Regards
Surender Dahiya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
u can set visibility property of table to none using context attr and on click of button set the visibility property to visible
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Create another Node for table and populate value in OnAction of button
nikhiL
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
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.