Hi,
I’m trying to write an app for referenceapplication. I was following the Step by Step tutorial ( https://wiki.openmrs.org/display/docs/App+Framework+Step+by+Step+Tutorial ) and UI tutorial ( https://wiki.openmrs.org/display/docs/UI+Framework+Step+By+Step+Tutorial ) trying to replicate the work done in the frontend.
I suppose that code serves for getting all the decorations showed:
<%
ui.decorateWith("appui", "standardEmrPage")
%>
<script type="text/javascript">
<% if (breadcrumbs) { %>
var breadcrumbs = ${ breadcrumbs };
<% } else { %>
var breadcrumbs = [
{ icon: "icon-home", link: '/' + OPENMRS_CONTEXT_PATH + '/index.htm' },
{ label: "${ ui.message(label)}"}
];
<% } %>
</script>
<h2>
${ ui.message(heading) }
</h2>
<!-- The page itself -->
<h1> Hello world </h1>
<!-- end of the page>
but it doesnt’ work, when I just put it on my page in the gsp file (linked by an app from app dashboard). I don’t have anything else but the code generated by openmrs-skd:create-module, app declaration in helloWorld_app.json file and the helloWorld.gsp page. I have imported all the dependencies, as stated at the beginning of the UI tutorial, I work in the developer mode, but it doesn’t work in ‘normal’ mode either.
My app declaration:
[
{
"id": "coreapps.helloWorld",
"description": "Example app, shows Hello World",
"order": 2,
"extensions": [
{
"id": "coreapps.activeVisitsHomepageLink",
"extensionPointId": "org.openmrs.referenceapplication.homepageLink",
"type": "link",
"label": "Hello World label app",
"url": "helloWorldmd/helloWorld.page",
"icon": "icon-trophy",
"requiredPrivilege": "App: coreapps.helloWorld"
}
]
}
]
I’ve also tried it with just
<%
ui.decorateWith("appui", "standardEmrPage")
%>
<h1> Hello World! </h1>
but the same error appears. I suppose I need to include the ui somewhere, but I have no idea why, and none of the tutorials mentions that.
The error message:
Root Error
groovy.lang.MissingPropertyException: No such property: breadcrumbs for class: SimpleTemplateScript8
Full Error
org.openmrs.ui.framework.ViewException: Error rendering page view for helloWorld. Model properties:
sessionContext
featureToggles
patient
ui
context
contextPath
session
param
out
at org.openmrs.ui.framework.page.GroovyPageView.render(GroovyPageView.java:55)
Full traceback: http://pastebin.com/c5LYPfXC