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 7840459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:47:27+00:00 2026-06-02T15:47:27+00:00

I need to have a jsf h:inputText component appear on a web page based

  • 0

I need to have a jsf h:inputText component appear on a web page based on whether a javascript test condition is true or not. How can I do this?

  • 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-06-02T15:47:29+00:00Added an answer on June 2, 2026 at 3:47 pm

    Just let JSF render it with CSS display property initially set to none and have JavaScript to toggle this to block.

    E.g.

    <h:inputText id="inputId" styleClass="hide" />
    

    with this CSS

    .hide {
        display: none;
    }
    

    and this JS

    if (someCondition) {
        document.getElementById("formId:inputId").style.display = "block";
    }
    

    You’ll only possibly run into problems with regard to input processing and conversion/validation. This input field is always submitted to the server, even when still hidden by CSS. Much better would be to evaluate that condition in JSF instead so that you can use the JSF component’s rendered attribute.

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

Sidebar

Related Questions

I have a jsf 1.2 application where I need to show a page (jsp)
I have a JSF page that has a property datatable a.k.a p:dataTable I need
I'm having an issue with JQuery and JSF/Richfaces. I have an inputText component inside
In my JSF application I have two <h:inputText> components. I need to make sure
I need to have a dynamic URL preferably from a Test Class. Can any
I'm new to JSF, so this question might be strange. I have an inputText
Can I add JSF components dynamically? I need to have a form with a
I have some JSF code that currently works (as shown below), and I need
I need to have this link: http://myserver:/myproject/innerpage/clip.jsf&id=9099 to extract the id from a code
I have JSF + Hibernate app. During runtime, i need to change database, to

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.