META-INF.resources.xava.editors.largeDisplayEditor.jsp Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openxava Show documentation
Show all versions of openxava Show documentation
Automatic frontend engine for Java
<%@ page import="org.openxava.model.meta.MetaProperty" %>
<%@ page import="org.openxava.util.Is" %>
<%@ page import="org.openxava.util.Moneys" %>
<%
String propertyKey = request.getParameter("propertyKey");
String fvalue = (String) request.getAttribute(propertyKey + ".fvalue");
String prefix = request.getParameter("prefix");
String suffix = request.getParameter("suffix");
if (Is.emptyStringAll(prefix, suffix)) {
MetaProperty p = (MetaProperty) request.getAttribute(propertyKey);
if (Moneys.isMoneyProperty(p)) {
String symbol = Moneys.getCurrencySymbol();
if (Moneys.isCurrencySymbolAtStart()) prefix = symbol;
else suffix = symbol;
}
}
String icon = request.getParameter("icon");
String iconHTML = Is.emptyString(icon)?"":"";
Object value = request.getAttribute(propertyKey + ".value");
String negativeClass = "";
if (value instanceof Number) {
Number number = (Number) value;
if (number.longValue() < 0) negativeClass = "ox-large-display-negative";
}
%>
<%=iconHTML%><%=prefix%><%=fvalue%><%=suffix%>