jQuery UI Functional Test Suite

Say it in Smalltalk, Do it with jQuery

Button

For additional documentation and examples please visit the official web-site.

Demo

Configure

Smalltalk

JQButtonFunctionalTest>>renderContentOn: html
   html form
      id: 'toolbar';
      class: 'ui-widget-header';
      class: 'ui-corner-all';
      with: [
         self renderAnchorOn: html.
         self renderCheckboxOn: html.
         self renderOptionOn: html ]

JQButtonFunctionalTest>>renderAnchorOn: html
   html anchor
      onClick: (html javascript
         alert: 'Nothing to configure right now.');
      script: (html jQuery this button
         text: false;
         primaryIcon: 'ui-icon-gear');
      with: 'Configure'

JQButtonFunctionalTest>>renderCheckboxOn: html
   html checkbox
      value: locked;
      callback: [ :value | locked := value ];
      onChange: (html jQuery ajax serializeForm);
      script: (html jQuery this button
         text: false;
         primaryIcon: 'ui-icon-locked').
   html label
      for: html lastId;
      with: 'Lock'

JQButtonFunctionalTest>>renderOptionOn: html
   html span
      script: (html jQuery this buttonset);
      with: [
         html radioGroup
            selected: number;
            callback: [ :value | number := value ];
            with: [ :group |
               #(1 2 3) do: [ :each |
                  group radioButton
                     onChange: (html jQuery ajax serializeForm);
                     value: each.
                  html label
                     for: html lastId;
                     with: each ] ] ]

Source

< = = = = =>
  < =>Configure</>
  < = = = =/>
  < = = =/>
  < =>Lock</>
  < =>
    < = = = = = =/>
    < =>1</>
    < = = = = =/>
    < =>2</>
    < = = = = =/>
    < =>3</>
  </>
</>
< =>/*<![CDATA[*/$("#id36").bind("click",function(){alert("Nothing to configure right now.")});$("#id36").button({"text":false,"icons":{"primary":"ui-icon-gear"}});$("#id39").bind("change",function(){$.ajax({"url":"/javascript/jquery-ui/button","data":["_s=pqMmBymI9dlMci1d","_k=8KDhMLCpSoNErRWT","38",$(this).closest("form").find(":input").serialize()].join("&")})});$("#id39").button({"text":false,"icons":{"primary":"ui-icon-locked"}});$("#id41").buttonset();$("#id44").bind("change",function(){$.ajax({"url":"/javascript/jquery-ui/button","data":["_s=pqMmBymI9dlMci1d","_k=8KDhMLCpSoNErRWT","43",$(this).closest("form").find(":input").serialize()].join("&")})});$("#id46").bind("change",function(){$.ajax({"url":"/javascript/jquery-ui/button","data":["_s=pqMmBymI9dlMci1d","_k=8KDhMLCpSoNErRWT","45",$(this).closest("form").find(":input").serialize()].join("&")})});$("#id48").bind("change",function(){$.ajax({"url":"/javascript/jquery-ui/button","data":["_s=pqMmBymI9dlMci1d","_k=8KDhMLCpSoNErRWT","47",$(this).closest("form").find(":input").serialize()].join("&")})});/*]]>*/</>