开发者

Sending argumentsfrom JSF to webflow transitions

开发者 https://www.devze.com 2023-04-12 23:22 出处:网络
Basically what I have now is something like: <view-state id=\"pageOne\" view=\"pageone.xhtml\"> <transition on=\"gotoPageTwo\" to=\"doGotoPageTwo\" />

Basically what I have now is something like:

<view-state id="pageOne" view="pageone.xhtml">
    <transition on="gotoPageTwo" to="doGotoPageTwo" />
</view-state>
<subflow-state id="doGotoPageTwo" subflow="pageTwo">
    <transition on="return" to="pageOne" />
</subflow-state>

With the JSF code being:

<h:commandLink value="Page Two" action="gotoPageTwo" />

So far so good. What I want to do next is something similar to:

<h:commandLink value="Page Two" action="gotoPageTwo(customArgument)" />

And:

<view-state id="pageOne" view="pageone.xhtml">
    <transition on="gotoPageTwo" to="doGotoPageTwo" />
</view-state>
<subflow-state id="doGotoPageTwo" subflow="pageTwo">
    <input name="myCustomArgument" value="customArgument" />
    <transition on="return" to="pageOne" />
</subflow-state>

I know this obviously doesn't work as is, but hopefully you get the concept. The only solution I've found is using an actionListener to put the data in some kind of pseudo-global variable (either in a linked bean or in the flash-/flow-Scope). This seems like an ugly decoupled solution, no开发者_JAVA技巧t much different from putting your arguments in global variables instead of passing them in c++. Is there any better way to do this?

Ps. We also use Primefaces but I don't think that's relevant in this situation.

0

精彩评论

暂无评论...
验证码 换一张
取 消