Hello,

I would like to know how I can retrieve the ID of the component which triggered an even when I'm in an event handler method ?

Well, perhaps that my problem is not this problem, so there is a little background to help you to decide...

In my application, I have to create a component to manage an editable list of string. The available (functional) actions are "add a string", "remove a string", "edit string". I need to present the edit form so that all action can be done in the same page :
8<---------------
(note: "string?" are input text field)
| string1 |   _delete_
| string2 |   _delete_
| string3 |   _delete_
_add_a_value
_submit_change_
_reset_
8<---------------

So, there's no real problem to do this : in the html template, I used a form component, with a loop component which goes through the list. I want that if an user edit some field and then want to add/delete a value, his modification are kept, so _add_a_value_ and _delete_ are submit button. The template looks like :

8<---------------
<t:loop t:source="range"  t:value="index">
   <p>
       <input t:type="TextField"/>
       <t:submit t:id="remove"  value="Remove"/>
   </p>
</t:loop>
<t:submit t:id="add"  value="Add"/>
...
8<---------------

In the Java code, I have two event handler : onSelectedFromAdd() and onSelectedFromRemove(), and they are called when matching button are submitted. But for the delete button, I don't know which one was really submitted. I would be happy if I can retrieve the id of the submitted "remove": I can generate it so that I can retrieve the matching value to remove. An other option would be to pass a context to the submit event, but I don't think it's possible...

So, if you have any idea to help me, they will be well-appreciated...

Francois Armand




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to