How do I exclude the 'Please Select One' option in this rich data column?
I have a back-end method that ADDS the 'Please Select One' for another part of the application.
@SuppressWarnings("unchecked")
public List<SelectItem> getEcometryItemStatusCodes() {
List<SelectItem> retVal = new ArrayList<SelectItem>();
try {
retVal.add(new SelectItem(null, "Please Select One"));
List<EcometryItemStatusCode> results = (List<EcometryItemStatusCode>) commonCodeService
.getCodeList(CommonCodeTypeEnum.ECOMETRY_ITEM_STATUS_CODE);
for (EcometryItemStatusCode v : results) {
retVal.add(new SelectItem(v.getEcometryCode(), v
.getEcometryCode()
+ " " + v.getDescription()));
}
} catch (Exception cgcEx) {
log.error("Could not get EcometryTaxExemptCode SelectItems", cgcEx);
}
return retVal;
}
I do not want it in my rich:extend开发者_C百科edDataTable column. Is there any way to eliminate it from the list which populates fine using:
<rich:inplaceSelect id="col6b" value="#{_item.estatus}">
<f:selectItems id="selectItems" value="#{mconsoleContext.ecometryItemStatusCodes}" />
<a:support event="onviewactivated" reRender="col6b"/>
</rich:inplaceSelect>
You could remove the option using JS. The more recent versions of RichFaces ships with jQuery, so here's a jQuery targeted example which you're supposed to run during document ready or window load:
$('#someSelector').find('option:first').remove();
精彩评论