Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MenuItem: support passthrough attributes #7970

Closed
torstenwerner opened this issue Oct 15, 2021 · 4 comments · Fixed by #9713
Closed

MenuItem: support passthrough attributes #7970

torstenwerner opened this issue Oct 15, 2021 · 4 comments · Fixed by #9713
Assignees
Labels
enhancement Additional functionality to current component
Milestone

Comments

@torstenwerner
Copy link

Describe the defect

Sample xhtml code with xmlns:pt="http://xmlns.jcp.org/jsf/passthrough":

<p:menuitem value="Neuer Ordner" update="folderTree" action="#{folderTreeView.addNewNode}"
    oncomplete="openInplace(args)" icon="fa fa-plus"
    onkeydown="test()" pt:onkeydown="test2()" pt:data-test3="test4"/>

The rendered DOM has neither a onkeydown event handler defined nor a custom attribute data-test3.

<li class="ui-menuitem ui-widget ui-corner-all" role="none"><a tabindex="-1" role="menuitem"
                                                           class="ui-menuitem-link ui-corner-all" href="#"
                                                           onclick="PrimeFaces.ab({s:&quot;folder-tree:treeform:j_idt17&quot;,f:&quot;folder-tree:treeform&quot;,u:&quot;folder-tree:treeform:folderTree&quot;,onco:function(xhr,status,args,data){openInplace(args);}});return false;"><span
    class="ui-menuitem-icon ui-icon fa fa-plus" aria-hidden="true"></span><span class="ui-menuitem-text">Neuer Ordner</span></a>
</li>

Reproducer

Add the menuitem sample to any application and check the rendered DOM.

Environment:

  • PF Version: 10.0.0
  • JSF + version: Mojarra 2.3.16
  • Affected browsers: ALL

To Reproduce
Steps to reproduce the behavior:

  1. Add the menuitem sample to any application.
  2. Check the rendered DOM.

Expected behavior
I expected to be able to define custom event handlers and custom attributes as it is possible for other components.

@torstenwerner torstenwerner added the 🐞 defect Bug...Something isn't working label Oct 15, 2021
@tandraschko tandraschko changed the title menuitem: does not support passthrough attributes MenuItem: support passthrough attributes Oct 15, 2021
@tandraschko tandraschko added new feature and removed 🐞 defect Bug...Something isn't working labels Oct 15, 2021
@tandraschko
Copy link
Member

new feature as not implemented before

@tandraschko
Copy link
Member

a PR would be great!

@melloware
Copy link
Member

MenuIten is a UICommand and not a UIComponent so I don't think this feature can be implemented. I am not sure it's even worth trying to change MenuIten for this. Going to close for now.

@melloware melloware added Resolution: Wontfix Issue will not be fixed due to technical limitations and removed new feature labels Jan 19, 2023
@melloware melloware closed this as not planned Won't fix, can't repro, duplicate, stale Jan 19, 2023
@melloware melloware reopened this Jan 20, 2023
@melloware melloware added enhancement Additional functionality to current component and removed Resolution: Wontfix Issue will not be fixed due to technical limitations labels Jan 20, 2023
@melloware melloware self-assigned this Jan 20, 2023
@melloware melloware added this to the 13.0.0 milestone Jan 20, 2023
@melloware
Copy link
Member

Sorry thanks to @Rapster i realized this can be done and quite easily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Additional functionality to current component
Projects
None yet
3 participants