You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by JD Daniels <jd...@kismetsoftware.com> on 2005/04/13 20:37:39 UTC
Re: Problem getting an object out of a drop down list
I am curently doing it like this, although I am having some binding
issues...
in my form definition, I make a string value like beanId, and I have a
business method in my java service to look it up, so the flow looks like:
function some_form()
{
var bean = new Packages.com.whatever.Bean();
// Create The Form
var form = new Form("forms/beanModel.xml");
var model = form.getWidget();
// Bind The Form To The Bean And Display It
form.createBinding("forms/beanBinding.xml");
form.showForm("internal/show-form/bean");
bean.category=service.getCategoryById(model.categoryId.value);
// Save The Form Data To The Bean
form.save(bean);
service.createBean(bean);
// Send The User Their Result
cocoon.redirectTo("wherever");
}
this works, although you can see I have to assign the objects manually;
the binding does not work for me.
JD
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?
>
> many thanks
>
> Uzo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Problem getting an object out of a drop down list
Posted by uzo <an...@jibeya.com>.
>I guess i should add that my lists look like:
>
><jx:forEach var="orderz" items="${userGlobal.getUserOrders()}">
> <option value="${orderz/id}">${orderz.getOrderDate()}</option>
></jx:forEach>
>
JD,
thanks for that heads up.
And just as I thought I had a nice easy solution! ;-)
regards
Uzo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Problem getting an object out of a drop down list
Posted by JD Daniels <jd...@kismetsoftware.com>.
I guess i should add that my lists look like:
<jx:forEach var="orderz" items="${userGlobal.getUserOrders()}">
<option value="${orderz/id}">${orderz.getOrderDate()}</option>
</jx:forEach>
JD Daniels wrote:
> I am curently doing it like this, although I am having some binding
> issues...
>
> in my form definition, I make a string value like beanId, and I have a
> business method in my java service to look it up, so the flow looks like:
>
> function some_form()
> {
> var bean = new Packages.com.whatever.Bean();
>
> // Create The Form
> var form = new Form("forms/beanModel.xml");
>
> var model = form.getWidget();
>
> // Bind The Form To The Bean And Display It
> form.createBinding("forms/beanBinding.xml");
> form.showForm("internal/show-form/bean");
>
> bean.category=service.getCategoryById(model.categoryId.value);
>
> // Save The Form Data To The Bean
> form.save(bean);
> service.createBean(bean);
>
> // Send The User Their Result
> cocoon.redirectTo("wherever");
> }
>
> this works, although you can see I have to assign the objects manually;
> the binding does not work for me.
>
> JD
>
>
> 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?
>>
>> many thanks
>>
>> Uzo
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org