Creating tabs like on patientDashboard

Hi all

I am trying to implement tabs in the radiology module like is on the patient dashboard page. I have taken a look at the code of the patientDashboard but i still cannot find the exact code that is giving that tab interface on the patient dashboard. Here is what i have done so far, and this is how it looks,

. From the screenshots you’ll see i need to make the “orders” link a tab just like on the patient dashboard but i can’t seem to understand much of the code that is been used to achieve this in patientDashboard page here, especially because i see a lot of javascript imports but i can’t tell their purpose. Code for patient dashboard can be found here on github. Any help will be much appreciated.

cc @teleivo, @pascal, @dkayiwa, @wyclif

It’s done with CSS magic, use the browser development tools to see the DOM elements and the CSS selectors used:

The JS function changeTab makes visible the contents of the current tab (a DIV) and changes its CSS class

Each tab content is rendered by the openmrs:portlet custom tag.

<openmrs:portlet url="patientDemographics" id="patientDashboardDemographics" patientId="${patient.patientId}"/>


thanks @lluismf, will look into this :slight_smile:

Hi @lluismf

I am having problem with directory resolution when importing files.

looking at the file attribute below

<%@ include file="/WEB-INF/template/include.jsp" %>

shows that “/” resolves to the root of openmrs context because when i open “openmrs/” i see the WEB-INF folder

but this other line confuses

<“openmrs”:htmlInclude file="/scripts/easyAjax.js" />

the file attribute above confuses me because “/scripts” is actually located in “openmrs/WEB-INF/view/scripts” so why was it not something like

<“openmrs”:htmlInclude file="/WEB-INF/view/scripts/easyAjax.js" />

Now the portlet url attribute[quote=“lluismf, post:2, topic:6371”] <openmrs:portlet url=“patientDemographics” id=“patientDashboardDemographics” patientId="${patient.patientId}"/> [/quote]

if the portlet is inside a module for example /radiology-omod/src/main/webapp/portlets/discontinuationOrderDisplayPortlet.jsp , how will the url look like


I think you need to specify set the attribute moduleId="radiology" of the openmrs:portlet tag


All you need should be