Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to display the information

I have defined SearchUser() in bean class and importing this bean to Web Dynpro application.After extarcting data from data base i am storing it in public varilabes.My qury is now how to display all field's information In the ResultView.If i will write system.out.println within bean it won't work in NWDS.How i will display this field's information in My ResultView?

public void SearchUser()

{

Connection connection = null;

try{

Statement st=connection.createStatement();

ResultSet rs=st.executeQuery("select * from Resource where Employee_Id=?");

//System.out.println("result" +rs);

while(rs.next())

{

empId=rs.getString(1);

name=rs.getString(2);

technology=rs.getString(3);

designation=rs.getString(4);

emailId=rs.getString(5);

phone1=rs.getString(6);

phone2=rs.getString(7);

location=rs.getString(8);

photoPath=rs.getString(9);

}//end of while

rs.close();

st.close();

connection.close();

}catch(SQLException se)

{

se.printStackTrace();

se.getMessage();

}

catch(Exception e)

{

e.printStackTrace();

}

}

In the ResultView I am calling

public void onPlugFromMyProfileCompView(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onPlugFromMyProfileCompView(ServerEvent)

IWDMessageManager msgMgr=wdComponentAPI.getMessageManager();

try

{

wdContext.currentMyProfileBeanElement().modelObject().SearchUser();

//wdContext.currentMyProfileBeanElement().modelObject().getEmpId();

//msgMgr.reportSuccess("Congratulations,User Added to the Database tables..inside try");

}

In The ResultView i have taken 9 label and textview to display user information and i also did context mapping from component controller to Resultview.But while running the application it's not displaying the data in the TextView.

Not what you were looking for? View more on this topic or Ask a question