You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Neal Haggard (JIRA)" <my...@incubator.apache.org> on 2005/05/13 23:28:05 UTC
[jira] Created: (MYFACES-243) ClientId not used, so JSCookMenu fires multiple actions in tables
ClientId not used, so JSCookMenu fires multiple actions in tables
-----------------------------------------------------------------
Key: MYFACES-243
URL: http://issues.apache.org/jira/browse/MYFACES-243
Project: MyFaces
Type: Bug
Versions: 1.0.9 beta
Reporter: Neal Haggard
Attachments: patch.txt
The fix to add the id to the action (so that the proper action can be fired on decode) works fine for multiple JSCookMenu components on the same page, however when a JSCookMenu is placed in something that uses the component as a template (such as within a HtmlDataTable's Column), the NamingContainer doesn't get invoked, so a click on an action triggers once for every row in the table.
The simple fix is to change the call to getId() to getClientId(context), however, that also requires a change to processDecodes, to change the .indexOf(":") to .lastIndexOf(":").
There are also some other underlying issues with the id in the rest of the component. The Javascript that defines the menu uses a generic variable name of 'menuBar'. If you have more than one JSCookMenu on the page with different CommandNavigationItems, you will only get the last one.
The solution to this is to supplement the JavaScript variable name with the clientId, much like the div later in encodeEnd.
I've tied all these changes together by creating a private method called getMenuId() which encapsulates the logic behind getting the clientId(context) and converting all the colons(:) to underscores(_). Then in encodeChildren(), encodeEnd() and encodeNavigationMenuItems(), I use this method, so that the same id is used throughout.
Also included in my patch is a quick-fix to allow null labels to not print out the default value (1).
Hopefully this will be a useful addition to the MyFaces Community.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
Re: [jira] Commented: (MYFACES-243) ClientId not used, so JSCookMenu
fires multiple actions in tables
Posted by Grant Smith <gr...@marathon-man.com>.
Tested. It works now :) MYFACES-243 can be closed.
Grant Smith wrote:
> I'll test it this afternoon. For some reason svn.apache.org is
> unreachable for me this morning.
>
> sean schofield (JIRA) wrote:
>
>> [
>> http://issues.apache.org/jira/browse/MYFACES-243?page=comments#action_65928
>> ]
>> sean schofield commented on MYFACES-243:
>> ----------------------------------------
>>
>> Patch has been applied. Grant, can you verify problem has been
>> resolved and then close this issue? I wasn't able to see how the
>> original patch failed (only checked the simple examples though.)
>>
>>
>>
>>> ClientId not used, so JSCookMenu fires multiple actions in tables
>>> -----------------------------------------------------------------
>>>
>>> Key: MYFACES-243
>>> URL: http://issues.apache.org/jira/browse/MYFACES-243
>>> Project: MyFaces
>>> Type: Bug
>>> Versions: 1.0.9 beta
>>> Reporter: Neal Haggard
>>> Assignee: sean schofield
>>> Fix For: Nightly Build
>>> Attachments: patch.txt, patch2.txt
>>>
>>> The fix to add the id to the action (so that the proper action can
>>> be fired on decode) works fine for multiple JSCookMenu components on
>>> the same page, however when a JSCookMenu is placed in something that
>>> uses the component as a template (such as within a HtmlDataTable's
>>> Column), the NamingContainer doesn't get invoked, so a click on an
>>> action triggers once for every row in the table.
>>> The simple fix is to change the call to getId() to
>>> getClientId(context), however, that also requires a change to
>>> processDecodes, to change the .indexOf(":") to .lastIndexOf(":").
>>> There are also some other underlying issues with the id in the rest
>>> of the component. The Javascript that defines the menu uses a
>>> generic variable name of 'menuBar'. If you have more than one
>>> JSCookMenu on the page with different CommandNavigationItems, you
>>> will only get the last one.
>>> The solution to this is to supplement the JavaScript variable name
>>> with the clientId, much like the div later in encodeEnd.
>>> I've tied all these changes together by creating a private method
>>> called getMenuId() which encapsulates the logic behind getting the
>>> clientId(context) and converting all the colons(:) to
>>> underscores(_). Then in encodeChildren(), encodeEnd() and
>>> encodeNavigationMenuItems(), I use this method, so that the same id
>>> is used throughout.
>>> Also included in my patch is a quick-fix to allow null labels to not
>>> print out the default value (1).
>>> Hopefully this will be a useful addition to the MyFaces Community.
>>>
>>
>>
>>
>>
>
>
> .
>
Re: [jira] Commented: (MYFACES-243) ClientId not used, so JSCookMenu
fires multiple actions in tables
Posted by Grant Smith <gr...@marathon-man.com>.
I'll test it this afternoon. For some reason svn.apache.org is
unreachable for me this morning.
sean schofield (JIRA) wrote:
> [ http://issues.apache.org/jira/browse/MYFACES-243?page=comments#action_65928 ]
>
>sean schofield commented on MYFACES-243:
>----------------------------------------
>
>Patch has been applied. Grant, can you verify problem has been resolved and then close this issue? I wasn't able to see how the original patch failed (only checked the simple examples though.)
>
>
>
>>ClientId not used, so JSCookMenu fires multiple actions in tables
>>-----------------------------------------------------------------
>>
>> Key: MYFACES-243
>> URL: http://issues.apache.org/jira/browse/MYFACES-243
>> Project: MyFaces
>> Type: Bug
>> Versions: 1.0.9 beta
>> Reporter: Neal Haggard
>> Assignee: sean schofield
>> Fix For: Nightly Build
>> Attachments: patch.txt, patch2.txt
>>
>>The fix to add the id to the action (so that the proper action can be fired on decode) works fine for multiple JSCookMenu components on the same page, however when a JSCookMenu is placed in something that uses the component as a template (such as within a HtmlDataTable's Column), the NamingContainer doesn't get invoked, so a click on an action triggers once for every row in the table.
>>The simple fix is to change the call to getId() to getClientId(context), however, that also requires a change to processDecodes, to change the .indexOf(":") to .lastIndexOf(":").
>>There are also some other underlying issues with the id in the rest of the component. The Javascript that defines the menu uses a generic variable name of 'menuBar'. If you have more than one JSCookMenu on the page with different CommandNavigationItems, you will only get the last one.
>>The solution to this is to supplement the JavaScript variable name with the clientId, much like the div later in encodeEnd.
>>I've tied all these changes together by creating a private method called getMenuId() which encapsulates the logic behind getting the clientId(context) and converting all the colons(:) to underscores(_). Then in encodeChildren(), encodeEnd() and encodeNavigationMenuItems(), I use this method, so that the same id is used throughout.
>>Also included in my patch is a quick-fix to allow null labels to not print out the default value (1).
>>Hopefully this will be a useful addition to the MyFaces Community.
>>
>>
>
>
>
[jira] Commented: (MYFACES-243) ClientId not used, so JSCookMenu fires multiple actions in tables
Posted by "sean schofield (JIRA)" <my...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/MYFACES-243?page=comments#action_65928 ]
sean schofield commented on MYFACES-243:
----------------------------------------
Patch has been applied. Grant, can you verify problem has been resolved and then close this issue? I wasn't able to see how the original patch failed (only checked the simple examples though.)
> ClientId not used, so JSCookMenu fires multiple actions in tables
> -----------------------------------------------------------------
>
> Key: MYFACES-243
> URL: http://issues.apache.org/jira/browse/MYFACES-243
> Project: MyFaces
> Type: Bug
> Versions: 1.0.9 beta
> Reporter: Neal Haggard
> Assignee: sean schofield
> Fix For: Nightly Build
> Attachments: patch.txt, patch2.txt
>
> The fix to add the id to the action (so that the proper action can be fired on decode) works fine for multiple JSCookMenu components on the same page, however when a JSCookMenu is placed in something that uses the component as a template (such as within a HtmlDataTable's Column), the NamingContainer doesn't get invoked, so a click on an action triggers once for every row in the table.
> The simple fix is to change the call to getId() to getClientId(context), however, that also requires a change to processDecodes, to change the .indexOf(":") to .lastIndexOf(":").
> There are also some other underlying issues with the id in the rest of the component. The Javascript that defines the menu uses a generic variable name of 'menuBar'. If you have more than one JSCookMenu on the page with different CommandNavigationItems, you will only get the last one.
> The solution to this is to supplement the JavaScript variable name with the clientId, much like the div later in encodeEnd.
> I've tied all these changes together by creating a private method called getMenuId() which encapsulates the logic behind getting the clientId(context) and converting all the colons(:) to underscores(_). Then in encodeChildren(), encodeEnd() and encodeNavigationMenuItems(), I use this method, so that the same id is used throughout.
> Also included in my patch is a quick-fix to allow null labels to not print out the default value (1).
> Hopefully this will be a useful addition to the MyFaces Community.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (MYFACES-243) ClientId not used, so JSCookMenu fires multiple actions in tables
Posted by "sean schofield (JIRA)" <my...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/MYFACES-243?page=comments#action_65694 ]
sean schofield commented on MYFACES-243:
----------------------------------------
Does this patch completely fix the problem then?
> ClientId not used, so JSCookMenu fires multiple actions in tables
> -----------------------------------------------------------------
>
> Key: MYFACES-243
> URL: http://issues.apache.org/jira/browse/MYFACES-243
> Project: MyFaces
> Type: Bug
> Versions: 1.0.9 beta
> Reporter: Neal Haggard
> Attachments: patch.txt
>
> The fix to add the id to the action (so that the proper action can be fired on decode) works fine for multiple JSCookMenu components on the same page, however when a JSCookMenu is placed in something that uses the component as a template (such as within a HtmlDataTable's Column), the NamingContainer doesn't get invoked, so a click on an action triggers once for every row in the table.
> The simple fix is to change the call to getId() to getClientId(context), however, that also requires a change to processDecodes, to change the .indexOf(":") to .lastIndexOf(":").
> There are also some other underlying issues with the id in the rest of the component. The Javascript that defines the menu uses a generic variable name of 'menuBar'. If you have more than one JSCookMenu on the page with different CommandNavigationItems, you will only get the last one.
> The solution to this is to supplement the JavaScript variable name with the clientId, much like the div later in encodeEnd.
> I've tied all these changes together by creating a private method called getMenuId() which encapsulates the logic behind getting the clientId(context) and converting all the colons(:) to underscores(_). Then in encodeChildren(), encodeEnd() and encodeNavigationMenuItems(), I use this method, so that the same id is used throughout.
> Also included in my patch is a quick-fix to allow null labels to not print out the default value (1).
> Hopefully this will be a useful addition to the MyFaces Community.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (MYFACES-243) ClientId not used, so JSCookMenu fires multiple actions in tables
Posted by "Neal Haggard (JIRA)" <my...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/MYFACES-243?page=comments#action_65709 ]
Neal Haggard commented on MYFACES-243:
--------------------------------------
Yes, the patch solves the problem.
> ClientId not used, so JSCookMenu fires multiple actions in tables
> -----------------------------------------------------------------
>
> Key: MYFACES-243
> URL: http://issues.apache.org/jira/browse/MYFACES-243
> Project: MyFaces
> Type: Bug
> Versions: 1.0.9 beta
> Reporter: Neal Haggard
> Assignee: sean schofield
> Attachments: patch.txt
>
> The fix to add the id to the action (so that the proper action can be fired on decode) works fine for multiple JSCookMenu components on the same page, however when a JSCookMenu is placed in something that uses the component as a template (such as within a HtmlDataTable's Column), the NamingContainer doesn't get invoked, so a click on an action triggers once for every row in the table.
> The simple fix is to change the call to getId() to getClientId(context), however, that also requires a change to processDecodes, to change the .indexOf(":") to .lastIndexOf(":").
> There are also some other underlying issues with the id in the rest of the component. The Javascript that defines the menu uses a generic variable name of 'menuBar'. If you have more than one JSCookMenu on the page with different CommandNavigationItems, you will only get the last one.
> The solution to this is to supplement the JavaScript variable name with the clientId, much like the div later in encodeEnd.
> I've tied all these changes together by creating a private method called getMenuId() which encapsulates the logic behind getting the clientId(context) and converting all the colons(:) to underscores(_). Then in encodeChildren(), encodeEnd() and encodeNavigationMenuItems(), I use this method, so that the same id is used throughout.
> Also included in my patch is a quick-fix to allow null labels to not print out the default value (1).
> Hopefully this will be a useful addition to the MyFaces Community.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Updated: (MYFACES-243) ClientId not used, so JSCookMenu fires multiple actions in tables
Posted by "Neal Haggard (JIRA)" <my...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/MYFACES-243?page=all ]
Neal Haggard updated MYFACES-243:
---------------------------------
Attachment: patch2.txt
2nd patch changes one line in the decode method. We were comparing the clientId from the action against the id of the component. Changed the call from component.getId() to getMenuId( context, component );
> ClientId not used, so JSCookMenu fires multiple actions in tables
> -----------------------------------------------------------------
>
> Key: MYFACES-243
> URL: http://issues.apache.org/jira/browse/MYFACES-243
> Project: MyFaces
> Type: Bug
> Versions: 1.0.9 beta
> Reporter: Neal Haggard
> Assignee: sean schofield
> Fix For: Nightly Build
> Attachments: patch.txt, patch2.txt
>
> The fix to add the id to the action (so that the proper action can be fired on decode) works fine for multiple JSCookMenu components on the same page, however when a JSCookMenu is placed in something that uses the component as a template (such as within a HtmlDataTable's Column), the NamingContainer doesn't get invoked, so a click on an action triggers once for every row in the table.
> The simple fix is to change the call to getId() to getClientId(context), however, that also requires a change to processDecodes, to change the .indexOf(":") to .lastIndexOf(":").
> There are also some other underlying issues with the id in the rest of the component. The Javascript that defines the menu uses a generic variable name of 'menuBar'. If you have more than one JSCookMenu on the page with different CommandNavigationItems, you will only get the last one.
> The solution to this is to supplement the JavaScript variable name with the clientId, much like the div later in encodeEnd.
> I've tied all these changes together by creating a private method called getMenuId() which encapsulates the logic behind getting the clientId(context) and converting all the colons(:) to underscores(_). Then in encodeChildren(), encodeEnd() and encodeNavigationMenuItems(), I use this method, so that the same id is used throughout.
> Also included in my patch is a quick-fix to allow null labels to not print out the default value (1).
> Hopefully this will be a useful addition to the MyFaces Community.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Closed: (MYFACES-243) ClientId not used, so JSCookMenu fires multiple actions in tables
Posted by "sean schofield (JIRA)" <my...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/MYFACES-243?page=all ]
sean schofield closed MYFACES-243:
----------------------------------
Resolution: Fixed
Fix Version: Nightly Build
> ClientId not used, so JSCookMenu fires multiple actions in tables
> -----------------------------------------------------------------
>
> Key: MYFACES-243
> URL: http://issues.apache.org/jira/browse/MYFACES-243
> Project: MyFaces
> Type: Bug
> Versions: 1.0.9 beta
> Reporter: Neal Haggard
> Assignee: sean schofield
> Fix For: Nightly Build
> Attachments: patch.txt
>
> The fix to add the id to the action (so that the proper action can be fired on decode) works fine for multiple JSCookMenu components on the same page, however when a JSCookMenu is placed in something that uses the component as a template (such as within a HtmlDataTable's Column), the NamingContainer doesn't get invoked, so a click on an action triggers once for every row in the table.
> The simple fix is to change the call to getId() to getClientId(context), however, that also requires a change to processDecodes, to change the .indexOf(":") to .lastIndexOf(":").
> There are also some other underlying issues with the id in the rest of the component. The Javascript that defines the menu uses a generic variable name of 'menuBar'. If you have more than one JSCookMenu on the page with different CommandNavigationItems, you will only get the last one.
> The solution to this is to supplement the JavaScript variable name with the clientId, much like the div later in encodeEnd.
> I've tied all these changes together by creating a private method called getMenuId() which encapsulates the logic behind getting the clientId(context) and converting all the colons(:) to underscores(_). Then in encodeChildren(), encodeEnd() and encodeNavigationMenuItems(), I use this method, so that the same id is used throughout.
> Also included in my patch is a quick-fix to allow null labels to not print out the default value (1).
> Hopefully this will be a useful addition to the MyFaces Community.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Updated: (MYFACES-243) ClientId not used, so JSCookMenu fires multiple actions in tables
Posted by "Neal Haggard (JIRA)" <my...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/MYFACES-243?page=all ]
Neal Haggard updated MYFACES-243:
---------------------------------
Attachment: patch.txt
Here's my patch for HtmlJSCookMenuRenderer.java
> ClientId not used, so JSCookMenu fires multiple actions in tables
> -----------------------------------------------------------------
>
> Key: MYFACES-243
> URL: http://issues.apache.org/jira/browse/MYFACES-243
> Project: MyFaces
> Type: Bug
> Versions: 1.0.9 beta
> Reporter: Neal Haggard
> Attachments: patch.txt
>
> The fix to add the id to the action (so that the proper action can be fired on decode) works fine for multiple JSCookMenu components on the same page, however when a JSCookMenu is placed in something that uses the component as a template (such as within a HtmlDataTable's Column), the NamingContainer doesn't get invoked, so a click on an action triggers once for every row in the table.
> The simple fix is to change the call to getId() to getClientId(context), however, that also requires a change to processDecodes, to change the .indexOf(":") to .lastIndexOf(":").
> There are also some other underlying issues with the id in the rest of the component. The Javascript that defines the menu uses a generic variable name of 'menuBar'. If you have more than one JSCookMenu on the page with different CommandNavigationItems, you will only get the last one.
> The solution to this is to supplement the JavaScript variable name with the clientId, much like the div later in encodeEnd.
> I've tied all these changes together by creating a private method called getMenuId() which encapsulates the logic behind getting the clientId(context) and converting all the colons(:) to underscores(_). Then in encodeChildren(), encodeEnd() and encodeNavigationMenuItems(), I use this method, so that the same id is used throughout.
> Also included in my patch is a quick-fix to allow null labels to not print out the default value (1).
> Hopefully this will be a useful addition to the MyFaces Community.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Closed: (MYFACES-243) ClientId not used, so JSCookMenu fires multiple actions in tables
Posted by "Grant Smith (JIRA)" <my...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/MYFACES-243?page=all ]
Grant Smith closed MYFACES-243:
-------------------------------
Resolution: Fixed
Final patch fixed navigation problem
> ClientId not used, so JSCookMenu fires multiple actions in tables
> -----------------------------------------------------------------
>
> Key: MYFACES-243
> URL: http://issues.apache.org/jira/browse/MYFACES-243
> Project: MyFaces
> Type: Bug
> Versions: 1.0.9 beta
> Reporter: Neal Haggard
> Assignee: sean schofield
> Fix For: Nightly Build
> Attachments: patch.txt, patch2.txt
>
> The fix to add the id to the action (so that the proper action can be fired on decode) works fine for multiple JSCookMenu components on the same page, however when a JSCookMenu is placed in something that uses the component as a template (such as within a HtmlDataTable's Column), the NamingContainer doesn't get invoked, so a click on an action triggers once for every row in the table.
> The simple fix is to change the call to getId() to getClientId(context), however, that also requires a change to processDecodes, to change the .indexOf(":") to .lastIndexOf(":").
> There are also some other underlying issues with the id in the rest of the component. The Javascript that defines the menu uses a generic variable name of 'menuBar'. If you have more than one JSCookMenu on the page with different CommandNavigationItems, you will only get the last one.
> The solution to this is to supplement the JavaScript variable name with the clientId, much like the div later in encodeEnd.
> I've tied all these changes together by creating a private method called getMenuId() which encapsulates the logic behind getting the clientId(context) and converting all the colons(:) to underscores(_). Then in encodeChildren(), encodeEnd() and encodeNavigationMenuItems(), I use this method, so that the same id is used throughout.
> Also included in my patch is a quick-fix to allow null labels to not print out the default value (1).
> Hopefully this will be a useful addition to the MyFaces Community.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Reopened: (MYFACES-243) ClientId not used, so JSCookMenu fires multiple actions in tables
Posted by "Grant Smith (JIRA)" <my...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/MYFACES-243?page=all ]
Grant Smith reopened MYFACES-243:
---------------------------------
This patch breaks JSCookMenu navigation completely. I had to reverse it to get the faces-examples to work properly again. Unfortunately I don't have the time to look at this right now, but perhaps Neal can look at the nightly code and see if the patch was perhaps faulty.
> ClientId not used, so JSCookMenu fires multiple actions in tables
> -----------------------------------------------------------------
>
> Key: MYFACES-243
> URL: http://issues.apache.org/jira/browse/MYFACES-243
> Project: MyFaces
> Type: Bug
> Versions: 1.0.9 beta
> Reporter: Neal Haggard
> Assignee: sean schofield
> Fix For: Nightly Build
> Attachments: patch.txt
>
> The fix to add the id to the action (so that the proper action can be fired on decode) works fine for multiple JSCookMenu components on the same page, however when a JSCookMenu is placed in something that uses the component as a template (such as within a HtmlDataTable's Column), the NamingContainer doesn't get invoked, so a click on an action triggers once for every row in the table.
> The simple fix is to change the call to getId() to getClientId(context), however, that also requires a change to processDecodes, to change the .indexOf(":") to .lastIndexOf(":").
> There are also some other underlying issues with the id in the rest of the component. The Javascript that defines the menu uses a generic variable name of 'menuBar'. If you have more than one JSCookMenu on the page with different CommandNavigationItems, you will only get the last one.
> The solution to this is to supplement the JavaScript variable name with the clientId, much like the div later in encodeEnd.
> I've tied all these changes together by creating a private method called getMenuId() which encapsulates the logic behind getting the clientId(context) and converting all the colons(:) to underscores(_). Then in encodeChildren(), encodeEnd() and encodeNavigationMenuItems(), I use this method, so that the same id is used throughout.
> Also included in my patch is a quick-fix to allow null labels to not print out the default value (1).
> Hopefully this will be a useful addition to the MyFaces Community.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira