O novo problema eh q nao consigo, apos o click na linha da tabela atualizar um campo pode ser <h:outputLabel> ou <h:outputText>
o importante e q funcione…
estou usando o Ajax pra fazer mais nao to conseguindo
pq nao consigo botar um metodo no parametro “action” e no site de referencia a cima ta
um metodo normal void… agora chama o meu metodo nao sei pq.
codigo do site
[code]public class ExtendedTableBean {
private String sortMode=“single”;
private String selectionMode=“multi”;
private HtmlExtendedDataTable table;
private SimpleSelection selection;
private List selectedCapitals = new ArrayList();
private ExtendedTableDataModel<Capital> dataModel;
private List<Capital> capitals = new ArrayList<Capital>();
public void takeSelection() {
getSelectedCapitals().clear();
Iterator<Object> iterator = getSelection().getKeys();
while (iterator.hasNext()){
Object key = iterator.next();
table.setRowKey(key);
if (table.isRowAvailable()) {
getSelectedCapitals().add((Capital) table.getRowData());
}
}
}
public void resetSelection() {
getSelectedCapitals().clear();
}
public String getSortMode() {
return sortMode;
}
@@ -57,29 +39,41 @@
public ExtendedTableBean() {
}
public ExtendedTableDataModel<Capital> getCapitalsDataModel() {
if (dataModel == null) {
dataModel = new ExtendedTableDataModel<Capital>(new DataProvider<Capital>(){
public HtmlExtendedDataTable getTable() {
return table;
}
private static final long serialVersionUID = 5054087821033164847L;
public void setTable(HtmlExtendedDataTable table) {
this.table = table;
}
public Capital getItemByKey(Object key) {
for(Capital c : capitals){
if (key.equals(getKey(c))){
return c;
}
}
return null;
}
public SimpleSelection getSelection() {
return selection;
}
public List<Capital> getItemsByRange(int firstRow, int endRow) {
return capitals.subList(firstRow, endRow);
}
public void setSelection(SimpleSelection selection) {
this.selection = selection;
}
public Object getKey(Capital item) {
return item.getName();
}
public List<Capital> getSelectedCapitals() {
return selectedCapitals;
public int getRowCount() {
return capitals.size();
}
});
}
return dataModel;
}
this.selectedCapitals = selectedCapitals;
public void setCapitals(List<Capital> capitals) {
this.capitals = capitals;
}