Results 1 to 5 of 5

Thread: How to use String on SWF2?

  1. #1
    Join Date
    Dec 2009
    Posts
    21

    Angry How to use String on SWF2?

    Does SWF hate Strings??

    My problem is that I don't understand how we use String values on webflow.

    <subflow-state id="sub1" subflow="sub1">
    <input name="listJsp" type="string" value="post1"/>
    </subflow-state>

    Why can't I just pass a string to the subflow? Do I really need to have some spring bean to hold this string?

    and

    <evaluate expression="utils.echo(post1)" result="flowScope.listJsp"/>

    how can "post1" here be passed as string? (yes, I am really trying an echo method to pass a string to some variable... I am that desperate...)

    For context I want to use the property listJsp to pass to a subflow what view to render (meaning some generic subflow).

    As you probably got it by now I always get the error that the property post1 does not exist in any scope.

    I am also a bit confused why I didn't find anything in the documentation about such a simple use... in fact I didn't find anyone on the internet trying to use strings anywhere on SWF... am I making the wrong approach? What am I missing?

  2. #2

    Default

    Hi aempinheiro,

    I think
    Code:
    <subflow-state id="sub1" subflow="sub1">
    <input name="listJsp" type="string" value="post1"/>
    </subflow-state>
    should be replaced by something like
    Code:
    <subflow-state id="sub1" subflow="sub1">
    <input name="listJsp" value="BindingObj.property"/>
    </subflow-state>
    if you want this to come up preset you could <on-entry... then set or evaluate the attribute beforehand...

    HTH

    John.

  3. #3
    Join Date
    Nov 2008
    Posts
    742

    Default

    Did you try using single quotes around your value? Something like:

    Code:
    <subflow-state id="sub1" subflow="sub1">
    <input name="listJsp" type="string" value="'post1'"/>
    </subflow-state>
    and

    Code:
    <evaluate expression="utils.echo('post1')" result="flowScope.listJsp"/>
    I think this is the same way you use Strings when using any kind of EL.

  4. #4
    Join Date
    Dec 2009
    Posts
    21

    Smile

    Quote Originally Posted by jokrasa View Post
    Code:
    <subflow-state id="sub1" subflow="sub1">
    <input name="listJsp" value="BindingObj.property"/>
    </subflow-state>
    Well if you consider when you have a very similar subflow and you want to customize the way the view is rendered for certain occasions (and not dependent on the binding obj.) then sometimes a string parameter given by the parent flow is something that I think makes perfect sense and is logical. If I have 'n' ways of showing the same bindingObj, I do not think the best approach is to make the binding know of them... (even if it is just one...) or is it?


    Quote Originally Posted by InverseFalcon View Post
    Did you try using single quotes around your value?
    No and I'll try it tomorrow, I'll let you all know about it.

    Thank you both so far!

  5. #5
    Join Date
    Dec 2009
    Posts
    21

    Thumbs up answered! :)

    It works!

    Thank you both very much!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •