[Seaside] Utility Method

Yar Hwee Boon hboon at motionobj.com
Thu Jun 16 18:10:24 CEST 2005


On 16-Jun-05, at PM 11:54, Bill Holloway wrote:

> I added to my personal image, the following utility method to 
> WAHTMLRender:
>
>  labeledTextInputOn: aSymbol of: anObject
>      self
>          label: [aSymbol asCapitalizedPhrase asString] value input: [];
>          textInputOn: aSymbol of: anObject
>
>  This generates a quick, one-off <label>ed field.  I tried using 
> WAHtmlRenderer>>#label:input: but this puts the <input> tag inside the 
> <label> tag's body.  HTML gurus, is that ok?  Here's a sample what the 
> above method generates (formatted source):
>
>  <label for="id1">
>    First Name
>  </label>
>  <input type="text" value="Fred" name="2" id="id1" />

How about:

labeledTextInputOn: aSymbol of: anObject
      self
          label: aSymbol asCapitalizedPhrase
          input: [self textInputOn: aSymbol of: anObject]

If your question was about whether <input> being nested in <label> is 
correct, IIRC, you can either specify the "for" attribute OR nest the 
<input> in the <label>. Doing both probably doesn't hurt :)

--
HweeBoon
http://motionobj.com/blog/


More information about the Seaside mailing list