Now, I realise that the Shot Previews cannot be deleted by JavaScripts in the Binding, because the user may decide to cancel the form operation after they have removed Shots in the repeater rows.
So I need to maintain a record somehow of what Shots are being deleted, so I can then remove the Shot Previews only after the form is submitted.
Hrumph !
regards Jeremy
On 8 Jul 2004, at 10:22, Jeremy Quinn wrote:
On 8 Jul 2004, at 09:59, Joerg Heinicke wrote:
On 08.07.2004 10:52, Jeremy Quinn wrote:Thanks for your reply.Is there some way to have a FlowScript function called from the binding when node deletion takes place in a CForms repeater ?
You could try using a <fb:javascript> element inside the <fb:on-delete-row> element of your repeater binding. I haven't tried it myself, so I'm not sure if it'll work, but you never know...
Something I stupidly forgot to mention, I am using a simple-repeater, it does not take fb:on-delete-row.
Simple repeater does not make a diff IIRC. It just removes *all* rows and readds the new ones. So an event on-delete-row does not make sense for it.
TBH. I am a bit confused about the two repeaters and how they work with an XML Model.
This is what I have (this project still uses 2.1.4 and Woody) :
<wb:context
xmlns:wb="http://apache.org/cocoon/woody/binding/1.0"
xmlns:wd="http://apache.org/cocoon/woody/definition/1.0"
path="/storyboard">
<wb:value id="title" path="title"/>
<wb:value id="description" path="description"/>
<wb:value id="creator" path="creator"/>
<wb:value id="count" path="string(count(shots/shot))" direction="load"/>
<wb:simple-repeater id="shots"
parent-path="shots"
row-path="shot">
<wb:value id="id" path="./@id"/>
<wb:value id="title" path="title"/>
<wb:value id="description" path="description"/>
<wb:value id="wasshot" path="wasshot"/>
<wb:value id="shotok" path="shotok"/>
<wb:value id="created" path="created"/>
<wb:value id="preview" path="preview"/>
<wb:value id="mimetype" path="preview/@mimetype"/>
</wb:simple-repeater>
</wb:context>
to edit this :
<storyboard id="blah"> . . . <shots> <shot id="blag"> <preview ref="0123456789" mime-type="image/jpeg"/> . . . </shot> . . . </shots> </storyboard>
Can I use (non-simple) Repeater with this? Plus have Up, Down, Delete and Add buttons.
Thanks
regards Jeremy
--------------------------------------------------------
If email from this address is not signed IT IS NOT FROM ME
Always check the label, folks !!!!! --------------------------------------------------------
--------------------------------------------------------
If email from this address is not signed
IT IS NOT FROM MEAlways check the label, folks !!!!! --------------------------------------------------------
smime.p7s
Description: S/MIME cryptographic signature
