Fellow Tapestry Users,

I have the following code in Tapestry

 <t:loop source="ubForm.conditioncodes" value="conditioncode" 
index="conditionindex" encoder="conditionCodeEncoder">
  <t:zone id="conditionZone" t:id="conditionZone">
      <td>
         <INPUT t:type="TextField" maxlength="2" t:clientEvent="change" 
             t:event="updateConditionCode" t:zone="conditionZone" 
             t:clientid="${getConditionCodeId('conditioncode', 
conditionindex)}" t:value="conditioncode.conditioncode" 
             t:mixins="ZoneUpdater" style="width:90%; height:25px; 
border:none;" />
      </td>
      </t:zone>
      </t:loop>

Bascially the issue i am running into is if the user goes and backspaces the 
contents of the textfield, my event , updateConditionCode fires, but the parms 
passed into the event are null!

Here is my code, had to tweak ZoneUpdater.js so i could include the id of the 
control that triggered the event

(function($) {
window.T5JQZoneUpdater = function(spec) {
var elementId = spec.elementId;
var element = document.getElementById(elementId);
var url = spec.url;
var $zone = $('#' + spec.zone);

var updateZone = function() {
var updatedUrl = url;
var params = {};

params.param = element.value;
params.id = elementId;
params.target = event.target.id;

$zone.tapestryZone('update', {
url : updatedUrl,
params : params
});
}

if (spec.event) {
var event = spec.event;
$(element).bind(event, updateZone);
}

return {
updateZone : updateZone
};
};
})(jQuery);

Can someone suggest a way for me to get the id of the input control that 
triggered the event when user clears its contents? I have seen comments about 
how keyup/change evnt does not appear to trigger the event but if you put 
spaces it does.

The goal here is if user backspaces and clears the field i wanted to use the 
zoneUpdater to inform my POJO to clear its contents


Thanks for your help

Reply via email to