cancel
Showing results for 
Search instead for 
Did you mean: 

Couldn't complete tutorial u0091Integrating EJB 3.0 into Web Dynpro ... '

Former Member
0 Kudos

Hi All,

I am trying to complete the “Integrating EJB 3.0 into Web Dynpro Using the EJB Model Importer” tutorial that goes with SAP NetWeaver Composition Environment 7.1 SP3 Developer Studio.

Does anyone ever completed this tutorial because I have problems completing it. The result is very important for me because I need to use this technology for my essay.

In this tutorial you create a button that calls the method StudsBean.getStudent(String). In this method the object student is created and it will be returned. In several labels the information of the returned student should be displayed. But that doesn’t happen, when I push the button no error occurs but the labels are still empty. When I try to debug the Enterprise Bean and Web Dynpro application I see that the method StudsBean.getStudent(String) is called and the property’s are set and the student object is returned, but still it isn’t displayed.

After discussing this with a colleague I tried to search for a solution on the SDN and of course Google. First I thought I would be a bug but I only found 2 people with the same problem. I found it remarkable because it’s one of the key subjects of Java EE 5 and it’s a tutorial displayed in the welcome page of the Developer Studio.

So do you people think it’s a bug in WebDynpro? Because I am sure that I followed all the steps mentioned (a colleague checked it even).

Regards,

Sander

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Sander,

Do you invalidate the Response:

wdContext.nodeResponse().invalidate();

You need to do this in order the UI to be refreshed. This is mandatory for context elements with cardinality ONE.

Have you happened to check for any exceptions caught in the WD application code?

Best regards,

Vesselin

Former Member
0 Kudos

Hi Vesselin,

Thank you for the quick replay, this is the code I'm using:

public void onActionGetStudent(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
  {
    //@@begin onActionGetStudent(ServerEvent)
	     try {

	         // executes the corresponding method on the session facade
	    	 
	         wdContext.currentRequest_StudsLocal_getStudentElement().

	         modelObject().execute();

	         

	         // forces Web Dynpro to re-create the Request model object

	         // in order to clear the InputField

	        wdContext.nodeRequest_StudsLocal_getStudent().invalidate();

	         

	         // updates the UI elements bound to the Response node

	         wdContext.nodeResponse().invalidate();
	         
	         //Code for trying something out
	         //wdContext.nodeReturn().invalidate();
	         //wdContext.nodeAddress().invalidate();

	      } catch (Exception e) {

	         throw new RuntimeException(e);

	      }

Have you tried this example yourself, or is replay based on experience?

Kind Regards,

Sander

0 Kudos

Hi Sander,

Yep, I've tried the same example by myself. And it works fine.

I think I have seen similar issues reported - can you please try commenting the line when the Request is invalidated? If does not help - you can also try skipping response invalidation... But first only the Request

Cheers,

Vesselin

Former Member
0 Kudos

Hi Vesselin,

Thanks for the quick replay, it works, thank you very much. But I hate it that is was commenting one line, I couldn't work for a few days and it was just commenting one line ahhr.

Again thanks a lot,

Sander

Answers (0)