Re: WOForm Question
Re: WOForm Question
- Subject: Re: WOForm Question
- From: Chuck Hill <email@hidden>
- Date: Wed, 4 Apr 2007 13:54:04 -0700
On Apr 4, 2007, at 1:40 PM, David Avendasora wrote:
<WOForm>
aRouting
aRouting.routingDescription
aRouting.part
<routingSteps Repitition>
aRoutingStep.stepNumber
aRoutingStep.stepName
aRoutingStep.instructions
<rsComponent Repetition>
aRSComponent.lineNumber
aRSComponent.part
aRSComponent.quantity
</rsComponent Repetition>
</routingSteps Repitition>
<WOSubmitButton/>
</WOForm>
There are 1+ RoutingSteps for every Routing and 1+ RSComponents for
every RoutingStep.
I can get the attributes of aRouting to update without problem, but
I don't know exactly how I'm supposed to write the code
"Write the code"???? I think I see what is wrong. You should NOT be
writing code. Bind the UI to the EOs and it "just works". You are
trying to do WO's job for it and not doing it well.
to step through the 1+ RoutingSteps and update it's attributes
(stepNumber, stepName, instructions) and the same for the
RSComponent attributes.
I don't see why you would need any code at all for this UI.
The page builds exactly how I want it to, all of the WOTextFields
and WOPopUpButtons populate correctly, but when I click the submit
and call the method that would write my changes into the
EditingContext,
"write my changes into the EditingContext" I am afraid that you have
greatly misunderstood some aspects of WO. You are making this far,
far too hard.
I get a nullPointerException when it reaches the
aRoutingStep.setStepNumber(aRoutingStep.stepNumber()) call.
That is because aRoutingStep only has a meaningful value when _WO_ is
moving the data from the form into your objects. You can't use this
in an action method.
When updating several Objects of one Entity, do I have to iterate
through the array of Objects, or what? This is the part I think I'm
just not getting. Maybe. I just don't know and I can't find any
documented examples of updating multiple Objects of one Entity with
one WOForm.
Dave, let go of your fear. It just works. Bind it up, let WO worry
about how. That is what is does best.
Chuck
On Apr 4, 2007, at 3:23 PM, Chuck Hill wrote:
Where are the repetitions? What are the bindings inside a
RoutineStep?
On Apr 4, 2007, at 1:21 PM, David Avendasora wrote:
Hi all,
I am revising my question some.
Some review first. Here's my form structure:
<form>
Routing
-RoutingStep 1 of Routing
--RSComponent 1 of RoutingStep 1
--RSComponent 2 of RoutingStep 1
--RSComponent 3 of RoutingStep 1
-RoutingStep 2 of Routing
--RSComponent 1 of RoutingStep 2
--RSComponent 2 of RoutingStep 2
--RSComponent 3 of RoutingStep 2
-RoutingStep Etc, etc, etc.
</form>
I have no problem accepting and updating the "Routing" entity,
but I'm having problems getting the multiple related RoutingStep
and RSComponent entities to update. Can someone give me a general
outline of how the method for writing the changes into the
EditingContext should be formatted? I can't find any
documentation of this anywhere. This method is bound to the
submit button "action" binding.
Thanks!
Dave
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net
This email sent to email@hidden
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve
specific problems.
http://www.global-village.net/products/practical_webobjects
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
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