Announcement Announcement Module
Collapse
No announcement yet.
Passing parameters with transitions Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Passing parameters with transitions

    Hello,
    I am in one state of my flow and I want to pass parameter via transition. I've got something like that in my flow definition xml:
    Code:
    <view-state id="allProductsState" view="allProducts">
                <var name="allProducts" class="my.models.package.AllProducts" />
                <on-render>
                    <evaluate expression="productService.returnAllProducts(allProducts)"/>
                </on-render>
                <transition on="showProduct" to="singleProduct" />
            </view-state>
    
            <view-state id="singleProduct" view="singleProduct">
                <var name="product" class="my.models.package.Product" />
                <on-render>
                    <evaluate expression="productService.returnProduct(requestParameters.id,product)"/>
                </on-render>
            </view-state>
    and this is part of my JSP page when I am in allProductsState state (I am listing all products and want to go to single product):
    HTML Code:
    <a href="${flowExecutionUrl}&_eventId=showProduct&id=${product.id}">Product: ${product.name}</a>
    In configuration above I've got exception:
    Code:
    org.springframework.expression.spel.SpelEvaluationException: EL1004E:(pos 12): Method call: Method returnProduct(null,my.models.package.Product) cannot be found on my.service.package.ProductService type
    at org.springframework.expression.spel.ast.MethodReference.findAccessorForMethod(MethodReference.java:185)
            at org.springframework.expression.spel.ast.MethodReference.getValueInternal(MethodReference.java:107)
            at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:57)
            at org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:102)
            at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:97)
            at org.springframework.binding.expression.spel.SpringELExpression.getValue(SpringELExpression.java:78)
            ... 44 more

  • #2
    Solution

    I've changed <on-render> to <on-entry> in singleProduct state - it helped.

    Comment

    Working...
    X