Validator on repeatview wicket -


i insert inputs on repeatview (quickview). when inputs have errors (ex: requiredvalidator), submit event stopped, errors don't show. how can validate , display errors on repeatview ?

addbaseestimatepanel.java

public class addbaseestimatepanel extends panel {  private void initform(final form<estimate> form, final feedbackpanel feedbackpanel) { ...                 idataprovider<estimatedetailmodel> data = new listdataprovider<estimatedetailmodel>(                         listestimatedetailmodel);                 final webmarkupcontainer mitsumorideitashōsairowsstable = new webmarkupcontainer(             "mitsumorideitashōsairowsstable");             final estimatedetaillistaddtable mitsumorideitashōsairows = new estimatedetaillistaddtable(             "mitsumorideitashōsairows", data, listestimatedetailmodel,             new itemsnavigationstrategy(), 10, start, null) {         private static final long serialversionuid = 3950744346751551366l;          @override         protected void initrow() {             super.initrow();             // addnewitems(initproductemptyrows(5));         }          @override         protected void oncheckboxchange(estimatedetailmodel model,                 ajaxrequesttarget target) {             super.oncheckboxchange(model, target);             if (model.ischecked()) {                 deleteproductbtn.setenabled(true);             } else {                 deleteproductbtn.setenabled(hascheckboxchecked());             }             checkall = allcheckboxischecked();             target.add(deleteproductbtn, checkallcheckbox);         }          @override         protected void onkeyteikyo(ajaxrequesttarget target) {             super.onkeyteikyo(target);             addnewitems(initproductemptyrows(1));         }          @override         protected void counttotal(estimatedetailmodel model,                 ajaxrequesttarget target, component... components) {             if (model.getunitprice() == null || model.getquantity() == null) {                 return;             }             float _amount = model.getunitprice() * model.getquantity();             counttotal -= model.getamount();             model.setamount(_amount);             counttotal += model.getamount();             target.add(total);             target.add(components);         }     };     mitsumorideitashōsairowsstable.add(mitsumorideitashōsairows);     ...  } 

estimatedetaillistaddtable.java

public abstract class estimatedetaillistaddtable extends     quickview<estimatedetailmodel> {     @override protected void populate(final item<estimatedetailmodel> item) {     checkboxajaxchange checkbox = new checkboxajaxchange("checkbox",             new propertymodel<boolean>(item.getmodel(), "checked")) {         private static final long serialversionuid = 3455428602642567322l;          @override         protected void oncheckchange(final ajaxrequesttarget target) {             if (item.getmodelobject().ischecked()) {                 selecteditems.add(item);             } else {                 selecteditems.remove(item);             }             oncheckboxchange(item.getmodelobject(), target);         }     };     label no = new label("no", new propertymodel<integer>(item.getmodel(),             "no"));     final select2choicebase<product> codeselect = new select2choicebase<product>(             "code", new propertymodel<product>(item.getmodel(), "product"),             new productidprovider(products, estimatedetailmodels)) {         private static final long serialversionuid = 737457596926341699l;          @override         protected void config() {             super.config();             getsettings()                     .setformatselection(                             "function(obj){ if(obj.id==0)return '';return obj.id; }");         }     };     final select2choicebase<product> nameselect = new select2choicebase<product>(             "name", new propertymodel<product>(item.getmodel(), "product"),             new productnameprovider(products, estimatedetailmodels));     final numbertextfield<float> amount = new numbertextfield<float>(             "amount", new propertymodel<float>(item.getmodel(), "amount")) {         private static final long serialversionuid = -2316554599671359643l;     };     final numbertextfield<integer> quantity = new numbertextfield<integer>(             "quantity", new propertymodel<integer>(item.getmodel(),                     "quantity")) {         private static final long serialversionuid = -5753172372351592833l;          @override         public void renderhead(iheaderresponse response) {             string script = "$('#" + getmarkupid()                     + "').number( true, 0 );";             response.render(ondomreadyheaderitem.forscript(script));         }     };     quantity.setoutputmarkupid(true);     final textfield<string> unit = new textfield<string>("unit",             new propertymodel<string>(item.getmodel(), "product.unit")) {         private static final long serialversionuid = -2316554599671359643l;          @suppresswarnings("unchecked")         @override         public <c> iconverter<c> getconverter(class<c> type) {             return (iconverter<c>) new unitconverter();         }     };     final numbertextfield<integer> price = new numbertextfield<integer>(             "price", new propertymodel<integer>(item.getmodel(),                     "unitprice")) {         private static final long serialversionuid = -8646496003644699535l;     };     unit.setoutputmarkupid(true);     price.setoutputmarkupid(true);     amount.setoutputmarkupid(true);     quantity.add(new onchangeajaxbehavior() {         private static final long serialversionuid = 1563937210317123609l;          @override         protected void onupdate(ajaxrequesttarget target) {             onquantitychange(item.getmodelobject(), target, amount);         }     });     price.add(new onchangeajaxbehavior() {         private static final long serialversionuid = -8638379626220896934l;          @override         protected void onupdate(ajaxrequesttarget target) {             onpricechange(item.getmodelobject(), target, amount);         }     });     codeselect.add(new onchangeajaxbehavior() {         private static final long serialversionuid = 7159818718453062684l;          @override         protected void onupdate(ajaxrequesttarget target) {             oncodechange(item, target, nameselect, quantity, unit, price,                     amount);         }     });     nameselect.add(new onchangeajaxbehavior() {         private static final long serialversionuid = -7575744336298650067l;          @override         protected void onupdate(ajaxrequesttarget target) {             onnamechange(item, target, codeselect, quantity, unit, price,                     amount);         }     });     final textarea<string> apply = new textarea<string>("apply",             new propertymodel<string>(item.getmodel(), "tekiyo"));     apply.add(new abstractdefaultajaxbehavior() {         private static final long serialversionuid = 3598447798201761103l;          @override         protected void respond(ajaxrequesttarget target) {             onkeyteikyo(target);         }          @override         public void renderhead(component component, iheaderresponse response) {             super.renderhead(component, response);             // response.render();         }     });     apply.add(stringvalidator.maximumlength(40));     apply.add(new onchangeajaxbehavior() {         private static final long serialversionuid = 1l;          @override         protected void onupdate(ajaxrequesttarget target) {             // target.add(apply);         }     });     item.add(checkbox);     item.add(no);     item.add(codeselect);     item.add(nameselect);     item.add(quantity);     item.add(price);     item.add(unit);     item.add(amount);     item.add(apply);     // item.add(new estimatedetailvalidator(item.getmodelobject())); } } 

about quicketview: https://github.com/vineetsemwal/quickview

you should use https://github.com/vineetsemwal/quickview/blob/b52cc594b1118e741f38625574a38208d096419a/wicket-quickview/src/main/java/com/aplombee/reuseallstrategy.java strategy.

additionally should assign ivalidator formcomponent and/or iformvalidator form components. adding validator item won't anything.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -