cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <lgaw...@mobilebox.pl>
Subject Re: Problem getting an object out of a drop down list
Date Thu, 14 Apr 2005 09:40:01 GMT
beyanet.com wrote:
> Ok,
> let me explain. I have a html page which presents a selection of 
> previous orders made by a client. In the option value section I place 
> the associated order objects of a user like so:
> 
> <jx:forEach var="orderz" items="${userGlobal.getUserOrders()}">
>    <option value="${orderz}">${orderz.getOrderDate()}</option>
> </jx:forEach>
> 
> The rendered html page looks like so:
> 
>     <option value="test.Order@687436">2005-04-13 17:23:05.663</option>
>     <option value="test.Order@95fec3">2005-04-13 14:23:04.211</option>
>     <option value="test.Order@88c56e">2005-04-13 12:22:04.096</option>
> 
> As you can see the problem I have is that test.OrderXXX is now a string 
> value, but I want it to remain an object.
> 
> What I wanted to do was take the orderitem object, when the user selects 
> an option from the drop-down list, pass it into another flow function 
> which in turn then displays the orderitem details in another html page.
> 
> So how can I do this so that when it reaches the next flow function it 
> is still an object and not a string?
It cannot be an object. do something like:

 > <jx:forEach var="orderz" items="${userGlobal.getUserOrders()}">
 >    <option name="order"
             value="${orderz.id}">${orderz.getOrderDate()}</option>
 > </jx:forEach>

then in flowscript:

sendPageAndWait( "showOrders.jx", { userGlobal: userGlobal } );
var orderId = cocoon.request.getParameter( "order" );

var order = resolverOrderById( orderId );

that's all.
-- 
Leszek Gawron                                      lgawron@mobilebox.pl
IT Manager                                         MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message