jsf 2 - change h:inputText attribute with javascript jsf2 -


i have input :

    <p:column headertext="quantité">         <h:inputtext styleclass="maqte" id="qte"             onkeyup="validerinput($(this),$(this).parent().prev().find('.monpu'));"             value="#{car.qte}" converter="lenientdoubleconverter" >          </h:inputtext>     </p:column> 

as shown in code above (converter="lenientdoubleconverter") i use converter (to disable implicit conversion of jsf2)

but after when user click on 1 button want enable it, should remove converter javascript before request sent ther server

is there way remove attribute javascript

thank in advance

is there way remove attribute javascript

no. rightclick page , view source in favourite browser. you'll see jsf code produces 1 , html code. jsf component's converter attribute represented in generated html output of <h:inputtext>. more, converter doesn't run in client side @ all. it's merely server-side declaration , converter runs in server side.

your best bet let button add request parameter instructs converter non-lenient. e.g.

<p:commandbutton ...>     <f:param name="disablelenientdoubleconverter" value="true" /> </p:commandbutton> 

with

@override public object getasobject(facescontext context, uicomponent component, string value) {     try {         return super.getasobject(context, component, value);     } catch (converterexception e) {         if ("true".equals(context.getexternalcontext().getrequestparametermap().get("disablelenientdoubleconverter"))) {             throw e;         } else {             return null;         }     } } 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -