<
h:column
>
< f:facet name ="header" >
< h:outputText escape ="false" value =" " />
</f:facet>
< h:commandLink value ="Show" action ="#{billEO.detailSetup}" >
< f:param name ="jsfcrud.currentBillEO" value ="#{billEO.asString[item]}" />
</h:commandLink>
< h:outputText value =" " />
< h:commandLink value ="Edit" action ="#{billEO.editSetup}" >
< f:param name ="jsfcrud.currentBillEO" value ="#{billEO.asString[item]}" />
</h:commandLink>
< h:outputText value =" " />
< h:commandLink value ="Destroy" action ="#{billEO.destroy}" >
< f:param name ="jsfcrud.currentBillEO" value ="#{billEO.asString[item]}" />
</h:commandLink>
</h:column>
< f:facet name ="header" >
< h:outputText escape ="false" value =" " />
</f:facet>
< h:commandLink value ="Show" action ="#{billEO.detailSetup}" >
< f:param name ="jsfcrud.currentBillEO" value ="#{billEO.asString[item]}" />
</h:commandLink>
< h:outputText value =" " />
< h:commandLink value ="Edit" action ="#{billEO.editSetup}" >
< f:param name ="jsfcrud.currentBillEO" value ="#{billEO.asString[item]}" />
</h:commandLink>
< h:outputText value =" " />
< h:commandLink value ="Destroy" action ="#{billEO.destroy}" >
< f:param name ="jsfcrud.currentBillEO" value ="#{billEO.asString[item]}" />
</h:commandLink>
</h:column>
private Map<Object, String> asString =
null;
public Map<Object, String> getAsString() {
if (asString == null) {
asString = new HashMap<Object, String>() {
@Override
public String get(Object key) {
if (key instanceof Object[]) {
Object[] keyAsArray = (Object[]) key;
if (keyAsArray.length == 0) {
return "(No Items)";
}
StringBuffer sb = new StringBuffer();
for ( int i = 0; i < keyAsArray.length; i++) {
if (i > 0) {
sb.append( "<br />");
}
sb.append(keyAsArray[i]);
}
return sb.toString();
}
return new BillEOConverter().getAsString(FacesContext.getCurrentInstance(), null, (BillEO) key);
}
};
}
return asString;
}
public Map<Object, String> getAsString() {
if (asString == null) {
asString = new HashMap<Object, String>() {
@Override
public String get(Object key) {
if (key instanceof Object[]) {
Object[] keyAsArray = (Object[]) key;
if (keyAsArray.length == 0) {
return "(No Items)";
}
StringBuffer sb = new StringBuffer();
for ( int i = 0; i < keyAsArray.length; i++) {
if (i > 0) {
sb.append( "<br />");
}
sb.append(keyAsArray[i]);
}
return sb.toString();
}
return new BillEOConverter().getAsString(FacesContext.getCurrentInstance(), null, (BillEO) key);
}
};
}
return asString;
}
转载于:https://blog.51cto.com/pz0513/112435