开发者

rich:dataTable sorting issue (ajax) + rich:datascroller 'next' control does not go passed page 2

I am using Richfaces 3.3.0, Facelelts 1.1.14 and Seam 2.1.1.

I have an issue my rich:dataTable component and sorting. I noticed a pattern... the very first click on the table on a column header has no effect then all subsequent clicks on any header actually performs previously requested order. I tried many different things, but I can't point at what might be causing this which makes it difficult to address the issue. I would really appreciate some help.

The section of my .xhtml file that contains the table looks like 开发者_如何学Cthis:

 <rich:contextMenu attached="false" id="menu" submitMode="ajax">

      <rich:menuItem ajaxSingle="true" action="#{myAction.openItem}" value="Open Report" >

           <a4j:actionparam name="uri" assignTo="#{myAction.selectedItem.uri}" value="{uri}"/>

      </rich:menuItem>

      <rich:menuItem submitMode="server" action="#{myAction.openItem}" value="Open in new window" target="{uri}" onclick="window.open('', 'jsWinId', 'windth=200, height=200, resizable=0')">

           <a4j:actionparam name="uri" assignTo="#{myAction.selectedItem.uri}" value="{uri}"/>

      </rich:menuItem>

 </rich:contextMenu>


 <rich:dataTable id="myTable" var="_myItem" value="#{myAction.allItems}" selectionMode="single" sortMode="single" width="100%" rows="25"  reRender="myForm:myTable,ds" rowClasses="cur" onRowMouseOver="this.style.backgroundColor='#F1F1F1'" onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'" rendered="#{not empty myAction.allItems}" >

      <rich:column id="col1" sortBy="#{_myItem.id}" sortOrder="#{myAction.sortOrder['col1']}" label="Transaction ID" width="15%">

           <f:facet name="header">

                <h:outputText value="ID"/>

           </f:facet>

           #{_myItem.id}

      </rich:column>

      <rich:column id="col2" sortBy="#{_myItem.category}" sortOrder="#{myAction.sortOrder['col2']}" label="Category" width="17%">

           <f:facet name="header">

                <h:outputText value="Category"/>

           </f:facet>

           #{_myItem.category}

      </rich:column>

 <rich:column id="col3" sortBy="#{_myItem.name}" sortOrder="#{myAction.sortOrder['col3']}" label="Name" width="17%">

      <f:facet name="header">

           <h:outputText value="Name"/>

      </f:facet>

      #{_myItem.name}

 </rich:column>

 <rich:column id="col4" sortBy="#{_myItem.location}" sortOrder="#{myAction.sortOrder['col4']}" label="Location" width="21%">

      <f:facet name="header">

           <h:outputText value="Location"/>

      </f:facet>

      #{_myItem.location}

 </rich:column>

 <rich:column id="col5" sortBy="#{_myItem.status}" sortOrder="#{myAction.sortOrder['col5']}" label="Status" width="15%">

      <f:facet name="header">

           <h:outputText value="Status"/>

      </f:facet>

      #{myAction.statusDescription(_myItem.status)}

 </rich:column>

 <rich:column id="col6" sortBy="#{_myItem.timestamp}" sortOrder="#{myAction.sortOrder['col6']}" label="Timestamp" width="15%">

      <f:facet name="header">

           <h:outputText value="Timestamp"/>

      </f:facet>

      <h:outputText value="#{_myItem.timestamp}"><s:convertDateTime type="both" pattern="yyyy-MM-dd HH:mm:ss.ss"/></h:outputText>

 </rich:column>



 <f:facet name="footer">

      <rich:datascroller for="myTable" id="ds" renderIfSinglePage="false" ajaxSingle="false"></rich:datascroller>

 </f:facet>



 <rich:componentControl event="onRowClick" for="menu" operation="show">

      <f:param name="uri" value="#{_myItem.uri}"/>

 </rich:componentControl>

Thanks in advance!


Remove the reRender attribute of the dataTable.

See here for example of usage.

Also, rich:dataTable doesn't have a selectionMode attribute.

I'd suggest making it work with a minimal set of attributes and tags (i.e. copy-paste the example), and then adding the ones you need, one by one, to identify where the problem comes from.


Is this in a conversational component, and the conversation is definitely started?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜