我正在使用 icefaces版本3.0.0 ,我正在使用ace dataTable组件,如下所示:
1- Jsf代码:
<ace:dataTable id="cityTable"
value="#{weatherBean.cities}"
var="city"
paginator="true"
paginatorPosition="bottom"
rendered="#{weatherBean.cities.size()>0}"
rows="#{weatherBean.pageSize}"
style="width: 950px;">
<ace:column id="country" headerText="Country" sortBy="#{city.countryName}"
filterBy="#{city.countryName}" filterMatchMode="contains">
<h:outputText id="countryNameCell" value="#{city.countryName}"/>
</ace:column>
<ace:column id="action" headerText="Actions">
<sec:authorize access="hasRole('perm_edit_city')">
<pretty:link mappingId="editcity">
<f:param value="#{city.id}" />
<h:graphicImage url="/resources/images/edit.png" style="border: 0px;"></h:graphicImage>
</pretty:link>
</sec:authorize>
<b/>
<sec:authorize access="hasRole('perm_delete_city')">
<h:commandButton id="deleteR" image="/resources/images/delete.png"
action="#{weatherBean.deleteCity(city.id)}"
onclick="var r=confirm('Are you sure you want to delete #{city.name} ?');if (r==true){}else{return false; }"
>
</h:commandButton>
</sec:authorize>
</ace:column>
</ace:dataTable>
2-支持bean代码:
@Component("weatherBean")
@Scope("view")
public class WeatherBean {
private List<City> cities;
@Autowired
private CityService cityService;
@PostConstruct
public void init() {
cities = cityService.getAllCity();
}
public void deleteCity(Long cityId) {
log.debug("Delete deleteCity : " + cityId);
cityService.deleteCity(cityService.getCityById(cityId));
}
}
ISSUE:
action="#{weatherBean.deleteCity(city.id)}"
搜索后city.id
未更新。请告知,谢谢。
答案 0 :(得分:1)
icefaces 3.2.0
解决了这个问题