Sto provando a sovrascrivere un metodo all'interno di un widget jquery. Il metodo può essere trovato sulla linea 122 a https://github.com/got5/tapestry5-jquery/blob/master/src/main/resources/org/got5/tapestry5/jquery/validation.jsMetodo di override all'interno del widget jquery
Id piacerebbe modificare l'output html on line 141
Ho provato ad aggiungere il seguente alla classe di mia abitudine js senza successo. Se qualcuno può spiegare come farlo, l'id lo apprezza molto.
(function($) {
$.widget("ui.tapestryFieldEventManager", {
showValidationMessage : function(message) {
var field = this.element;
var form = field.closest('form');
this.options.validationError = true;
form.formEventManager("setValidationError", true);
field.addClass("t-error");
this.getLabel() && this.getLabel().addClass("t-error");
var icon = this.getIcon();
if (icon) icon.show();
alert("here");
var id = field.attr('id')+"\\:errorpopup";
if($("#"+id).size()==0) //if the errorpopup isn't on the page yet, we create it
field.after("<div id='"+field.attr('id')+":errorpopup' class='tjq-error-popup test'/>");
Tapestry.ErrorPopup.show($("#"+id),"<span>"+message+"</span>");
}
});
})(jQuery);
Potrebbe essere solo io, ma non penso che questo approccio esatto funzioni con jQuery UI 1.9.x. – jokeyrhyme