[Seaside] NAME attribute over-ride for dynamic HTML

C. David Shaffer cdshaffer at acm.org
Fri Oct 22 15:48:45 CEST 2004


Romain Robbes wrote:

>     Hi Bob,
>
> I think you can freely use the id attribute instead of the name one.
> Then in javascript you can use document.getElementById(id) to access
> the html element you need.
>
> Cheers,
>     Romain
>
>
Yes, this is definitely the preferred method since the id attribute is 
the only one which is guaranteed to be unique across an entire page.  
One note: be careful with "WAHtmlRenderer>>textInputOn:of:" since it 
tries to set the id of the component to the value of the first 
argument.  I have an override that I carry around to fix this:

textInputOn: aSymbol of: anObject
    self attributes at: 'id' ifAbsentPut: aSymbol.
    self
        textInputWithValue: (anObject perform: aSymbol)
        callback: (self callbackForSelector: aSymbol of: anObject)

this preserves the old behavior if no id is set.


David



More information about the Seaside mailing list