Skip to Content

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jan 09, 2007 at 11:55 AM

    Hi Susmita,

    you have to fill data into context elements selbst (this element you can bind to Labels or inputfields). In your code, you have read the data but not save it anywhere. Have a look at this tutorial https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/b1a3e990-0201-0010-aeb2-a2ef5bc3da8e passibly that help a little.

    Regards

    Bogdan

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 22, 2007 at 06:40 AM

    Now i am able to dispaly the information.

    Add comment
    10|10000 characters needed characters exceeded