[Opensource] transitions with the same name in different blocks

Michael Rimov rimovm at centercomp.com
Tue Mar 25 13:52:45 PST 2003


At 11:59 PM 3/24/2003 +0000, you wrote:
>what's wrong with this transition code?
>every time i hit one of the transition buttons they all seem to send the 
>same id, though
>if i look in the source code of the pagem they seem to have diferent ids.
>
>the controller:
>protected ControllerResponse runTest1State(
>  ControllerRequest myRequest, ControllerResponse myResponse )
>  throws ControllerException
>{
>   Block blockList = new Block("BlockList" );
>   for ( int k=0; k<5; ++k ) {
>    Block blockRow = new Block("OneBlock");
>    blockList.add( blockRow );
>    Transition t = new Transition("TEST","TEST", getClass().getName() );
                                         ^^^^^^^^^^^^^^^^^^^^^
Try this instead
         Transition t = new Transition("TEST" + k, "TEST", 
getClass().getName());

Transitions should be uniquely named.

HTH!
                                                 -Mike







>    t.addParam("state", "test2");
>    t.addParam("id", Integer.toString(k) );
>    blockRow.add(t);
>   }
>   myResponse.addBlock( blockList );
>    return myResponse;





More information about the Opensource mailing list