Xoetrope
HomePage :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register
Most recent edit on 2008-02-15 13:22:03 by LuanO

Additions:

XPojoIterator



Deletions:

XPojoIterator





Edited on 2008-02-15 13:21:54 by LuanO

Additions:
Properties of the iteration's current element (POJO) are available under ...iterator/[property_name] paths, e.g. pojo/allUsers/iterator/firstname points to a POJO model node wrapping the current user's firstname. Combining this with a facility to bind action events to POJO methods allows to create "UI iterators" over arrays and collection with no user code needed. A simple example of that could be as follows:

Deletions:
Properties of the iteration's current element (POJO) are available under ...iterator/[property_name] paths, e.g. pojo/allUsers/iterator/firstname points to a POJO model node wrapping the current user's firstname. Combining this with a facility to bind action events to POJO methods allows to create "UI iterators" over arrays and collection with no user code needed. A simple example of that could be as follows:



Edited on 2008-02-15 13:21:36 by LuanO

Additions:
XPojoIterator is a special model node that handles an iteration over POJO arrays and collections. The iterator by default is assigned to each array/collection and placed under the "iterator" subpath. For example: if pojo/allUsers path points to a XPojoModel node encapsulating either an array or collection then the associated iterator is located at the pojo/allUsers/iterator path.
Each of the methods above can be invoked be evaluating the ...iterator/[method_name] path, e. g. pojo/allUsers/iterator/next(), pojo/allUsers/iterator/prev(), etc.
Properties of the iteration's current element (POJO) are available under ...iterator/[property_name] paths, e.g. pojo/allUsers/iterator/firstname points to a POJO model node wrapping the current user's firstname.


Deletions:
XPojoIterator is a special model node that handles an iteration over POJO arrays and collections. The iterator by default is assigned to each array/collection and placed under the "iterator" subpath. For example: if pojo/allUsers path points to a XPojoModel node encapsulating either an array or collection then the associated iterator is located at the "pojo/allUsers/iterator" path.
Each of the methods above can be invoked be evaluating the "...iterator/[method_name]" path, e. g. "pojo/allUsers/iterator/next()", "pojo/allUsers/iterator/prev()", etc.
Properties of the iteration's current element (POJO) are available under "...iterator/[property_name]" paths, e.g. "pojo/allUsers/iterator/firstname" points to a POJO model node wrapping the current user's firstname.




Edited on 2008-02-15 13:20:35 by LuanO

Additions:
XPojoIterator is a special model node that handles an iteration over POJO arrays and collections. The iterator by default is assigned to each array/collection and placed under the "iterator" subpath. For example: if pojo/allUsers path points to a XPojoModel node encapsulating either an array or collection then the associated iterator is located at the "pojo/allUsers/iterator" path.

Deletions:
XPojoIterator is a special model node that handles an iteration over POJO arrays and collections. The iterator by default is assigned to each array/collection and placed under the "iterator" subpath. For example: if "pojo/allUsers" path points to a XPojoModel node encapsulating either an array or collection then the associated iterator is located at the "pojo/allUsers/iterator" path.



Edited on 2008-02-12 17:08:06 by LuanO

Additions:
XUI 4.0

XPojoIterator





Oldest known version of this page was edited on 2008-01-29 17:37:56 by JakubJonik []
Page view:
XPojoIterator is a special model node that handles an iteration over POJO arrays and collections. The iterator by default is assigned to each array/collection and placed under the "iterator" subpath. For example: if "pojo/allUsers" path points to a XPojoModel node encapsulating either an array or collection then the associated iterator is located at the "pojo/allUsers/iterator" path.
The iterator exposes four methods:
- first() - moves the iteration to the first element of the underlying collection/array.
- last() - moves the iteration to the last element of the underlying collection/array.
- next() - moves the iteration to the next element of the underlying collection/array.
- prev() - moves the iteration to the previous element of the underlying collection/array.

Each of the methods above can be invoked be evaluating the "...iterator/[method_name]" path, e. g. "pojo/allUsers/iterator/next()", "pojo/allUsers/iterator/prev()", etc.
Properties of the iteration's current element (POJO) are available under "...iterator/[property_name]" paths, e.g. "pojo/allUsers/iterator/firstname" points to a POJO model node wrapping the current user's firstname.
Combining this with a facility to bind action events to POJO methods allows to create "UI iterators" over arrays and collection with no user code needed. A simple example of that could be as follows:

<XPage>

  <Components>
    <Label name="firstnameLabel"/>
    <Label name="secondnameLabel"/>
    <Button name="nextUserButton" text="next user"/>
    <Button name="prevUserButton" text="previous user"/>
  </Components>
 
  <Events>
    <Event method="pojo/allUsers/iterator/next()" target="nextUserButton" type="ActionHandler"/>
    <Event method="pojo/allUsers/iterator/prev()" target="prevUserButton" type="ActionHandler"/>
  </Events>
 
  <Data>
    <Bind target="firstnameLabel" source="pojo/allUsers/iterator/firstname"/>
    <Bind target="secondnameLabel" source="pojo/allUsers/iterator/lastname"/>
  <Data>
 
</XPage>

Page was generated in 0.2981 seconds