Question

i am using icefaces version 3.0.0 and i am using ace dataTable component as follows:

1- Jsf Code:

<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- Backing bean code:

@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:

  • datatable by default displays cities from id 1 to id 20.
  • if i make search by name, and search returned results with id 100 to id 120 for example, and i try to invoke the delete method on any of the search results, the delete method is invoked on the old ids >> action="#{weatherBean.deleteCity(city.id)}" the city.id is not updated after search.

please advise, thanks.

Was it helpful?

Solution

This problem solved in icefaces 3.2.0

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top