How can I override the original address portlet with a new one?

0 views
Skip to first unread message

serghei.luchianov.it

unread,
Oct 1, 2014, 9:39:02 PM10/1/14
to d...@openmrs.org

Hi, I've been googling for a week now, and I can't find any working examples on how to override the original address display/edit portlet. I'm making a module that will have a map in there and allow to simply drop a pin for patient address, which will populate the whole form automatically.

Bottom line is: I want to override old address portlet with a new one that does everything the same way + has a map frame.

So far I've tried overriding address portlet via webModuleApplicationContext.xml (using a bean ), copy/pasting the portlet code & controller into my module & just having a "hello world" message at the head of the portlet -> with no effect. My code:

<openmrs:portlet url="addressLayout" id="addressPortlet" moduleId="gis" size="full"... /> 

Displays my portlet properly, but the same code without moduleId="gis" , which is the way original portlet is declared in all the pages, still shows the original portlet. Is there a way I can globally override that mapping? 

Lluis Martinez

unread,
Oct 2, 2014, 5:58:03 AM10/2/14
to d...@openmrs.org
Did you check if the address portlet has an extension point? I think it's the standard way of adding functionality to the views.

--
OpenMRS Developers: http://om.rs/dev
Post: d...@openmrs.org | Unsubscribe: dev+uns...@openmrs.org
Manage your OpenMRS subscriptions at http://om.rs/id
 
Visit OpenMRS Talk for in-depth & casual conversation: https://talk.openmrs.org/

To unsubscribe from this group and stop receiving emails from it, send an email to dev+uns...@openmrs.org.

serghei.luchianov.it

unread,
Oct 2, 2014, 3:33:20 PM10/2/14
to d...@openmrs.org
I just checked out address portlet jsp file and unfortunately it doesn't have an extension point.

Lluis Martinez

unread,
Oct 2, 2014, 3:51:29 PM10/2/14
to d...@openmrs.org
You can add one then :-)

Darius Jazayeri

unread,
Oct 2, 2014, 3:53:35 PM10/2/14
to dev

I believe you can find an example of this in the orderextension module. It overrides the regimens portlet.

-Darius (by phone)

serghei.luchianov.it

unread,
Oct 2, 2014, 6:44:49 PM10/2/14
to d...@openmrs.org
Thank you! I will try it right away!
Reply all
Reply to author
Forward
0 new messages