0

my left menu page (commonMenu.xhtml) with commandButton:

<body>
<h:form>
    <ui:composition>
        <ul>
            <li><a href="/project/pages/foo.xhtml">foo</a>  </li>
            <li><p:commandButton value="foo"
                    action="pages/foo" /></li>
            <li>Menu 3</li>
        </ul>
    </ui:composition>
</h:form>
 </body>
 </html>

directory tree look like:

webapp
----->pages
---------->foo.xhtml
---------->templates
---------------->commonMenu.xhtml

Problem: href is working perfectly, however commandButton is not working at all. What can be a reason?

i tried diffrent strings in action: foo, project/pages/foo, pages/foo etc...

  • I tested on my project, it worked. I don't know what happened with yours. Context root of your project is 'project' ? is there error when load that page? – Lost Heaven 0809 Mar 20 '14 at 17:05
  • Look at the generated code, seems that the `
    ` is not being rendered, thus the `UICommand` won't work.
    – Luiggi Mendoza Mar 20 '14 at 17:52
  • @LostHeaven0809 there is no error in log, ye root of my project is 'project' –  Mar 20 '14 at 20:25

1 Answers1

0

i read somewhere that for simple navigation i need to use <p:button> not <p:commandButton>

and i used that with short pathes like just foo and it works

so simply i change commandButton part for:

<p:button value="foo" outcome="foo" />

anyway ty