Details
Description
Contribution from Dan Leahu:
*****
RowSelector doesn't correctly work with two portlets because the method generated at onclick event on the row through JScript doesn't consider the current table we're in. We've fixed that by changing into TableRenderer, this:
rowSelectionFunctionName = "ice_tableRowClicked" + rowSelectorNumber(facesContext);
into this:
public String textToJSMethodName(String text) {
return text.replaceAll(":","_");
}
rowSelectorId = textToJSMethodName(uiComponent.getClientId(facesContext));
rowSelectionFunctionName = "ice_tableRowClicked" + rowSelectorId;
The method rowSelectorNumber(...) which looks like this:
private int rowSelectorNumber(FacesContext context){
Map m = context.getExternalContext().getRequestMap();
String key = RowSelector.class.getName() + "-Selector";
Integer I = (Integer)m.get(key);
int i = 0;
if(I != null){
i = I.intValue();
i++;
}
I = new Integer(i);
m.put(key, I);
return i;
}
contains String key = RowSelector.class.getName() + "-Selector" which never gets an actual value as the key isn't set anywhere. We think that RowSelector should namespace its parameters by using ids which are sure to be unique hence the modifications we've done.
*****
RowSelector doesn't correctly work with two portlets because the method generated at onclick event on the row through JScript doesn't consider the current table we're in. We've fixed that by changing into TableRenderer, this:
rowSelectionFunctionName = "ice_tableRowClicked" + rowSelectorNumber(facesContext);
into this:
public String textToJSMethodName(String text) {
return text.replaceAll(":","_");
}
rowSelectorId = textToJSMethodName(uiComponent.getClientId(facesContext));
rowSelectionFunctionName = "ice_tableRowClicked" + rowSelectorId;
The method rowSelectorNumber(...) which looks like this:
private int rowSelectorNumber(FacesContext context){
Map m = context.getExternalContext().getRequestMap();
String key = RowSelector.class.getName() + "-Selector";
Integer I = (Integer)m.get(key);
int i = 0;
if(I != null){
i = I.intValue();
i++;
}
I = new Integer(i);
m.put(key, I);
return i;
}
contains String key = RowSelector.class.getName() + "-Selector" which never gets an actual value as the key isn't set anywhere. We think that RowSelector should namespace its parameters by using ids which are sure to be unique hence the modifications we've done.
Hi,
This issue was originally reported for IceFaces 1.5.3. Is this solved in 1.6 final release?
Thanks.