Announcement Announcement Module
Collapse
No announcement yet.
Using counter inside webflow Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using counter inside webflow

    Hi to all,

    I would like to use an Integer value in my webflow to keep track of the page being shown. When the next-transition is executed, this value needs to be increased by 1. When the previous-transition is executed, the value needs to be decreased by 1. Can someone give me some clues on how to solve this. I'll paste some invented code to illustrate my needs.
    Thanks allready.

    init:
    Code:
    <var name="page" value="0" />
    process:
    Code:
    <set attribute="page" value="${page + 1}" />

  • #2
    Why not create a Counter bean with methods like increment() and decrement(). That would make it a bit more OO. You can setup the bean with a <var>:

    <var name="counter" class="my.Counter"/>

    And then use a simple evaluate-action to call the method:

    <evaluate-action expression="flowScope.counter.increment()"/>

    Erwin

    Comment


    • #3
      Thanks, I can make it work using a bean providing the functionality you suggested. However, it would be nice to know how it can be done using a primitive type.

      Thanks.

      Comment

      Working...
      X