cancel
Showing results for 
Search instead for 
Did you mean: 

invalidating the table

Former Member
0 Kudos

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 .

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

hi

thanks for ur reply ,

how can i copy the mode node data to the value node

will copy service work ?

any code that can help me ?

Former Member
0 Kudos

Hi,

Easiest option is to have a seperate node that is populated when you click the button.

Regards

Ayyapparaj

Former Member
0 Kudos

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.

0 Kudos

Then put two nodes one that recieve data from rfc and other binding to table and when you puch the button fill the second node with data from first

Regards

Former Member
0 Kudos

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

0 Kudos

hi,

u can set visibility property of table to none using context attr and on click of button set the visibility property to visible

nikhil_bose
Active Contributor
0 Kudos

Create another Node for table and populate value in OnAction of button

nikhiL