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

  • Home
  • SEARCH
  • 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 6236093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:47:22+00:00 2026-05-24T10:47:22+00:00

My IceFaces 1.8 based application starts with a very simple xhtml that includes a

  • 0

My IceFaces 1.8 based application starts with a very simple xhtml that includes a different one based on a bean’s property. This property is bound to a combo’s item that is included in every page. If the user selects a layout from this combo, the page updates to the new layout.

It is all ok, except that after every single page layout change, the items in the layout selector combo get duplicated, triplicated and so on.

This is the “multiplexer” xhtml:

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ice="http://www.icesoft.com/icefaces/component">

    <ui:include src="#{system.layout}">
    </ui:include>

</html>

And this is the layout selector that is included into every layout xhtml:

  <ice:form id="layoutSelectForm">
        <ice:outputLabel for="layoutSelector">#{msgs['LayoutSelect.Label']}: </ice:outputLabel>
        <ice:selectOneMenu id="layoutSelector" binding="#{layoutSelect.som}" value="#{layoutSelect.selectedLayout}" 
            valueChangeListener="#{layoutSelect.processValueChange}" partialSubmit="true">
            <f:selectItems value="#{layoutSelect.allLayouts}" />
        </ice:selectOneMenu >
  </ice:form>

Here is the code of the LayoutSelect backing bean:

public class JSFLayoutSelect implements InitializingBean, ValueChangeListener {
    private EventManager eventManager;
    private String mainApplFrmURL;
    private HtmlSelectOneMenu som;
    public List<SelectItem> allLayouts;
    private String selectedLayout;

        @Override
    public void processValueChange(ValueChangeEvent event)
            throws AbortProcessingException {
        eventManager.publish("layout-select/change", event.getNewValue());
        logger.info("Layout changed event occured: " + event.getNewValue());

        try {
            FacesContext.getCurrentInstance().getExternalContext().redirect(mainApplFrmURL);
        } catch (IOException e) {
            logger.error(e.getMessage());
        }
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        allLayouts = new ArrayList<SelectItem>();
        allLayouts.add(new SelectItem("dev", "Core Dev"));
        allLayouts.add(new SelectItem("classic", "Core Classic"));
        allLayouts.add(new SelectItem("modern", "Core Modern"));
        selectedLayout = "dev";
    }

    public List<SelectItem> getAllLayouts() {
        return allLayouts;
    }

    public String getSelectedLayout() {
        return selectedLayout;
    }

        /* some unimportant methods are not here */
}

  <bean name="layoutSelect" class="hu.hgap.comp.impl.JSFLayoutSelect" scope="session">
    <property name="eventManager" ref="SessionEventManager"/>
     <property name="mainApplFrmURL" value="/ICEFacesSpringDemoV2/secured/ApplFrm.faces" />
  </bean>

Can you tell me what shall I do to avoid duplicating combo entries? I see that after changing the layout the very same combo gets rendered again and the combo items are pushed into it again from the server.

  • 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-24T10:47:23+00:00Added an answer on May 24, 2026 at 10:47 am

    What does your backing bean look like? Which scope does it have?

    I had similar experience with binding variables in a session scope bean. When I moved the variable to a request scopre bean the problem disappeared.

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

Sidebar

Related Questions

Posting this one for a friend. They have an Icefaces app that uses Icefaces's
I have a two simple IceFaces buttons created this way. (I don't use xhtml
I have a complex ICEFaces XHTML page that renders certain components conditionally, based on
This is a question that has been bothering me for sometime. My application uses
I have a JSF/ICEFaces application that was working fine but all of the sudden
I'm using an ICEFaces application that runs over JBOSS, my currently heapsize is set
I have multiple drop down menus with my JSF/ICEFaces application that update each others
i have a strange problem. I have an ICEFaces(1.8.2) + Facelets application im working
I have a IceFaces-form and several input fields. Let's say I have this: <ice:selectOneMenu
Can you separate components of an IceFaces application so they can be tested in

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.