Re: Saving data from WOFileUpload in a sub-component
Re: Saving data from WOFileUpload in a sub-component
- Subject: Re: Saving data from WOFileUpload in a sub-component
- From: "Daniele Corti" <email@hidden>
- Date: Thu, 9 Aug 2007 09:26:42 +0200
2007/8/9, David Holt <email@hidden>:
I have a sub-component inside a form that contains a WOFileUpload.
<form>
Name
Address
<uploadcomponent>
WOFileUpload
Date of upload
</uploadcomponent>
Submit
</form>
Normally I set the values in the database using a method that
evaluates the bindings in the WOFileUpload when I submit the form. In
this case I can't do that because the submit button is in the parent
component. How can I programatically set attribute values in a sub-
form when the parent form is submitted?
David, I really don't see a good reason to split you data in two component: if you have one submit, the best choice would be to have the entire form inside the subcomponent.
Another way would be to set the form as Multiple submit, and create two submit: one for the FileUpload, One for the other data to save.
I.E.
YourMainComponent Start
<wo:WOForm>
<wo:WOTextFileds value="$name" />
<wo:WOText value="$address" />
<wo:UpLoadComponent />
<wo:WOSubmitButton action="" />
</wo:WOForm>
YourMainComponent End
UpLoadComponent Start
<wo:WOFileUpload /> //I don't remember the binding for this...
<wo:WOSubmitButton action="" />
UpLoadComponent End
You can see I don't insert Date of Upload, because I've not understand what that was: if it is an input for the date is useless, because The date is the moment when the submit is press, if it is a String with the current date, you can display it after the submit of the subcomponent, in place of the WOFIleUpload
David
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AIM: S0CR4TE5
Messenger: email@hidden
--
Computers are like air conditioners -- they stop working properly if you open
WINDOWS
--
What about the four lusers of the apocalypse? I nominate:
"advertising", "can't log in", "power switch" and "what backup?"
--Alistair Young
_______________________________________________
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