cancel
Showing results for 
Search instead for 
Did you mean: 

Updating Model Class

Former Member
0 Kudos

If one of the command beans changes then does the jar cantaining all of the command beans need to be re-imported into the Web Dynpro model? Is it possible to just import a class model? Any best practice documentation on importing java beans into Web Dynpro model around?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Currently java bean importer doesn't support reimport functionality

Regards, Anilkumar

Former Member
0 Kudos

I exists a blog entry and a tutorial:

/people/david.beisert/blog/2004/10/26/webdynpro-importing-java-classes-as-model

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/tu... on using ejbs in web dynpro - 20.html

My experiences:

If you must reimport the model because it has changed then the mapping from model to context will be destroyed. I use development components to solve this.

- Create a Web Dynpro development component

- Import the Java Bean model

- Add the created model to the public part

- Create a second Web Dynpro Development Component

- Use the model from public parts of first Web Dynpro Development Component

- Bind the model to context

If the model has changed in the first Web Dynpro Component the mapping between model and context will not be damaged.

Greetings

Thomas

Former Member
0 Kudos

Thanks for help. I'll try this out and see if it works for what I'm trying to do. Is it also true still that complext datatypes can not be imported into the WDP model? They have to be identified as relations? Are there tutorials on this?

Thanks again...

Former Member
0 Kudos

Hi,

you can import an complex type like this:


class BookDTO
{
int id;
String name;
}

class AuthorDTO
{
int id
String name
BookDTO[] books 
}

You can import the class AuthorDTO but you don't can bind the model to an ui element (e.g. table).

If you have complex / structured data then convert it to a flat data transfer object like this:


class AuthorBookDTO
{
int authorId
String authorName
int bookId
String bookName
}

Greetings

Thomas

Former Member
0 Kudos

Hi Thomas,

I tried these steps below but when I try to use the model from the public parts of the first DC I do not get any of the model classes to show up from the public part. I have tried a couple of things like after adding the public part from the first DC to used DC's of my other DC I try to create a model based on importing a java bean from the DC and I also try to just add the model to the Used Models. When I create the public part is there an issue that doesn't allow me to also get the java beans?

Former Member
0 Kudos

I have been able to import the java bean model into one dev. component and create a public part based on the newly created model in that component. I use this model from the public part of the dev. component in a second dev. component. But, if something changes in the java bean model, and it is reimported all the links from model to controller to view context are broken because there is still no way to just update the model instead of completely replace it. Is there really no way to see that the model has only had properties added or deleted so that the links don't have to be completely replaced?

Former Member
0 Kudos

Dora,

Probably this technique helps you

/people/bertram.ganz/blog/2005/10/10/how-to-reimport-web-service-models-in-web-dynpro-for-java

VS