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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:42:03+00:00 2026-06-06T00:42:03+00:00

I have this menu: <h:selectOneMenu value=#{ApplicationController.settings[‘SessionTTL’]}> <f:selectItem itemValue=60 itemLabel=1 hour /> <f:selectItem itemValue=30 itemLabel=30

  • 0

I have this menu:

<h:selectOneMenu value="#{ApplicationController.settings['SessionTTL']}">
    <f:selectItem itemValue="60" itemLabel="1 hour" />
    <f:selectItem itemValue="30" itemLabel="30 Minutes" />
    <f:selectItem itemValue="20" itemLabel="20 Minutes" />
    <f:selectItem itemValue="10" itemLabel="10 Minutes" />
    <f:selectItem itemValue="custom" itemLabel="Define custom value" />
    <f:ajax render="input" />
</h:selectOneMenu>&nbsp;
<h:panelGroup id="input">
    <h:inputText value="#{ApplicationController.settings['SessionTTL']}" rendered="#{ApplicationController.settings['SessionTTL'] == 'custom'}" required="true" />
</h:panelGroup>     

The problem is that I cannot see the value into the menu label. When I click custom and I update it, I always get 1 hour. If I modify this way the menu:

<h:selectOneMenu value="#{ApplicationController.settings['SessionTTL']}">
    <f:selectItem itemValue="#{ApplicationController.settings['SessionTTL']}" itemLabel="#{ApplicationController.settings['SessionTTL']}" />
    <f:selectItem itemValue="60" itemLabel="1 hour" />
    <f:selectItem itemValue="30" itemLabel="30 Minutes" />
    <f:selectItem itemValue="20" itemLabel="20 Minutes" />
    <f:selectItem itemValue="10" itemLabel="10 Minutes" />
    <f:selectItem itemValue="custom" itemLabel="Define custom value" />
    <f:ajax render="input" />
</h:selectOneMenu>&nbsp;
<h:panelGroup id="input">
    <h:inputText value="#{ApplicationController.settings['SessionTTL']}" rendered="#{ApplicationController.settings['SessionTTL'] == 'custom'}" required="true" />
</h:panelGroup>

I always get the first value into the menu label . Do you know why I cannot display the custom value into the menu label?

PS This is the complete source code:

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"    
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <ui:insert name="header">           
            <ui:include src="header.xhtml"/>         
        </ui:insert>
    </h:head>
    <h:body>
        <h1><img src="resources/css/images/icon.png" alt="DX-57" /> Settings Center</h1>
        <!-- layer for black background of the buttons -->
        <div id="toolbar" style="margin: 0 auto; width:1180px; height:30px; position:relative;  background-color:black">
            <!-- Include page Navigation -->
            <ui:insert name="Navigation">           
                <ui:include src="Navigation.xhtml"/>         
            </ui:insert>
        </div>  
        <div id="logodiv" style="position:relative; top:35px; left:0px;"> 
            <h:graphicImage alt="General Settings"  style="position:relative; top:-20px; left:9px;"  value="resources/images/logo_general_settings.png" />
        </div>
        <div id="main" style="margin: 0 auto; width:1190px; height:700px; position:absolute;  background-color:transparent; top:105px">

            <div id="mainpage" style="margin: 0 auto; width:1190px; height:500px; position:absolute;  background-color:transparent; top:80px">
                <h:form id="settingsupdate">
                    <p:growl id="growl" showDetail="true" sticky="true" />

                    <div id="settingsdivone" style="width:550px; height:400px; position:absolute;  background-color:r; top:20px; left:1px">

                        <h:panelGrid columns="2">
                            <h:panelGroup>Application Timestamp Format</h:panelGroup>
                            <h:panelGroup>
                                <h:selectOneMenu value="#{GeneralController.settings['TimestampFormat']}">
                                    <f:selectItem itemValue="#{GeneralController.settings['TimestampFormat']}" itemLabel="#{GeneralController.settings['TimestampFormat']}" />
                                    <f:selectItem itemValue="yyyy-MM-dd-HH.mm.ss.ffffff" itemLabel="yyyy-MM-dd-HH.mm.ss.ffffff" />
                                    <f:selectItem itemValue="YYYY-MM-DD HH:MM:SS" itemLabel="YYYY-MM-DD HH:MM:SS" />
                                    <f:selectItem itemValue="YYYY-MM-DDThh:mm:ss.sTZD" itemLabel="YYYY-MM-DDThh:mm:ss.sTZD" />
                                    <f:selectItem itemValue="custom" itemLabel="Define custom value" />
                                    <f:ajax render="timestampformat" />
                                </h:selectOneMenu>&nbsp;
                                <h:panelGroup id="timestampformat">
                                    <h:inputText value="#{GeneralController.settings['TimestampFormat']}" rendered="#{GeneralController.settings['TimestampFormat'] == 'custom'}" required="true" />
                                </h:panelGroup>          
                            </h:panelGroup>

                            <h:panelGroup>Performance Tuning</h:panelGroup>
                            <h:panelGroup>
                                <h:selectOneMenu value="#{GeneralController.settings['PerformTunung']}">
                                    <f:selectItem itemValue="#{GeneralController.settings['PerformTunung']}" itemLabel="#{GeneralController.settings['PerformTunung']}" />
                                    <f:selectItem itemValue="10000" itemLabel="Less than 10000 table rows" />
                                    <f:selectItem itemValue="1000000" itemLabel="More than 1000000 table rows" />                                   
                                    <f:selectItem itemValue="custom" itemLabel="Define custom value" />
                                    <f:ajax render="performtuning" />
                                </h:selectOneMenu>&nbsp;
                                <h:panelGroup id="performtuning">
                                    <h:inputText value="#{GeneralController.settings['PerformTunung']}" rendered="#{GeneralController.settings['PerformTunung'] == 'custom'}" required="true" />
                                </h:panelGroup>
                            </h:panelGroup>  

                            <h:panelGroup>Application Initialization State</h:panelGroup>
                            <h:panelGroup>
                                <h:selectOneMenu value="#{GeneralController.settings['InitState']}">
                                    <f:selectItem itemValue="#{GeneralController.settings['InitState']}" itemLabel="#{GeneralController.settings['InitState']}" />
                                    <f:selectItem itemValue="1" itemLabel="Level 1" />
                                    <f:selectItem itemValue="2" itemLabel="Level 2" />
                                    <f:selectItem itemValue="3" itemLabel="Level 3" />
                                    <f:selectItem itemValue="custom" itemLabel="Define custom value" />
                                    <f:ajax render="initstate" />
                                </h:selectOneMenu>&nbsp;
                                <h:panelGroup id="initstate">
                                    <h:inputText value="#{GeneralController.settings['InitState']}" rendered="#{GeneralController.settings['InitState'] == 'custom'}" required="true" />
                                </h:panelGroup>
                            </h:panelGroup>  

                        </h:panelGrid>          

                    </div>   

                    <div id="settingsonedivtwo" style="width:350px; height:400px; position:absolute;  background-color:transparent; top:20px; left:400px">

                    </div>   

                    <div id="settingstwodivthree" style="width:150px; height:60px; position:absolute;  background-color:transparent; top:380px; left:800px">
                        <p:commandButton value="Save Settings" id="ajax" actionListener="#{GeneralController.updateDBSettings}" rendered="true" update="growl,settingsupdate"/>
                    </div> 
                </h:form> 
            </div>  
        </div>
    </h:body>
</html>
  • 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-06T00:42:04+00:00Added an answer on June 6, 2026 at 12:42 am

    Based in your update, you just need to update the inputText using JavaScript, no need to add the rendered attribute, nor an panelGroup wrapping the value.

    <script type="text/javascript">
        function updateInputText(ddlChanged, inputTextId) {
            var realId= "settingsupdate:" + inputTextId;
            document.getElementById("realId").value = 
                ddlChanged.options[ddlChanged.selectedIndex].text;
        }
    </script>
    <h:form id="settingsupdate">
        <!-- another components... -->
        <h:selectOneMenu id="ddlMyOptions" value="#{GeneralController.settings['InitState']}"
            onchange="updateInputText(this, 'txtMyText');">
            <f:selectItem itemValue="1" itemLabel="Level 1" />
            <f:selectItem itemValue="2" itemLabel="Level 2" />
            <f:selectItem itemValue="3" itemLabel="Level 3" />
            <f:selectItem itemValue="custom" itemLabel="Define custom value" />
        </h:selectOneMenu>
        <h:inputText id="txtMyText" />
    </h:form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this typoscript language menu: tmpl.NavLang = HMENU tmpl.NavLang { special=language special.value =
I have this menu structure: http://jsfiddle.net/Rochefort/szL2C/ everything is ok. But i want, hover effect
I have this menu structure that is used to navigate through content slider panels.
I have a simple dropdown menu and I'd like to have this menu close/hide
I have this ul menu: <ul id=superfish-1> <li class=active-trail><a href=# class=sf-depth-1 active>Inicio</a></li> <li class=trail><a
i have this html menu: <ul id='main'> <li class='active current' id='lighty'> <a href='/'>Lighty</a> <ul>
I have this script that run to fix my menu bar to the browser
I have this problem in my SlashDot Menu. I want to change the picture
I have this need to place my app in the share/send context menu so
i have this menu: <div class=nav> <ul> <li><a href=#>HOME</a></li> <li><a href=#>AMORTECIMENTO</a></li> </ul> </div> the

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.