Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3801412
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:02:46+00:00 2026-05-19T14:02:46+00:00

I’m developing this project using JSF 2.0, NetBeans 6.9.1, GlassFish 3.1, Mojarra 2.0.3, and

  • 0

I’m developing this project using JSF 2.0, NetBeans 6.9.1, GlassFish 3.1, Mojarra 2.0.3, and PrimeFaces 2.2-RC2.

My question is similar to this question, but even though I was able to make one of my buttons work, the other one does not. Here’s my situation: I have a dataTable with a column containing two links, one to edit line data, one to view line data. Clicking either the “Edit” or “View” link takes you to a detail page with <h:panelGrid> components inside <p:tabView> components. My detail page has two <p:tabView> components, one for editing, one for just viewing data. Which one you see depends on the <c:if> statements. The button in the first <p:tabView> on the page (by that I mean first working your way down from the top) works as I would like it to, this happens to be the “Edit” component. The button in the other <p:tabView> does not work. I set up break points and went through the debugger, the second button doesn’t seem to fire an ActionEvent regardless of what I try. Here’s my code for the page:

            <ui:define name="metadata">
                <f:metadata>
                    <f:viewParam name="id" value="#{userDetailBean.selectedUserId}" />
                    <f:viewParam name="action" value="#{userDetailBean.view}" />
                </f:metadata>


            </ui:define>


            <ui:define name="main_base_content_top">
                <h:form>
                    <p:toolbar>
                        <p:toolbarGroup align="left">
                            <h:commandButton value="Return to User List" action="user_grid" />
                        </p:toolbarGroup>
                    </p:toolbar>
                </h:form>
            </ui:define>

            <ui:define name="main_base_content">

                    <c:if test="#{empty userDetailBean.view}">
                        <h:form>
                        <table align="center">
                            <tr>
                                <td>
                                    <p:tabView>
                                        <p:tab title="#{msgs.UserDetailTabTitle}">
                                            <h:panelGrid columns="4">
                                                <h:outputLabel value="#{msgs.UserDetailFirstName}" for="fname" />
                                                <h:inputText id="fname" value="#{userDetailBean.firstName}" />
                                                <h:outputLabel value="#{msgs.UserDetailJobTitle}" for="jtitle" />
                                                <h:inputText id="jtitle" value="#{userDetailBean.jobTitle}" />
                                                <h:outputLabel value="#{msgs.UserDetailLastName}" for="lname" />
                                                <h:inputText id="lname" value="#{userDetailBean.lastName}" />
                                                <h:outputLabel value="#{msgs.UserDetailEmployeeId}" for="empid" />
                                                <h:inputText id="empid" value="#{userDetailBean.id}" />
                                                <h:outputLabel value="#{msgs.UserDetailDateOfHire}" for="doh" />
                                                <h:inputText id="doh" value="#{userDetailBean.DOH}" />
                                                <h:outputLabel value="#{msgs.UserDetailLocation}" for="location" />
                                                <h:inputText id="location" value="#{userDetailBean.location}" />
                                                <h:outputLabel value="#{msgs.UserDetailStatus}" for="status" />
                                                <h:inputText id="status" value="#{userDetailBean.status}" />
                                                <h:inputHidden /> <h:inputHidden /> <h:inputHidden /> <h:inputHidden /> <h:inputHidden />
                                                &nbsp;
                                                <h:outputLabel value="#{msgs.UserDetailComments}" for="comments" />
                                                <h:inputTextarea id="comments" value="#{userDetailBean.comments}" />
                                                <h:inputHidden />
                                                <p:commandButton ajax="false" action="#{userDetailBean.submitChanges()}" value="Submit Changes" />
                                            </h:panelGrid>
                                        </p:tab>
                                    </p:tabView>
                                </td>
                            </tr>

                        </table>
                        </h:form>
                    </c:if>
                    <c:if test="#{! empty userDetailBean.view}">
                        <h:form>
                        <table align="center">
                            <tr>
                                <td>
                                    <p:tabView>
                                        <p:tab title="#{msgs.UserDetailViewTabTitle}">
                                            <h:panelGrid columns="4">
                                                <h:outputLabel value="#{msgs.UserDetailFirstName}" for="fname" />
                                                <h:outputText id="fname" value="#{userGridBean.selectedUser.firstName}" />
                                                <h:outputLabel value="#{msgs.UserDetailJobTitle}" for="jtitle" />
                                                <h:outputText id="jtitle" value="#{userGridBean.selectedUser.jobTitle}" />
                                                <h:outputLabel value="#{msgs.UserDetailLastName}" for="lname" />
                                                <h:outputText id="lname" value="#{userGridBean.selectedUser.lastName}" />
                                                <h:outputLabel value="#{msgs.UserDetailEmployeeId}" for="empid" />
                                                <h:outputText id="empid" value="#{userGridBean.selectedUser.id}" />
                                                <h:outputLabel value="#{msgs.UserDetailDateOfHire}" for="doh" />
                                                <h:outputText id="doh" value="#{userGridBean.selectedUser.DOH}" />
                                                <h:outputLabel value="#{msgs.UserDetailLocation}" for="location" />
                                                <h:outputText id="location" value="#{userGridBean.selectedUser.location}" />
                                                <h:outputLabel value="#{msgs.UserDetailStatus}" for="status" />
                                                <h:outputText id="status" value="#{userGridBean.selectedUser.status}" />
                                                <h:inputHidden /> <h:inputHidden /> <h:inputHidden /> <h:inputHidden /> <h:inputHidden />
                                                &nbsp;
                                                <h:outputLabel value="#{msgs.UserDetailComments}" for="comments" />
                                                <h:outputText id="comments" value="#{userGridBean.selectedUser.comments}" />
                                                <h:inputHidden /> <h:inputHidden /> <h:inputHidden />
                                                <p:commandButton onclick="submit()" ajax="false" action="#{userDetailBean.navigation()}" value="Retur to User Grid" />
                                            </h:panelGrid>
                                        </p:tab>
                                    </p:tabView>
                                </td>
                            </tr>
                        </table>
                        </h:form>
                    </c:if>                 

            </ui:define>
        </ui:composition>        
    </body>

I’ve tried everything I can think of for the second button: ajax=”false”; onclick=”submit()”; ajax=”false” onclick=”submit”; I’ve tried implicit navigation with a redirect as well as a navigation rule with a redirect. The action methods userDetailBean.submitChanges() and userDetailBean.navigate() both return the same string, which corresponds to a navigation rule in my faces-config file. The submitChanges method gets called, but my navigate method does not. I’m not filling the fields with any data at this point, I’m just trying to get the basic navigation to work. Why isn’t my commandButton on the second tabView working?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T14:02:47+00:00Added an answer on May 19, 2026 at 2:02 pm

    Another reason that a commandbutton isn’t been invoked is that the rendered attribute of the button or one of its parents evaluated false during apply request values phase of the form submit.

    You have actually none, but those <c:if> tags does similar thing, only during view build time instead of view render time. The view params are not applied during building the view, but only thereafter. That’s exactly why #{userDetailBean.view} is always empty.

    I have never used such a construct with <c:if>, but I’ve had similar views like this where this all just works with a @ViewScoped bean where the rendering property is been applied on a fullworthy JSF component instead of <c:if>.

    As first step, get rid of <c:if>s and move their tests into rendered attribute of the <h:form>s they are wrapping:

    <h:form rendered="#{empty userDetailBean.view}">
        ...
    </h:form>
    <h:form rendered="#{not empty userDetailBean.view}">
        ...
    </h:form>
    

    If in vain (I guess that this will fail because you aren’t using ajax and the viewparams are not preserved) and the bean is indeed @RequestScoped, then you need to mark it @ViewScoped to preserve the rendering conditions.

    Related questions:

    • JSF h:commandLink is not being invoked

    Unrelated to the problem, I’d rather use <h:panelGroup /> instead of <h:inputHidden /> to "fill" the empty cells of the table. They are cheaper to encode and decode and also ends in better HTML.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.