Thorsten Scherler schrieb:
On Wed, 2009-03-11 at 11:05 -0700, Frank Hamilton wrote:
I need to load some select in cascade.

Example:

    A: Colors            --> if select Colors then -->  B: Blue
Number Red . Cian
                .

When I execute my initParameter() in the usecase handler (extend
AbstractUsecase), I load the A options, and the B options is empty. I
setParameter(lstA) and get in jx file.

When change the select with the A options I need to set the options in
select attribute. I prefer not use ajax for this.

Now I use this in jx:
...
<select name="idA" id="A"
  onchange="location.href='?idA='+this.value" >
....

Then I start the usecase again,and in the initParameter() get the request
parameter idA execute my method getAtributeByA(getParameter(idA)). Then I
sent the list of attribute and fill up the B select  in jx.

But need  to set again  A list, or save this in session In the first execute
of usecase to get it in the second execute or usecase.

How can I use a workflow of usecase form keep attributes in usecase.

Can somebody see me an example for this.

As I understand Frank, his problem is that he needs a multiple step
usecase and he does not know how to do it.

His example is comparable with the typical car flow example of cocoon,
where you select one thing and the next select box depends on that. It
would be fairly easy to implement this with custom flow however I am
unsure myself how to do this multiple step flow with our usecase
framework.
If somebody has an suggestion or experience how to implement this it
would be wonderful to share it.


http://lenya.apache.org/docu20/reference/usecase-framework/usecase-framework-overview.html

advance()

"This method is called to advance the usecase after the a user interaction. In contrast to execute(), this method is not called when the <input type="submit" name="submit"> was pressed, but for every other submitting of the form. A typical usecase is the multiple forms editor where advance() is used to update the document when the user switched to another element."

All usecase parameters are preserved unless they are explicitly deleted or overwritten. Just be careful not to use fields, because the usecase handler object is destroyed and re-created for each request. BTW, in Lenya 2.2 you can use fields because Spring doesn't require to release the component.


HTH,

-- Andreas


--
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to