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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:28:33+00:00 2026-06-14T18:28:33+00:00

i have implemented the following picklist: <p:pickList id=pickList value=#{reportConfiguratorBean.dualListVars} var=cRVariable itemValue=#{cRVariable} itemLabel=#{cRVariable.varName} converter=#{cRImageTypeConverter} immediate=true

  • 0

i have implemented the following picklist:

<p:pickList id="pickList" value="#{reportConfiguratorBean.dualListVars}" var="cRVariable" itemValue="#{cRVariable}" itemLabel="#{cRVariable.varName}" converter="#{cRImageTypeConverter}" immediate="true" rendered="true" >
    <f:facet name="sourceCaption">Available Variables</f:facet>
    <f:facet name="targetCaption">Associated Variables</f:facet>                
</p:pickList>                       
<f:facet name="footer"> 
    <p:commandButton id='varassociate' action="#{reportConfiguratorBean.setAssocImTypVariables()}" value='Associate' process="@this,pickList" />
</f:facet>

Picklist is populated correctly (using getAssocImTypVariables() from database). But my ISSUE is that i can not capture the changed picklist values of a user alters the source and target lists. I am trying to capture the changes using a commandButton method “setAssocImTypVariables” as follows:

public void setAssocImTypVariables() {      
    System.out.println(">>>>>>>>>>>>>>> entered");          
    List<CRVariable> sourceVariables = this.dualListVars.getSource();
    List<CRVariable> targetVariables = this.dualListVars.getTarget();       

    System.out.println(dualListVars.getSource());
    System.out.println(dualListVars.getTarget());

    for (CRVariable sourceVariable:sourceVariables) {
        System.out.println(">>>>>>>>>>>>> I am a source variable: " + sourceVariable.getVarName());
    }       
    for (CRVariable targetVariable:targetVariables) {
        System.out.println(">>>>>>>>>>>>> I am a target variable: " + targetVariable.getVarName());
    }       
    }

So if for example i have a picklist with INITIAL source = (Obj1,Obj2,Obj3,Obj5,Obj7) and target = (Obj4,Obj6), i move “Obj1” from source to target BUT in my console i get:

——— entered
[]
[]

So my dualListVars (source and target) is not populated! I have two empty lists for source and target…

So my method CAN NOT perceive picklist’s changes… Any ideas?
I am new to java + primefaces so it could be something really fundamental 🙁

I am also attaching the method getAssocImTypesOnLoad():

public void getAssocImTypesOnLoad() {               
    Long imTypeId = Long.parseLong(virtualId);      
    List<CRVariable> source;
    List<CRVariable> target;        
    Session session = HibernateUtil.getSessionFactory().openSession();
    Transaction tx = null;      
    try 
    {
        tx = session.beginTransaction();            
        String hq3 = "select distinct v from CRVariable v join v.crimagetypes t where t.id in (:itid)";
        Query query3 = session.createQuery(hq3);
        query3.setParameter("itid",imTypeId);
        target = query3.list();
        String hq4 = "select v FROM CRVariable v WHERE v.id not in (" +
                "select distinct v1.id " +
                "from CRVariable v1 " +
                "join v1.crimagetypes t2 " +
                "where t2.id in (:itid))";
        Query query4 = session.createQuery(hq4);
        query4.setParameter("itid",imTypeId);
        source = query4.list();
        dualListVars = new DualListModel<CRVariable>(source, target);
        tx.commit();
    } 
    catch (Exception e) 
    {
        if (tx != null) 
        {
            e.printStackTrace();
        }
    } 
    finally 
    {
       session.close();
    }
}
  • 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-14T18:28:34+00:00Added an answer on June 14, 2026 at 6:28 pm

    Why are you using immediate=true attribute on the commandButton?

    If I remember it correctly, according to an article from balusC
    check it out here an immediate=true on a commandButton should skip the apply model to values phase.

    Maybe that is the reason, why your model is not updated?

    (Just a guess by looking at the code – I have not reproduced this.)

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

Sidebar

Related Questions

I have implemented following async blob upload method to upload multiple blocks. var container
I have implemented following code: $('#select1').change(function() { var options = ''; if($(this).val() == 'a')
Hi I have implemented the following method for searching a value in a csv
I have implemented the following set up (after being requested): slideshow of images changing,
I have implemented clean URLs using the following in my .htaccess RewriteEngine on RewriteCond
I have the following tricky problem: I have implemented a (rather complicated) class which
I've have already implemented pagination using the following code: public Paginacao<Anuncio> consultarPaginado(int pagina, Integer
I have the following problem: I implemented a managed mobile application for Windows Mobile
I have the following Strategy Pattern implemented: public abstract class RetrievalStrategy { public abstract
I have the following problem. I have a tabbed application implemented using a ViewPager.

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.