Stuart,

 

Thanks for fast response.

Let me explain my problem once again,

 

I have a selection list and a table that is using a repeater widget.

 The table contains three columns   

*)  Item name

*)  Move – which contains arrow to move item names up and down

*)  Delete - contains button to remove a  row from the table.

 

 The selection list is populated with the same values as the item name columns of the table  .My requirement is when I remove an item from the table using the delete button  the corresponding item has to be removed from the selection list .

 

The button is using the row -action delete method to remove an item. <row-action id="delete" action-command="delete">.  And as far as my knowledge it is not possible to capture this row action command in the back end. Correct me if I am wrong.  Also I have some constraint to make my delete button as a submit widget.

 

I am able to get the item name removed from table using statement var queryToRemove = event.source.parent.lookupWidget("name").value  .Using this value I need to remove the same entry from selection list . For that I was using the code snippet in my previous post to remove one particular item from selection list.

 

Thanks,

Prateesh

 

 


From: Stuart Thorne [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 18, 2005 7:44 PM
To: [email protected]
Subject: RE: Removing an item from Cocoon selection list

 

Hi Prateesh,

 

You want to delete/remove a list value at run time, without the ‘user’ hitting a delete button?

 

You could use the flow script to look up the form page when it’s binding, and then remove the attribute as it loads.

 

I have done something similar whereby I remove a specific row from a Repeater Widget, on run time.

 

Your def XML file example requires the action-command ‘delete’ to be called, perhaps by hitting a ‘delete’ button.

 

Also, check what is being returned for *event.source.parent.lookupWidget("name").value;*

 

If it’s a selection list, are you trying to delete all values in the list, or one in particular?

 

Stu

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 18 August 2005 13:55
To: [email protected]
Subject: Removing an item from Cocoon selection list

 

Hi,

 

Is there a way to remove an element from selection list on run time?

 

I am using the below code in a definition XML file .But removeAttribute method is not working

 

<row-action id="delete" action-command="delete">

          <label><i18n:text>Delete</i18n:text></label>

                           <on-activate>

                                       <_javascript_> 

                                          var queryToRemove = event.source.parent.lookupWidget("name").value;

                                         event.source.parent.parent.parent.lookupWidget("defaultQuery").removeAttribute(queryToRemove);

                                       </_javascript_>       

                         </on-activate>

 

    </row-action>

 

 Any help on this is highly appreciated.

 

 

Ps : defaultQuery is a cocoon field that is styled as a  selection list

 

Thanks,

Prateesh


_____________________________________________________________________
This e-mail has been scanned for viruses by MCI's Internet Managed Scanning Services - powered by MessageLabs. For further information visit http://www.mci.com



Confidentiality Notice

The information contained in this electronic message and any attachments to this message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately
and destroy all copies of this message and any attachments.


Confidentiality Notice

The information contained in this electronic message and any attachments to this message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately
and destroy all copies of this message and any attachments.

Reply via email to