[Seaside] Seaside updater

Richard K Eng richard.eng at rogers.com
Sat Mar 8 15:38:30 UTC 2008


I'm puzzled how to use #updater. I'm trying to use a checkbox to add text to 
a textArea input field. For example,...

renderBillingCheckboxAndAddressOn: html
 html div
  class: 'frow';
  with:
   [html break.
   html paragraph:
    [html checkbox
     value: useShippingAddress;
     callback: [:value | useShippingAddress := value];
     onClick: (html updater id: 'shipping';
       callback: [:r | useShippingAddress := useShippingAddress not.
          self renderBillingAddressOn: r] );
     with: 'Use shipping address as billing address also']].
 html div
  class: 'frow';
  with:
   [html span
    class: 'formlabel';
    with: [html text: 'Billing address'].
   html span
    class: 'forminput';
    with: [self renderBillingAddressOn: html]]


This code works, but I'm sure it's not the right way to do things. The 
reason I have the 'useShippingAddress := useShippingAddress not' nonsense is 
because without it, I can't get #useShippingAddress to have the correct 
checkbox value in #renderBillingAddressOn:. The problem is, 
#useShippingAddress only gets the correct checkbox value on form submission, 
NOT upon invocation of #onClick:.

Ultimately, what I want is for #onClick: to use whatever value is selected 
by the form control, whether the control is a checkbox or radio button or 
dropdown menu. This *has* to be doable, so the question is:  HOW???

Regards,
Richard 



More information about the seaside mailing list