cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: Repost from users list: Cforms Repeater - Cancel delete action via javascript
Date Tue, 30 Aug 2005 14:32:25 GMT
Christoph Hermann wrote:

>Sylvain Wallez schrieb:
>
>Hello,
>
>  
>
>>>Maybe the Cocoon Code c(sh)ould be changed to make this possible?
>>>Imho it would be very "natural" to allow the javascript to cancel the
>>>action.
>>>And it shouldn't be too difficult to implement this.
>>>      
>>>
>
>  
>
>>I thought about it as well, but it's not as easy as it seems though. The
>>moment where the event listeners are called depends on the action type
>>[...]
>>So allowing event listeners to cancel the action would require to change
>>this behaviour, which was designed to allow listeners to take
>>complementary actions to the main one.
>>
>>In the end, my opinion is that if conditional action is needed, then
>>it's better to write the few corresponding lines in a regular fd:action
>>that has no built-in behaviour like row-actions and repeater-actions do.
>>    
>>
>
>Yes your right, but thing is that the action does not trigger the
>validation process. I tried form.validate() and
>form.endProcessing(true); and didn't success, and i don't have the time
>atm to investigate this any further. What i'd like to do is to trigger a
>validationError if the wrong row shall be deleted.
>  
>

Then you can simply call someWidget.setValidationError(...) from within 
your event listener.

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://people.apache.org/~sylvain     http://www.anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


Mime
View raw message