RequestMapping for pages that extend PatientDashboardTabExt

0 views
Skip to first unread message

Jovan Stevovic

unread,
Nov 7, 2012, 5:28:01 AM11/7/12
to implem...@openmrs.org

Hello guys,
I want to show some data in my own tab that extends the PatientDashboardTabExt. To do so I want to call a Controller and get some data into the ModelMap but I don't know what is the UrlMapping. Or if its possible to call a Controller when you click on the tab name.


Immagine my module is called "mymodule" and the tab PortletUrl is "mytabportlet" what should be the UrlMapping in the controller?

I tried:

@RequestMapping(value = "/module/mymodule/mytabportlet", method = RequestMethod.GET)

@RequestMapping(value = "/module/mymodule/mytabportlet.*", method = RequestMethod.GET)

and many others but none worked.

I found also a discussion: https://answers.openmrs.org/questions/373/how-can-i-add-a-tab-in-the-patient-dashboard

 but it doesn't solve my problem.


Thanks and sorry if I did smt wrong. I'm a beginner in both OpenMRS and Spring worlds.

jovan

Daniel Kayiwa

unread,
Nov 7, 2012, 6:05:25 AM11/7/12
to implem...@openmrs.org, dev
I think you wanted to send this to the Developers list. :)

--
OpenMRS Implementers: http://go.openmrs.org/implementers
Post: implem...@openmrs.org
Unsubscribe: implementers...@openmrs.org
Manage your OpenMRS subscriptions at https://id.openmrs.org/
 
 



--
If we keep uppermost in our minds the unkind and unjust acts of others, we shall find it impossible to love them as Christ has loved us; but if our thoughts dwell upon the wondrous love and pity of Christ for us, the same spirit will flow out to others.

Jovan Stevovic

unread,
Nov 7, 2012, 6:08:11 AM11/7/12
to implem...@openmrs.org
Yes sure.. :)

thanks
jovan

Wyclif Luyima

unread,
Nov 7, 2012, 11:07:10 AM11/7/12
to implem...@openmrs.org
Hi Jovan,

A portlet controller isn't really your typical spring controller, so you don't have to specify a url mapping inside it, all you have to do is to write a 'controller' that extends PortletController, then you override the populateModel(HttpServletRequest request, Map<String, Object> model) method, this is where put your logic and insert the data into the model object that you need to use in the portlet's jsp. In the jsp, remember to reference the model attributes you have added as model.myAttributeName

Wyclif
Reply all
Reply to author
Forward
0 new messages