This content has been marked as final.
Show 1 reply
-
1. Re: descriptions instead values
oguzyalcin.oguzhanyalcin.gazi.edu.tr Apr 13, 2009 9:05 AM (in response to mhdez)Hi,
It will be a better practice to store those ip ranges in a lookup table in db. By giving a foreign key relation your problem can be solved easily. But in your case, you can simply use <c:choose>
and <c:when> for converting your ip values to int values like:<rich:dataTable id="accessList" value="#{configIpList}" var="access" rows="10" columnsWidth="200,20,300"> <a4j:support event="onRowClick" reRender="edit,remove" action="#{accessView.dataTableObtenerSele(access)}" onsubmit="select(this,'#e6e6e6','#{a4jSkin.tableBackgroundColor}')"/> <rich:column> <f:facet name="header">Ip</f:facet> <h:outputText value="#{access.ip}" styleClass="mytext"/> </rich:column> <rich:column> <f:facet name="header">Mask</f:facet> <c:choose> <c:when test="#{access.mask == '128.0.0.0'}"> <h:outputText value="1" styleClass="mytext"/> </c:when> <c:when test="#{access.mask == '192.0.0.0'}"> <h:outputText value="2" styleClass="mytext"/> </c:when> ... </c:choose> </rich:column> </rich:dataTable>