h:commandLink problem

i have to files, header.jsp and menu.jsp

--header.jsp--

<f:subview id="header">

<h:form id="headerForm">

<h:commandButton value="commandButton2"

image="/images/logo.gif" action="home""/>

<h:commandButton value="commandButton1"

image="/images/button.gif" action="download"/>

</h:form>

<h:form>

<h:panelGroup rendered="#{user.logged == 'false'}" id="loginPanel">

<h:outputLabel for="loginField" value="Login: "/>

<h:inputText id="loginField" value="#{user.login}"/>

<h:outputLabel for="passwordField" value="Password: "/>

<h:inputSecret id="passwordField" value="#{user.password}"/>

<h:commandLink id="enterLink" action="#{user.login}" >

<h:outputText value="#{bundle.Enter}" />

</h:commandLink>

</h:panelGroup>

<h:panelGroup rendered="#{user.logged}">

<h:outputText value="User: "/>

<h:outputText value="#{user.user.name}" styleClass="bigBold"/>

</h:panelGroup>

</h:form>

</f:subview>

--menu.jsp--

<f:subview id="menu">

<h:form id="menuForm">

<h:panelGrid columns="1" styleClass="menu">

<h:commandLink id="newsList" action="newsList">

<h:outputText value="News"/>

</h:commandLink>

<h:commandLink id="projects" action="projects">

<h:outputText value="Projects"/>

</h:commandLink>

<h:commandLink id="services" action="services">

<h:outputText value="Services"/>

</h:commandLink>

<h:commandLink id="download" action="download">

<h:outputText value="Downloads"/>

</h:commandLink>

<h:commandLink id="library" action="library">

<h:outputText value="Library"/>

</h:commandLink>

<h:commandLink id="feedback" action="feedback">

<h:outputText value="Feedback"/>

</h:commandLink>

</h:panelGrid>

</h:form>

</f:subview>

Problem description: when in header.jsp for input of user's login and password I use <h:commandLink>, link in menu.jsp don't work. And when I just change <h:commandLink> to <h:commandButton> - links in menu works. But for design purposes it's better to use <h:commandLink>. What can help me?

[3706 byte] By [makadosa] at [2007-11-27 8:40:42]
# 1
There is no diffrence b/w commandLink and commandButton. both action and actionListener attributes are same. Try to put immediate="true" and even if it does not work then put h:messages for the formand check if there are any validation errors etc.,
veerjaa at 2007-7-12 20:39:16 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

immediate="true" doesn't help. And h:messages doesn't show errors.

Mozilla shows this: document.forms['menu:menuForm']['menu:menuForm:_idcl'] has no properties

When i use commandLink, generated end of menu form is like this:

<input type="hidden" name="menu:menuForm" value="menu:menuForm" /></form>

. This varian doesn't works

And with commandButton, menu ends by next code:

<input type="hidden" name="menu:menuForm" value="menu:menuForm" /><input type="hidden" name="menu:menuForm:_idcl" /></form>

As I can see, with h:commandLink <input type="hidden" name="menu:menuForm:_idcl" /> doesn't generated. Any guess?

makadosa at 2007-7-12 20:39:16 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
changing <h:commandLink> to <t:commandLink> helps.
makadosa at 2007-7-12 20:39:16 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...