PDA

View Full Version : Error on duplicate ids



jbdiacompleto
15 Feb 2011, 11:14 AM
Hello everybody ...

I have a window which displays the data for each registered client for editing, but when I open several windows and each with its client all the fields are distorted, I discovered that the problem is I can not duplicate the id of the field, wanted to know how to solve so also in case of events like I'd get the handle of a button, for example, without my having to go but the id, name or pass itemId?

I look back
I thank you ...

darthwes
15 Feb 2011, 11:19 AM
You can get rid of the ids. That seems to be the winner for most people. JGarcia has a screencast about getting away from Ext.getCmp if you're interested I'm sure you can find it with a simple google search/forum search.

The other solution is to only ever have the form in the dom once. Meaning you could only have one window with the form in it open at a time. You can make a modal window with closeAction: 'close' so that the form only gets to be used once...

jbdiacompleto
16 Feb 2011, 3:36 AM
Thanks....

steffenk
16 Feb 2011, 5:35 AM
never use id in reusable components. There is itemId to do it correct.