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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:38:39+00:00 2026-05-28T05:38:39+00:00

This is the code: <h:form id=articleForm > <p:commandButton value=Select tags ajax=true > <f:ajax execute=@form

  • 0

This is the code:

<h:form id="articleForm" >
    <p:commandButton value="Select tags" ajax="true" >
        <f:ajax execute="@form" render="@form :articleForm:tags" />
    </p:commandButton>

    <p:pickList id="tags" value="#{articleController.dualListModelForTags}" var="tag" itemLabel="#{tag.tag}" itemValue="#{tag}" converter="distinctTagConverter">
        <f:facet name="sourceCaption">Distinct tags</f:facet>  
        <f:facet name="targetCaption">Connected tags</f:facet>
    </p:pickList>
</h:form>

When the commandbutton is clicked, the getDualListModelForTags() in the backing bean is called and executed. In getDualListModelForTags() I make some modifications so I want the picklist to be updated. But the picklist(id=tags) is not rendered again. Only when I refresh the page, are the modifications made to the picklist.

  • 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-28T05:38:40+00:00Added an answer on May 28, 2026 at 5:38 am

    The PrimeFaces <p:commandButton> component doesn’t work together with <f:ajax>. You need to use the button’s own ajax-targeted attributes instead. Instead of the <f:ajax execute> you should use <p:commandButton process>. But this already defaults to @form, so you can omit it. Instead of the <f:ajax render> you should use <p:commandButton update>. Specifying client IDs which are already covered by @form is unnecessary, so just @form is sufficient. Also the ajax="true" attribute is unnecessary as that’s the default already.

    So just this should do:

    <p:commandButton value="Select tags" update="@form" />
    

    Unrelated to the concrete problem, you’re doing the business job inside a getter method. This is a bad idea. Do it in the button’s action method instead. You also seem to be using a session scoped bean for view scoped data. This is a bad idea. Put the bean in the view scope instead.

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

Sidebar

Related Questions

I am using this code if form.is_valid(): form.save() if request.POST.get('ajax') == 'true': return HttpResponse('Data
I used this code to print the current page: <form> <input type=button value=Print onClick=window.print();
I have this code for Form Submit.. <input type=submit runat=server id=buttonSubmit value=Add style=width:100px; />
When I'll use in the php form this code <option value=foo|bar>foo</option> than how to
I have this ajax jquery code: var form = document.getElementById('frm'); var data_string = form.serialize();
I have this JQuery code: jQuery(#form).click(function() { $(input[name='copyno']:checked).each(function() { checkboxData = copyno=+$(this).val(); id=$(this).val(); jQuery.ajax({
I am using this code in html form <input name=button type=button value=Step 2 onclick=location.href='../ticket/scp/auto.php?dest=../scp/admin.php?t=staff&a=new'/>
I've this code into my form: <li id=form-item_title> <label class=desc>Title</label> <div> <select id=title class=field
I grabbed this code form JCarousel and just trying to understand these lines below.
This code is executed by many way. When it's executed by the form button

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.