Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- obsAttribute.tag
- -------------------------------
- <%@tag import="org.openmrs.web.attribute.handler.FieldGenAttributeHandler"%>
- <%@tag import="java.util.Map"%>
- <%@tag import="org.openmrs.api.context.Context"%>
- <%@tag import="org.openmrs.ConceptComplex"%>
- <%@tag import="org.apache.commons.logging.Log" %>
- <%@tag import="org.apache.commons.logging.LogFactory" %>
- <%@ include file="/WEB-INF/template/include.jsp" %>
- <%--
- You must specify either attributeType or handler.
- You must specify formFieldName
- --%>
- <%@ attribute name="concept" required="true" type="org.openmrs.Concept" %>
- <%@ attribute name="formFieldName" required="true" type="java.lang.String" %>
- <%
- ConceptComplex conceptComplex = Context.getConceptService().getConceptComplex(concept.getConceptId());
- String handler = conceptComplex.getHandler();
- final Log log = LogFactory.getLog(getClass());
- log.info("Test within obs attributes");
- %>
- <% if (true) {
- // FieldGenAttributeHandler<?> h = (FieldGenAttributeHandler) handler;
- String widgetName = "org.openmrs.Patient";
- String formFieldName ="valueComplex";
- /* Map<String, Object> widgetConfig = h.getWidgetConfiguration(); */
- %>
- <openmrs:fieldGen
- formFieldName="${ formFieldName }"
- type="<%= widgetName %>"
- val="${ org.openmrs.Patient }"/>
- <% } else {
- String valueAsString = "";
- if (value != null)
- valueAsString = value.getSerializedValue();
- %>
- <input type="text" name="${ formFieldName }" value="<%= valueAsString %>"/>
- <% } %>
- ===========================
- in this tag , i'm aiming to generate an fieldGen tag to be displayed on the ObsForm.jsp page.
- As a start, I've hard coded values
- String widgetName = "org.openmrs.Patient";
- String formFieldName ="valueComplex";
- in the tag, and am merely passing them into the appropriate place. ( see code)
- my problem is, in order to make the tag display an auto complete box of patient instances, what do I pass in as the 'value' of the field Gen tag class ?
- should this be a list of all patient instances ? am rather stumped here....
Advertisement
Add Comment
Please, Sign In to add comment