You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Igor Marakov <ig...@ivmsystems.com> on 2006/01/13 04:46:09 UTC

MYFACES-27 JSCOOKMENU

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];

 

2.	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


Re: MYFACES-27 JSCOOKMENU

Posted by Bruno Aranda <br...@gmail.com>.
I've reopened the issue and fixed this in the SVN. Now, there is a new
attribute immediate for the jsCookMenu (note that defaults to false to
be consistent with UICommand, maybe some users may have to put
immediate="true" in their menus). I haven't tested this because there
is some problem now with the generation of the examples due to the
maven reorg, but will do as soon as I can. Thanks Igor,

Bruno

2006/1/13, Igor Marakov <ig...@ivmsystems.com>:
>
>
>
>
> 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.
>
>
>
> 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];
>
>
>
> 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