voyent
[Solved]Partial Submit loosing registered javascript events  XML
Forum Index -> General Help
Author Message
venu_dvmr

Joined: 30/Sep/2008 00:00:00
Messages: 58
Offline


Onload of the page I am registering events on some input elements in a form to use mask for currency.
It works fine if there is no partial submits in the form. How do I re-register events after partial submits?

I tried to use JavascriptContext.addJavascriptCall(); it did not work.
Code:
 <script type="text/javascript">
 Event.observe(window, 'load', function(){
   registerInputMask();
 });
 
 function registerInputMask(){
   var numberParser = new NumberParser(2, ".", ",", true);
   var numMask = new NumberMask(numberParser, "form0:_id62:0:create_req:_id193", 3, false, null, null, null, null, null, true);
 }
 </script>
 
 
 public void stateChanged(ValueChangeEvent event) {
   JavascriptContext.addJavascriptCall(FacesContext.getCurrentInstance(), "registerInputMask();");
 }
 


Any Ideas? Help ??

venu_dvmr

Joined: 30/Sep/2008 00:00:00
Messages: 58
Offline


JavaScript AOP works like a charm with iceSubmitPartial function. Below is what I have done.

1. Download the js file from http://___.constantology.com/observe_method/
2. Include the JS files in Backing Bean using JavascriptContext.includeLib()
Code:
 JavascriptContext.includeLib("js/observemethod.js", FacesContext.getCurrentInstance());
 

3. Register Event.observeMethod() in jspx page as below
Code:
  Event.observeMethod( window, 'iceSubmitPartial', test, Event.AFTER ); 
 


Now javascript function test is called after every iceSubmitPartial function.

Thanks

 
Forum Index -> General Help
Go to:   
Powered by JForum 2.1.7ice © JForum Team