I am dynamically adding org.richfaces.component.html.HtmlColumn classes to a rich:dataTable. The table data is displayed and the headers are plain labels with sorting disabled, no anchor, no script, no sort images. I have tried every combination of sortable, selfSorted, sortBy and sortExpression. The one assumption I am making is that the sortBy(Object o) is the getter you would put on the page?
{code}
org.richfaces.component.html.HtmlColumn col = new HtmlColumn();
HtmlOutputLabel header = new HtmlOutputLabel();
header.setValue(colName);
col.setHeader(header);
col.setSortable(true);
col.setSelfSorted(true);
col.setSortBy("#{item.foo}");
resultsDataTableUI.getChildren().add(col);
{code}
{code:xml}
<h:panelGroup id="dataTablePanelGroup" layout="block" style="overflow:scroll; width:933px; height:340px;">
<rich:dataTable id=dynamicResultsTable" value="#{bean.resultList}" var="item"
binding=#{bean.resultsDataTableUI}" rows=10/>
</h:panelGroup>
{code:xml}
debug[11:50:21,346]: Update page part from call parameter for ID openCapTrunkForm:resultsPanelGroupContainer
debug[11:50:21,346]: call selectSingleNode for id= openCapTrunkForm:resultsPanelGroupContainer
debug[11:50:21,346]: Replace content of node by outerHTML()
debug[11:50:21,361]: search for elements by name 'script' in element div
debug[11:50:21,361]: Scripts in updated part count : 2
debug[11:50:21,361]: Update part of page for Id: openCapTrunkForm:resultsPanelGroupContainer successful
debug[11:50:21,361]: Update page part from call parameter for ID openCapTrunkForm:resultMsgPanel
debug[11:50:21,361]: call selectSingleNode for id= openCapTrunkForm:resultMsgPanel
debug[11:50:21,361]: Replace content of node by outerHTML()
debug[11:50:21,361]: search for elements by name 'script' in element div
debug[11:50:21,361]: Scripts in updated part count : 0
debug[11:50:21,361]: call selectSingleNode for id= org.ajax4jsf.oncomplete
debug[11:50:21,361]: Call request oncomplete function after processing updates
debug[11:50:21,361]: Update part of page for Id: openCapTrunkForm:resultMsgPanel successful
debug[11:50:21,377]: call selectSingleNode for id= ajax-view-state
debug[11:50:21,377]: Hidden JSF state fields:
debug[11:50:21,377]: Namespace for hidden view-state input fields is undefined
debug[11:50:21,377]: search for elements by name 'input' in element span
debug[11:50:21,377]: Replace value for inputs: 60 by new values: 1
debug[11:50:21,377]: Input in response: javax.faces.ViewState
debug[11:50:21,377]: Found same input on page with type: hidden
debug[11:50:21,377]: Found same input on page with type: hidden
debug[11:50:21,377]: Found same input on page with type: hidden
debug[11:50:21,377]: Found same input on page with type: hidden
debug[11:50:21,377]: search for elements by name 'INPUT' in element span
debug[11:50:21,377]: Replace value for inputs: 60 by new values: 0
debug[11:50:21,377]: call selectSingleNode for id= _A4J.AJAX.focus
debug[11:50:21,377]: focus must be set to control openCapTrunkForm:resultsPanelContainer
debug[11:50:21,377]: No control element openCapTrunkForm:resultsPanelContainer in submitted form
debug[11:50:21,392]: Set focus to control
debug[11:50:21,533]: Evaluate script replaced area in document: //function dpf(f) {var adp = f.adp;if (adp != null) {for (var i = 0;i < adp.length;i++) {f.removeChild(adp[i]);}}};function apf(f, pvp) {var adp = new Array();f.adp = adp;var ps = pvp.split(',');for (var i = 0,ii = 0;i < ps.length;i++,ii++) {var p = document.createElement("input");p.type = "hidden";p.name = ps[i];p.value = ps[i + 1];f.appendChild(p);adp[ii] = p;i += 1;}};function jsfcljs(f, pvp, t) {apf(f, pvp);var ft = f.target;if (t) {f.target = t;}f.submit();f.target = ft;dpf(f);}; //
debug[11:50:21,533]: Script evaluation succeeded
debug[11:50:21,533]: Evaluate script replaced area in document: //new Richfaces.Datascroller('openCapTrunkForm:sc1', function(event){A4J.AJAX.Submit('openCapTrunkForm',event,{'ignoreDupResponses':true,'implicitEventsQueue':'openCapTrunkForm:sc1','similarityGroupingId':'openCapTrunkForm:sc1','parameters':{'openCapTrunkForm:sc1':event.memo.page,'ajaxSingle':'openCapTrunkForm:sc1'} ,'containerId':'openCapTrunkForm:dynamicDataRegion'} ); return false;}); //
debug[11:50:21,533]: Script evaluation succeeded
debug[11:50:21,533]: call selectSingleNode for id= _ajax:data