In the last build that I have ( 12/12 ) JSCookmenu fix to allow component to work within form and submit forms is incomplete.

There are still two issues in the code preventing it from operating properly. Below is a description and temporary fixes.

 

  1. Even though code to find enclosing form is in place and does work, _javascript_ component org.apache.myfaces.custom.navmenu.jscookmenu.resources.MyFacesHack.js still refers to and submits dummy form. I guess it was forgotten about…

Code can be fixed by changing the following line in cmItemMouseUp function

var dummyForm = document.forms[‘linkDummyForm’]; with var dummyForm = document.forms[target];

 

  1. There is still hardwired ‘immediate’ attribute in the org.apache.myfaces.custom.navmenu.jscookmenu.HtmlCommandJSCookMenu.java class. Although reasoning for this is still not known ( see myfaces-27 discussion ) I would guess it is a intention of the original design of the component to be pure navigational solution therefore short-circuiting processing cycle. Even though I would favor solution to make ‘immediate’ attribute configurable, for the time being for those who need working component right now ( like me :(  )  the temporary solution is to patch the class overriding isImmediate() and setImmediate() methods as follows:

 

public void setImmediate(boolean flag) { super.setImmediate(false); }

public boolean isImmediate() { return false; }

 

Although I this is not a proper solution these two patches produce jscookmenu component that pretends :) to be working.

 

Maybe issue 27 needs to be reopened to get this fixed for good?

 

Thanks,

Igor

Reply via email to