ViewPanel filter by StartKeys…but pager don't Update

邮差的信 提交于 2019-12-24 18:21:50

问题


I use attribute StartKeys into ViewPanel control..but the pager are not refreshed for go to the correct Page by SartKey. Have you any suggest?

My pager is inside ViewPanel

<xp:viewPanel rows="30" id="viewPanel1" var="rowData" showUnreadMarks="true">
 ......column value....
<xp:pager partialRefresh="true" layout="Previous Group Next" id="pager1" 
styleClass="vhead3" for="viewPanel1" alwaysCalculateLast="true"
partialExecute="true"> 
</xp:pager>
</xp:viewPanel>

回答1:


There is not a bug here. If you want to change the pager, startKeys is not what you want.

There are three objects in play here. The View object retrieved by the XPages runtime using database.getView("") using the view name specified in the viewName property of the dominoView datasource. That is the underlying database view and it cannot be modified by the dominoView datasource. It's the same view for everyone with the same columns. The content will differ only in respect of Readers fields.

The dominoView datasource allows you to refine the contents of the underlying view for this use - search options, filters and as here startKeys. That doesn't change what's in the underlying View object.

Then the View Panel or Data View or whatever you choose. This is the representation of the dominoView datasource and the pager is bound to this. Moving forward a page will not change the dominoView object, it will just change the rows displayed in the ViewPanel.

So setting the first property on a Data View will tell it to retrieve the nth row from the dominoView, and so will change the pager. Setting the startKeys or keys or search property on the dominoView, however, will change the View Entries available to the Data View, but will not change which row from that dominoView should be returned. If you were showing row 14 from the dominoView and you change the filters applied to the dominoView, you'll still be showing row 14 in the Data View. It's just that row 14 will now be a different View Entry, because the contents of the dominoView will have changed.

Basically, it's showing the correct Page of the dominoView datasource results.

You're expecting that the startKeys property should be applied to the View Panel, not applied to the dominoView to refine the results displayed from the View object. (And I've only just realised that's what is happening myself, even though it's logically sensible and correct!)

If you want to jump to a specific page or View Entry for the View Panel, you need to set the first property or some other property on the View Panel. If you want to refine the entries that are available for the user, you should change a property on the dominoView.




回答2:


Can you post your code? Where is the pager? If it's outside the View Panel, it won't update - the next question has the same kind of problem with a Data Table (the View Panel component extends the Data Table).

There seems to be a problem (Domino 8.5.3) with using startKeys and the pager current page.

Setting the "first" property on the ViewPanel might work as a workaround. I tried it on a non-categorised view and it works fine.

var ec=view1.getAllEntriesByKey("myKey");
var ent:NotesViewEntry=ec.getFirstEntry();
pos=ent.getPosition(".");
return pos;


来源:https://stackoverflow.com/questions/12299677/viewpanel-filter-by-startkeys-but-pager-dont-update

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!