cancel
Showing results for 
Search instead for 
Did you mean: 

Display data when view loading

Former Member
0 Kudos

I call a Web Service get list, and I want to display inthe first view.

I add the code in WDInit() of the view controller, but can't load data.

wdContext.currentRequest_Test_getListElement().modelObject().execute();
		 wdContext.nodeResponse().invalidate();

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Instead of writing this code in the view controller's wdDoInit, write it in the component controller's wdDoInit. Map the context of the Component controller to the view context.

Regards,

Satyajit.

Answers (2)

Answers (2)

Former Member
0 Kudos

I have worked out. I put these codes in

wdDoInit()

of the view!

Request_Test_getList fbi=new Request_Test_getList();
	wdContext.nodeWebServiceList().bind(fbi);
	
	try {
			   wdContext.currentWebServiceListElement().modelObject().execute();
			   wdContext.nodeResponse().invalidate();
		   } catch (Exception e) {
			   // TODO Auto-generated catch block
			   e.printStackTrace();
		   }

Former Member
0 Kudos

Hi Shen,

move the same code to component controller. are u getting any exception??

regards

Sumit