<. Hi Joerg! .>
Friday, July 2, 2004, 12:09:22 AM, you wrote:
>> I mean state of all widgets (including uploads).
JH> But as I said IMO for uploads this makes no sense.
>> It's quite simple because form
>> behaves almost it's used for the first time for uploading. Upload widgets show
>> files upload, there is button (looks like [..]) that enables user to do new
>> upload. When user hit submit, all I have to do is just map widgets from repater
>> to database (including data from upload widget).
>> But lack of setValue method breaks down my dream :-(
JH> Hmm, okay, ayou can raise this issue of course on the developers list
JH> (or tomorrow in IRC, it's First Friday, and many people will be there).
JH> Maybe other people think of it as an useful addition too.
I think clear example will explain everythink:
we have repater like
<fd:repeater id="uploads">
<fd:label>Uploads</fd:label>
<fd:widgets>
<fd:field id="name" required="true">
<fd:label>File name</fd:label>
<fd:datatype base="string"/>
</fd:field>
<fd:field id="description" required="true">
<fd:label>Description</fd:label>
<fd:datatype base="string"/>
</fd:field>
<fd:upload id="file" mime-types="text/plain" required="true">
<fd:label>File</fd:label>
</fd:upload>
</fd:widgets>
</fd:repeater>
For the first time it will work perfectly, when user hit submit, some binding
will collect data from form and store it in db.
Let's see what is going on when we want to edit stored data.
At the begining binding is carryed out. First problem: we can't bind BLOB ->
upload widget, but as you said it makes no sense, so let's go ahead.
We have some rows filled in with data in the repeater, each row has upload
empty upload widget that suggesting to a user that he has to upload some data.
If he was smart, he did what he want and hit submit button. Then we have some
mess, upload widget is required so it will raise validating errors.
Another try...
Editing form is different from adding form. It has two repaters:
<fd:repeater id="existing_uploads">
<fd:label>Existing uploads</fd:label>
<fd:widgets>
<fd:field id="name" required="true">
<fd:label>File name</fd:label>
<fd:datatype base="string"/>
</fd:field>
<fd:field id="description" required="true">
<fd:label>Description</fd:label>
<fd:datatype base="string"/>
</fd:field>
</fd:widgets>
</fd:repeater>
<fd:repeater id="uploads">
<fd:label>Uploads</fd:label>
<fd:widgets>
<fd:field id="name" required="true">
<fd:label>File name</fd:label>
<fd:datatype base="string"/>
</fd:field>
<fd:field id="description" required="true">
<fd:label>Description</fd:label>
<fd:datatype base="string"/>
</fd:field>
<fd:upload id="file" mime-types="text/plain" required="true">
<fd:label>File</fd:label>
</fd:upload>
</fd:widgets>
</fd:repeater>
The second one is for adding new files, the first one is for deleting existing,
but how upload new data to existing file? :-)
Ohh, and something else... If problem with upload somehow is solved, we will
have another with handling form submit. If we want do something more than
simple binding, and we want read files we have to read it from form (newly
uploaded) and from db (existing before).
What a mess, isn't it? :-)
--
Best regards
<. g[R]eK mailto:[EMAIL PROTECTED] .>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]