Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Tapestry Wiki" for 
change notification.

The following page has been changed by RyanSkow:
http://wiki.apache.org/tapestry/Tapestry5PaletteEvents

New page:
This page shows an example of how to do something when the selected items are 
added/removed/reordered in a Palette.

Anything can happen in your 'doMyStuff' method including submitting an Ajax 
request to do some calculations based on the contents of the select list or 
displaying other details related to what has been selected.  

Note that this is hack is likely to break if the Palette's 'updateHidden' 
function is changed.  Hopefully someone better versed in Javascript can figure 
out a way to call the original method (super.updateHidden or something of that 
nature) to avoid the copy/paste of code...  Perhaps this example will spur some 
additional ideas.


{{{
<script type="text/javascript">
        
  Tapestry.Palette.prototype.updateHidden=function()
  {
    // Begin copy from original Palette source
    // Every value in the selected list (whether enabled or not) is combined to 
form the value.
    var values = $A(this.selected).map(function(o)
    {
        return o.value;
    });

    this.hidden.value = values.toJSON();
    // End copy from original Palette source

    doMyStuff();
  }

  function doMyStuff()
  {
    // your stuff goes here
  }

</script>
}}}

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to