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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:49:28+00:00 2026-06-09T16:49:28+00:00

I am making a Java/HTML program using Seam. I am trying to get an

  • 0

I am making a Java/HTML program using Seam. I am trying to get an <h:selectOneMenu> to show up when a <h:selectBooleanCheckbox> is checked. I got it to do it by using “onclick=”form.submit()” in the checkbox and putting the drop-down in an <s:div rendered>, but whenever the page reloads, the variable that is being used by the dropdown is reset to the top choice. I’m pretty sure it is because of the <s:div>. Does anyone know how I can make it keep the correct choice in the drop-down? Thank you.

Here is the code for the checkbox and the drop-down:

<h:selectBooleanCheckbox id="checkbox" value="#{printLabel.code}" label="barcode" onclick="changeDropdowns()"/>
<br />
<s:div rendered="#{printLabel.code}">
    <h:outputLabel id="locationLabel" value="&#160;&#160;&#160;Location"/>
    <h:selectOneMenu id="locationDrop" value="#{printLabel.codeLoc}">
        <f:selectItems value="#{printLabel.getBarcodeTypes()}" />
    </h:selectOneMenu> 
</s:div>
  • 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-09T16:49:30+00:00Added an answer on June 9, 2026 at 4:49 pm

    if you want todo it with ajax you can do it like this:
    might be some other event then onclick

    <h:selectBooleanCheckbox id="checkbox" value="#{printLabel.code}" label="barcode" >
            <a4j:support event="onclick" reRender="parentdiv" />
    
    </<h:selectBooleanCheckbox>
    <br />
    <s:div id="parentdiv">
    <s:div rendered="#{printLabel.code}">
        <h:outputLabel id="locationLabel" value="&#160;&#160;&#160;Location"/>
        <h:selectOneMenu id="locationDrop" value="#{printLabel.codeLoc}">
            <f:selectItems value="#{printLabel.getBarcodeTypes()}" />
        </h:selectOneMenu> 
    </s:div>
    </s:div>
    

    add tag libary

    xmlns:a4j="http://richfaces.org/a4j"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a Java program that can solve the roots using the quadratic equation
I'm making a Java program that accesses a website, which depends on handing out
Im am making an Java SWT program that is required to run on both
I am making a GUI of Stack using Java. Here is my code private
More specifically making HTML, Java, and python more readable? Does anyone have suggestions for
EDITED: Java httpPost into .asp form I am making an application that will display
i am making a client server program in java, a portion of which requires
So I am making a Text-Based RPG Applet in Java. I am using SWING
I'm making a java application using LWJGL. When exporting the project into jar and
I'm making an app for android, I'm using Google Directions API to get and

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.