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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:12:38+00:00 2026-05-30T01:12:38+00:00

Richfaces 3.3.3, Jsf 1.2: I have a a4j:form that uses some simple validation, mainly

  • 0

Richfaces 3.3.3, Jsf 1.2:

I have a a4j:form that uses some simple validation, mainly required="true" to ensure the form does not get submitted without some necessary data.

I also have some complex data to add (optionally) to the form, so I thought the best way to do this is to have a a4j:commandButton that displays a rich:modalPanel where the user can create the complex data set.

The created data is also displayed in a h:selectManyListbox that is reRendered when the modalPanel is closed.

That’s the plan, at least. I have the following problems:

  • reRender works, but only if I prevent validation via immediate="true" – which in turn seems to prevent the selected data from the modalPanel to be present in the backing Bean
  • if I remove the immediate tag, the data gets updated, but only if there are no validation errors

What is the best way to get this to work the way I want? Is there another, better way?

UPDATE:

The Validation that fails is in some different part of the form, not in the data entered via the modalPanel, which is displayed in the Listbox

CODE:

modalPanel:

<rich:modalPanel id="addTrimming" domElementAttachment="parent" width="150" height="130">
    <f:facet name="header">
        <h:panelGroup>
            <h:outputText value="Define Filter" />
        </h:panelGroup>
    </f:facet>
    <f:facet name="controls">
        <h:panelGroup>
            <h:graphicImage value="/images/close.gif" styleClass="hidelink" id="hidelinkAddTrimming"/>
            <rich:componentControl for="addTrimming" attachTo="hidelinkAddTrimming" operation="hide" event="onclick"/>
        </h:panelGroup>
    </f:facet>

    <h:panelGrid id="trimsettings" columns="3">
        <h:outputText value="Target:" style="font-weight:bold"/>
        <h:inputText id="target" label="XML Filename" required="true" value="#{xmlCreator.trimTarget}">
        </h:inputText>
        <h:outputText value=""/>

        <h:outputText value="Mode:"/>
        <h:selectOneMenu value="#{xmlCreator.trimMode}">
            <f:selectItem itemLabel="Quality" itemValue="quality"/> 
            <f:selectItem itemLabel="after Primer" itemValue="afterPrimer"/> 
            <f:selectItem itemLabel="fixed" itemValue="fixed"/>
            <f:selectItem itemLabel="Median length" itemValue="median"/>
            <f:selectItem itemLabel="Motif" itemValue="motif"/>
        </h:selectOneMenu>
        <h:outputText value=""/>

    </h:panelGrid>

    <h:panelGroup>
        <a4j:commandButton value="OK" action="#{xmlCreator.createTrimming}" onclick="from:submit()">
            <a4j:support event="oncomplete" ajaxSingle="true" immediate="true" reRender="trimsPanel"/>
        </a4j:commandButton>
    </h:panelGroup>
</rich:modalPanel>

relevant form part:

<h:outputText value="Trimming:"/>
<a4j:outputPanel id="trimsPanel">
    <h:selectManyListbox id="trims" value="#{xmlCreator.selectedTrimmings}">
        <f:selectItems value="#{si:toSelectTrimmingList(xmlCreator.trimmings)}"/>
    </h:selectManyListbox>
</a4j:outputPanel>
<a4j:commandButton id="addTrimButton" immediate="true" value=" + Trimming">
    <rich:componentControl for="addTrimming" attachTo="addTrimButton" operation="show" event="onclick"/>
</a4j:commandButton>
  • 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-30T01:12:40+00:00Added an answer on May 30, 2026 at 1:12 am

    If you do it in one form than you should separate it into two: one will be your main form and another will be form inside modal panel. Thus you’ll be able to submit modal panel independently of main form and your submit button in modal panel will look like this:

    <a4j:commandButton value="OK" action="#{xmlCreator.createTrimming}" reRender="trimsPanel"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a JSF application that uses mostly Richfaces. I would like to introduce
I have a JSF page that displays a RichFaces Treeview, from a TreeNodeImpl model
I have a JSF 1.2 application (Sun RI, Facelets, Richfaces) that was used only
I have some javascript that i'm trying to use in a jsf app. I've
I have a JSF 2 application which uses a Richfaces 4 tree control. The
I have a JSF/RichFaces setup with an index.jsp which a4j:include s another piece of
I have a JSP page in a JSF application which uses A4J. I want
I'm using JSF 1.2 with Richfaces and Facelets. I have an application with many
Using Richfaces 3.3.0GA, jsf 1.2_14 and facelets. I have a richfaces ModalPanel with an
I'm using JSF (Mojarra 1.2) with Richfaces (3.3.2) within some facelets which are used

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.