a solution for your problem is to encapsulate your directcommand by a if tag. Example:
<bdm:if condition=“empty” document=“myProperty” select="/Property/Address/State">
<bdm:directcommand type=“query” schema=“Property” document=“myProperty” queryparm=“Address/State~=‘N*’” />
In this case, the directcommand is only executed if no document / document cursor exists with the name ‘myDocument’.
Have a look at the JSP page ‘BrowseWithNavigation’ of X-Application’s simple examples. It uses the ‘directcommand’ tag in combination with an ‘if’ tag.
Why is this the solution ?
The reason for your problem is the processing of the ‘directcommand’ tag and the navigation expression of the ‘browsenavigation’ tag.
If you invoke your page the first time,
(1) the direct command is invoked.
(2) the browse list is displayed by the browse tag
(3) the browsenavigation creates its expression for the next page based on the last position of the current browse list.
If you click to the ‘next’ link
(1) Before any tag of the page is evaluated, the expression of the next link is evaluated and the current document cursor starts at the next page.
(2) the ‘directcommand’ tag is evaluated and the query is processed again to create the document cursor. => The effect of the browse navigation is lost.
With the if tag you prevent the execution of the directcommand.
I hope, this will help you.
X-Application Version: 3.1.1
Tamino Version : 3.1.1
Platform : NT, Win2k, Solaris, …
WebContainer : Tomcat 3.3
JDK Version : 1.3.1