Re: Submitting multiple instances in one WOForm
Re: Submitting multiple instances in one WOForm
- Subject: Re: Submitting multiple instances in one WOForm
- From: "Daniele Corti" <email@hidden>
- Date: Tue, 10 Apr 2007 16:51:52 +0200
2007/4/10, David Avendasora <email@hidden>:
log.debug("manufacturingSchedule.scheduleDescription"); executes just fine, but log.debug(aOrderItem.orderQuantity()); on the other-hand gives me a null pointer. Obviously aOrderItem.Part() is going to be null as well.
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...)
The problem is aOrderItem is null, and I don't understand why.
Also, here's a simplified version of the code without the casting:
public WOComponent addOrderItemToSchedule() {
ec = session().defaultEditingContext();
log.debug("OrderItem to Schedule: "+aOrderItem.part().partName());
manufacturingSchedule.scheduleOrderItem(ec, aOrderItem, quantityToSchedule);
return context().page();
}
On Apr 10, 2007, at 8:51 AM, Daniele Corti wrote:
2007/4/10, David Avendasora <
email@hidden>:Okay, I added a setQuantityToSchedule method, but I still get the
NullPointerExeption.
Here's the method I'm actually calling in the action binding of the
WOSubmitButton:
public WOComponent addOrderItemToSchedule() {
ec = session().defaultEditingContext();
log.debug("OrderItem to Schedule: "+aOrderItem.part().partName());
((ManufacturingSchedule)manufacturingSchedule).scheduleOrderItem(ec,
(OrderItem)aOrderItem,
quantityToSchedule);
return context().page();
}
I get a NullPointerException on the log.debug statement, or if I
comment it out, on the scheduleOrderItem() call.
So you have 2 problems: manufacturingSchedule is null, and or aOrderItem is null or
aOrderItem.part() is null
--
Daniele Corti
AIM: S0CR4TE5
Messenger:
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden