Ken and everyone, here's the gist of what I'm trying to do:
I had a component in my app that had a WOForm nested inside a
WORepetition to submit OrderItems to a manufacturing schedule. One
form for each OrderItem, each with it's own submit button. I thought
I could make the page much more efficient (from both the user's and
the application's perspective) by having just one form that the user
selects which items they want scheduled. The way they indicate what
OrderItems they want scheduled is by changing an item's
quantityToSchedule from null to some quantity. (using a WOTextField)
The only form field in the form is the repeated quantityToSchedule.
The quantityToSchedule value is NOT an attribute of OrderItem, and
I'm not actually updating OrderItem, I am using the information from
the submitted form to create new instances of the ScheduledOrderItem
entity.
When I submit the form, I get a null pointer exception when I try to
pass the instance of OrderItem that is bound to the WORepitition's
"item" binding (aOrderItem). Am I doing something obviously wrong?
Here's the structure of my page:
<WOForm>
<WOSubmitButton action=scheduleOrderItem>
<WORepetition list=openOrderItems, item=aOrderItem>
<WOString value=aOrderItem.Order.DueDate>,<WOString
value=aOrderItem.Part.PartName>,
<WOString value=aOrderItem.orderQuantity><WOTextField
value=quantityToSchedule>
</WORepitition>
</WOForm>
Here's the method that is bound to hte action binding of the
WOSumbitButton:
Public WOComponent addOrderItemToSchedule() {
ec = session().defaultEditingContext();
log.debug("OrderItem to Schedule: "+aOrderItem.part
().partName());
manufacturingSchedule.scheduleOrderItem(ec, aOrderItem,
quantityToSchedule);
return context().page();
}
aOrderItem is null and I get a NPE. Why is aOrderItem null?
Dave
On Apr 10, 2007, at 10:54 AM, Ken Anderson wrote:
I unfortunately don't have the history from this thread around, but
there should be no problem with having a single submit button
saving hundreds of EOs, including multiple instances of the same
class. I have many forms where there's a single submit, but I have
hundreds of EOs on the page, and sometimes edit/insert many.
On Apr 10, 2007, at 11:48 AM, David Avendasora wrote:
That's the conclusion I've come to. So how do you submit multiple
instances of one class to a form without having to click submit
for every instance? Is it impossible?
On Apr 10, 2007, at 9:51 AM, Daniele Corti wrote:
wait, I've just remember: aOrderItem is the item bind in the
WORepetition? if so, it will be null, when clicking Submit
button, because the submit button is outside the WORepetition
(oh, well I think iit works in that way...)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/kenlists%
40anderhome.com
This email sent to [EMAIL PROTECTED]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]