How to build application for paginal navigation on table?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to build application for paginal navigation on table?

МОНАХ
I have data (for example, xml file). Necessary to create the table with element of the navigations. I.e. data must be displayed in table a la carte, on 10 for instance and must be a buttons  ("next 10", "previous 10"...).

Part of my view.xhtml:

<xforms:instance id="HugeData" src="services/getRD" />


Part of my page-flow.xml:
<page path-info="/BuhBal/services/getRD" view="services/RangeData-get.xpl"/>

Part of my RangeData-get.xpl:
<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:oxf="http://www.orbeon.com/oxf/processors"
    xmlns:xhtml="http://www.w3.org/1999/xhtml"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <p:param name="instance" type="input"/>
    <p:param name="data" type="output"/>

    <p:processor name="oxf:xslt">
        <p:input name="data" href="HugeData.xml"/>
        <p:input name="instance" href="#instance"/>
        <p:input name="config">
            <FINDAT xsl:version="2.0">
                <xsl:copy-of select="/FINDAT/ITEM[position() &gt; 0 and position() &lt; 21]"/>
            </FINDAT>
        </p:input>
        <p:output name="data" ref="data"/>
    </p:processor>

</p:config>



I move in right directions? :)

on given moment start and final line numbers hard is given in RangeData-get.xpl (<xsl:copy-of select="/FINDAT/ITEM[position() &gt; 0 and position() &lt; 21]"/>)

How to send the number of these lines as parameters from view.xhtml in RangeData-get.xpl?
Reply | Threaded
Open this post in threaded view
|

Re: How to build application for paginal navigation on table?

Hank Ratzesberger

Hi,

[caveat -- there may be better examples in the Orbeon war that
I have missed....]

I have some paginated displays that use a similar strategy.
There are a few points to this:

  o There must be an instance with the # of items you want to display
  o The maximum # of items must be known.
  o The navigate controls (next,previous) must call a submission that
    updates the instance with new first/start postition.
  o An xforms-repeat element bound to the instance will be updated
    when the navigation controls are triggered.
  o An instance is needed to save the navigation state.

Your RangeData-get.xpl must be able to be used like a web service, so
that an xforms submission can GET (or POST) to it to update the  
instance.
You will need to pass to it a start position and perhaps a # of  
items, e.g.

   http://example.com/RangeData-get?start=1&count=10

You would evaluate the start and count parameters with the request  
generator:

  http://www.orbeon.com/ops/doc/processors-generators-request

example nav. instance:

<instance id="navs">
   <start>1</start>
   <count>10</count>
   <max>100</max>
   <next>false</next> <!-- Enable/disable next and prev buttons -->
   <prev>true</prev>
</instance


Example binding:

<bind nodeset="next"
   readonly="boolean-from-string(.)"
   calculate="(/start + /count) &gt; /max" />
   <!-- Readonly if the start - count less than 1 -->
<bind nodeset="prev"
   readonly="boolean-from-string(.)"
   calculate="(/start - /count) &lt; 1"/>

Example control:

<!-- The Prev button subtracts 10 from _start and redraws. -->
   <xforms:trigger ref="prev">
     <xforms:label>&lt;&lt; Prev</xforms:label>
     <xforms:action ev:event="DOMActivate">
       <!-- recalculate start position -->
       <xforms:setvalue ref="instance('navs')/start" value="instance
('navs')/start - instance('navs')/count"/>
       <xforms:send submission="RangeData-submission"/>
     </xforms:action>
</xforms:trigger>

<!-- The Next button adds 10 to _start and redraws the map -->
<xforms:trigger ref="next">
   <xforms:label>Next &gt;&gt;</xforms:label>
   <xforms:action ev:event="DOMActivate">
     <xforms:setvalue ref="instance('navs')/start" value="instance
('navs')/start + instance('navs')/count"/>
     <xforms:send submission="RangeData-submission"/>
   </xforms:action>
</xforms:trigger>

HTH, its just a snippet...
Hank


On Jul 14, 2008, at 10:41 PM, МОНАХ wrote:

>
> I have data (for example, xml file). Necessary to create the table  
> with
> element of the navigations. I.e. data must be displayed in table a  
> la carte,
> on 10 for instance and must be a buttons  ("next 10", "previous  
> 10"...).
>
> Part of my view.xhtml:
>
> <xforms:instance id="HugeData" src="services/getRD" />
>
>
> Part of my page-flow.xml:
> <page path-info="/BuhBal/services/getRD" view="services/RangeData-
> get.xpl"/>
>
> Part of my RangeData-get.xpl:
> <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
>     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>     xmlns:oxf="http://www.orbeon.com/oxf/processors"
>     xmlns:xhtml="http://www.w3.org/1999/xhtml"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xmlns:xs="http://www.w3.org/2001/XMLSchema">
>
>     <p:param name="instance" type="input"/>
>     <p:param name="data" type="output"/>
>
>     <p:processor name="oxf:xslt">
>         <p:input name="data" href="HugeData.xml"/>
>         <p:input name="instance" href="#instance"/>
>         <p:input name="config">
>             <FINDAT xsl:version="2.0">
>                 <xsl:copy-of select="/FINDAT/ITEM[position() &gt; 0  
> and
> position() &lt; 21]"/>
>             </FINDAT>
>         </p:input>
>         <p:output name="data" ref="data"/>
>     </p:processor>
>
> </p:config>
>
>
>
> I move in right directions? :)
>
> on given moment start and final line numbers hard is given in
> RangeData-get.xpl (<xsl:copy-of select="/FINDAT/ITEM[position()  
> &gt; 0 and
> position() &lt; 21]"/>)
>
> How to send the number of these lines as parameters from view.xhtml in
> RangeData-get.xpl?
> --
> View this message in context: http://www.nabble.com/How-to-build- 
> application-for-paginal-navigation-on-table--tp18442148p18442148.html
> Sent from the ObjectWeb OPS - Users mailing list archive at  
> Nabble.com.
>
>
> --
> You receive this message as a subscriber of the [hidden email]  
> mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
Hank Ratzesberger
NEES@UCSB
Institute for Crustal Studies,
University of California, Santa Barbara
805-893-8042







--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: How to build application for paginal navigation on table?

Erik Bruchez
Administrator
FWIW the Form Runner summary page also does pagination.

-Erik

On Jul 16, 2008, at 8:29 AM, Hank Ratzesberger wrote:

>
> Hi,
>
> [caveat -- there may be better examples in the Orbeon war that
> I have missed....]
>
> I have some paginated displays that use a similar strategy.
> There are a few points to this:
>
> o There must be an instance with the # of items you want to display
> o The maximum # of items must be known.
> o The navigate controls (next,previous) must call a submission that
>   updates the instance with new first/start postition.
> o An xforms-repeat element bound to the instance will be updated
>   when the navigation controls are triggered.
> o An instance is needed to save the navigation state.
>
> Your RangeData-get.xpl must be able to be used like a web service, so
> that an xforms submission can GET (or POST) to it to update the  
> instance.
> You will need to pass to it a start position and perhaps a # of  
> items, e.g.
>
>  http://example.com/RangeData-get?start=1&count=10
>
> You would evaluate the start and count parameters with the request  
> generator:
>
> http://www.orbeon.com/ops/doc/processors-generators-request
>
> example nav. instance:
>
> <instance id="navs">
>  <start>1</start>
>  <count>10</count>
>  <max>100</max>
>  <next>false</next> <!-- Enable/disable next and prev buttons -->
>  <prev>true</prev>
> </instance
>
>
> Example binding:
>
> <bind nodeset="next"
>  readonly="boolean-from-string(.)"
>  calculate="(/start + /count) &gt; /max" />
>  <!-- Readonly if the start - count less than 1 -->
> <bind nodeset="prev"
>  readonly="boolean-from-string(.)"
>  calculate="(/start - /count) &lt; 1"/>
>
> Example control:
>
> <!-- The Prev button subtracts 10 from _start and redraws. -->
>  <xforms:trigger ref="prev">
>    <xforms:label>&lt;&lt; Prev</xforms:label>
>    <xforms:action ev:event="DOMActivate">
>      <!-- recalculate start position -->
>      <xforms:setvalue ref="instance('navs')/start"  
> value="instance('navs')/start - instance('navs')/count"/>
>      <xforms:send submission="RangeData-submission"/>
>    </xforms:action>
> </xforms:trigger>
>
> <!-- The Next button adds 10 to _start and redraws the map -->
> <xforms:trigger ref="next">
>  <xforms:label>Next &gt;&gt;</xforms:label>
>  <xforms:action ev:event="DOMActivate">
>    <xforms:setvalue ref="instance('navs')/start"  
> value="instance('navs')/start + instance('navs')/count"/>
>    <xforms:send submission="RangeData-submission"/>
>  </xforms:action>
> </xforms:trigger>
>
> HTH, its just a snippet...
> Hank
>
>
> On Jul 14, 2008, at 10:41 PM, МОНАХ wrote:
>
>>
>> I have data (for example, xml file). Necessary to create the table  
>> with
>> element of the navigations. I.e. data must be displayed in table a  
>> la carte,
>> on 10 for instance and must be a buttons  ("next 10", "previous  
>> 10"...).
>>
>> Part of my view.xhtml:
>>
>> <xforms:instance id="HugeData" src="services/getRD" />
>>
>>
>> Part of my page-flow.xml:
>> <page path-info="/BuhBal/services/getRD" view="services/RangeData-
>> get.xpl"/>
>>
>> Part of my RangeData-get.xpl:
>> <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
>>    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>>    xmlns:oxf="http://www.orbeon.com/oxf/processors"
>>    xmlns:xhtml="http://www.w3.org/1999/xhtml"
>>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>    xmlns:xs="http://www.w3.org/2001/XMLSchema">
>>
>>    <p:param name="instance" type="input"/>
>>    <p:param name="data" type="output"/>
>>
>>    <p:processor name="oxf:xslt">
>>        <p:input name="data" href="HugeData.xml"/>
>>        <p:input name="instance" href="#instance"/>
>>        <p:input name="config">
>>            <FINDAT xsl:version="2.0">
>>                <xsl:copy-of select="/FINDAT/ITEM[position() &gt; 0  
>> and
>> position() &lt; 21]"/>
>>            </FINDAT>
>>        </p:input>
>>        <p:output name="data" ref="data"/>
>>    </p:processor>
>>
>> </p:config>
>>
>>
>>
>> I move in right directions? :)
>>
>> on given moment start and final line numbers hard is given in
>> RangeData-get.xpl (<xsl:copy-of select="/FINDAT/ITEM[position()  
>> &gt; 0 and
>> position() &lt; 21]"/>)
>>
>> How to send the number of these lines as parameters from view.xhtml  
>> in
>> RangeData-get.xpl?
>> --
>> View this message in context: http://www.nabble.com/How-to-build-application-for-paginal-navigation-on-table--tp18442148p18442148.html
>> Sent from the ObjectWeb OPS - Users mailing list archive at  
>> Nabble.com.
>>
>>
>> --
>> You receive this message as a subscriber of the [hidden email]  
>> mailing list.
>> To unsubscribe: mailto:[hidden email]
>> For general help: mailto:[hidden email]?subject=help
>> OW2 mailing lists service home page: http://www.ow2.org/wws
>
> Hank Ratzesberger
> NEES@UCSB
> Institute for Crustal Studies,
> University of California, Santa Barbara
> 805-893-8042
>
>
>
>
>
>
> --
> You receive this message as a subscriber of the [hidden email]  
> mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws