cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance MAM3.0-problem with view.configure

pvannest
Participant
0 Kudos

Hi,

I'm currently working on enhancements for MAM3.0. More specifically, I'm enhancing NotificationEdit.jsp. I'm adding new inputfields for that page and want to send them towards my backend system. I also added new outputfields on that page. Afterwards, I created a new controller(which extended the old one) with two new methods. onNotificationEditLoad (to populate the context with extra data for my outputfields) and onSave which is needed to save my extra data from my new inputfields). I created a new notificationEdit.view file which extends my old one, to say I'm using a new jsp and a new controller. I also created a view.configure file to say I'm using a new view file.

Here's my problem.

If I'm clicking till I get to the NotificationEdit page, I see he's using my new jsp and my new controller(my extra outputfields are populated). So probably he used my new view file. But then when I'm entering some data in my new inputfields and click on Save, he's is not using my new controller, but the old SAP standard one. So I'm wondering, why is he not using my new notificationEdit.view file (as it is configured in view.configure)? What have I done wrong? Can anyone give me suggestions? Can I do some extra test to see which view file he jumps to, how can I debug that framework a bit more into depth?

thx in advance

Peter

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Peter,

First of all, you have to know that MAM 3.0 Laptop UI layer is generated code. The generator is included as part of MAM as of SR2.

If you only add fields (in or out) and changing the controller, I suggest to use the generator. I think you can find most important information on the XML and the generation process in the generator documentation bundled with MAM.

Anyway, if you decided to go the long way , you will have to edit one more view file. So here is the usual MAM structure for JSP:

webapps/MAM30/notification

webapps/MAM30/notification/NotificationEdit.jsp

webapps/MAM30/notification/edit/NotificationEdit.jsp

The first JSP is loading the second in a frame. Since CAF requires to have a one-one relation between view files and JSP, both must have their view file. (FYI, the second jsp file is were you do your changes and add fields, the other one is a container.) Now witht hte view files:

webapps/MAM30/WEB-INF/notification

webapps/MAM30/WEB-INF/notification/NotificationEdit.view

webapps/MAM30/WEB-INF/notification/content/NotificationEdit/NotificationEdit.view

So the first view file loads the first jsp and the second view file loads the second jsp. To keep the development and enhancement simple, we decided to use only one controller for both jsp/view. So the second view file inherits from the first view file, but change the output jsp.

To recap, you have to create a Z version for both view files. You have to create a Z version for both jsp. You have to change the trigger event for the iframe in the first jsp and add your field to the second jsp. You have to create a Z controller and implement your logic in the load/save method.

I hope this is clear (it would be 2 lines in XML )

Thank you,

Julien.

pvannest
Participant
0 Kudos

Hi Julien,

thx for reply. I must say, in my previous message I kept my explanation very brief to keep my post small But in fact what I did, I created a new Z jsp file in the content directory, that's where I changed my jsp code. I made a new view file in the content dir to say I'm using a new jsp file. Then i made a new view file in the global notification dir to link the existing notification.jsp file with a new controller + i added code to link the onframeload event in event onNotificationEditLoad with the nieuw content.view file. I also added a new view.configure file to say i defined new view files. I see everything is working perfect when I'm actually going to the edit page, he is using the new controller + new jsp file.But then ,when i click save, he is using the old controller, and apparently, he isn't looking anymore to the view.configure file.

But anyway, I will try the jsp generator. But I like to know what is happening in the background, that's why I prefer the old (more difficult) way :-). If you should know other reasons, something I forgot, please let me know.

Former Member
0 Kudos

Hello,

If you changed both view files you should be OK. Make sure that both new files are linked together (and not referencing the std one, except for one).

Anyway, the generator is working perfectly for simple field enhancement and abstract these manipulations. It is also simplier when comes the time to upgrade to a newer version.

Thank you,

Julien

pvannest
Participant
0 Kudos

Hi Julien,

I will do an enhancement by the jsp generator. I will then compare with my manually created enhancements to see what I'm missing.

thx

Peter

Maybe one question:

The parent view in Notification.view in the content/notification directory has following value: NotificationEdit. Is this referring to the Notification view file of the current folder, or the notification view file of the main folder?

pvannest
Participant
0 Kudos

Julien,

The problem is solved somehow, without changing anything. I just reinstalled the mobile client. Apparently tomcat was looking at old files... Are you familiar with this problem? How can we solve these tomcat bugs without doing a reinstall?

thx

Peter

Former Member
0 Kudos

Hello,

I guess it has something to do with compiled JSP. Wether you are using compiled JSP or you are using normal JSP but do not delete the work folder between testing (internal jsp cache of tomcat).

Thank you,

Julien.

Answers (0)