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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:34:46+00:00 2026-06-17T08:34:46+00:00

I am using schedule component of Primefaces. I am filling it with values from

  • 0

I am using schedule component of Primefaces. I am filling it with values from database and when the user selects sth from the selectonemenu an ajax event is triggered (I tried to put just the related code, if there is sth missing pls remind me):

xhtml:

 <h:outputText value="Scope :" />
 <h:selectOneMenu id="scope" value="#{scheduleView.scope}">                    
   <f:selectItems value="#{lookup.scopeCombo}"/>
   <p:ajax process="scope" update="schedule, scheduleForm, scheduleFormPG" listener="#{scheduleView.changeScopeType()}"/>
 </h:selectOneMenu> 

<p:schedule id="schedule" value="#{scheduleView.model}" editable="true"/>

Backing bean:

@ManagedBean
@ViewScoped
public class ScheduleView implements Serializable { 

@PostConstruct
    public void init() {
        System.out.println("Init ");
        scopeChange();                
    } 

    public void scopeChange(String scope){
        System.out.println("scopeChange ");
        model.clear();
        events = (List<Event>) commonServis.bringEverythingByCriteria(Event.class, "scope" , scope);   
        for(int i= 0; i<events.size();i++){
        model.addEvent(new DefaultScheduleEvent(events.get(i).getAd(), events.get(i).getStartDate(),events.get(i).getEndDate()));
    }

    public void changeScopeType() {
    System.out.println("changeScopeType ");
        scopeChange (scope);
}

The output of the above code is:

Init
scopeChange

When the user changes the value in the selectonemenu:

changeScopeType
Init
scopeChange

It is supposed to go into init method just once. But after the changeScopeType function is triggered it gets into the init method and fills the schedule with unrelated data. I thought it might be related to @Postconstruct annotation but I couldn’t find any related explanation. Can anyone understand the reason and offer a solution?

Here is the full page:

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                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://prime.primefaces.org/ui"
                template="templates/layout.xhtml"
                xmlns:c="http://java.sun.com/jsp/jstl/core">
    <ui:define name="title">#{labels.schedule}</ui:define>
    <ui:define name="content">
        <h:form id="scheduleForm">
            <h:panelGrid id="scheduleFormPG">
                <p:growl id="msgs" />
                <p:dialog modal="true" widgetVar="statusDialog" header="Status" draggable="false">
                    <h:graphicImage value="resources/images/ajax-loader.gif" />
                </p:dialog>
                <p:dialog showEffect="explode" hideEffect="explode" resizable="false"
                      header="warning" widgetVar="confirmationErase" appendToBody="true" modal="true">
                    <h:outputText value="Are you sure?"/>
                    <br/>
                    <p:commandButton  value="Yes" actionListener="#{scheduleView.deleteEvent(AE)}"
                                     update="msgs, scheduleFormPG, schedule, wrapperPanel"
                                     onstart="statusDialog.show(),confirmationErase.hide()"
                                     oncomplete="statusDialog.hide(), eventDialog.hide()" process="@parent, scope" />
                    <p:commandButton value="No" onclick="confirmationErase.hide()" type="button" />
                </p:dialog>                
                <h:outputText value="scope :" />
                <h:selectOneMenu id="scope" value="#{scheduleView.scope}">                    
                    <f:selectItems value="#{lookup.scopeTypeCombo}"/>
                    <p:ajax process="scope" update="schedule, scheduleForm, scheduleFormPG" listener="#{scheduleView.changeScopeType()}"/>
                </h:selectOneMenu>                
             </h:panelGrid>            
            <p:schedule onDateSelectUpdate="wrapperPanel" 
                        onEventSelectUpdate="wrapperPanel" onEventSelectComplete="eventDialog.show()" eventSelectListener="#{scheduleView.onEventSelect}" 
                        onDateSelectComplete="eventDialog.show();"  dateSelectListener="#{scheduleView.onDateSelect}" id="schedule" value="#{scheduleView.model}" editable="true"/>
            <p:dialog id="dialog111" widgetVar="eventDialog" header="Event Information" showEffect="clip" hideEffect="clip">
                <p:panel id="wrapperPanel">                    
                    <h:panelGrid id="eventDetails" columns="2">   
                        <h:outputLabel for="eventName" value="Event Name *: " />
                        <p:inputText id="eventName" value="#{scheduleView.event.title}" required="true"/>
                        <h:outputLabel value="Start Date:" />
                        <p:calendar id="sKalender" value="#{scheduleView.event.startDate}">
                            <f:convertDateTime pattern="dd/MM/yyyy" />  
                        </p:calendar>
                        <h:outputLabel value="End Date:" />
                        <p:calendar id="eKalender" value="#{scheduleView.event.endDate}">
                            <f:convertDateTime pattern="dd/MM/yyyy" />  
                        </p:calendar>
                        <h:outputLabel value="All Day:" />
                        <h:selectBooleanCheckbox id="allDay" value="#{scheduleView.event.allDay}" />
                        <h:outputLabel value="scope: " />
                        <h:selectOneMenu id="scopeChoice" value="#{scheduleView.event.scope}">                    
                            <f:selectItems value="#{lookup.scopeTypeCombo}"/>
                         </h:selectOneMenu>                         
                          <p:commandButton onclick="confirmationErase.show()" oncomplete="eventDialog.hide()" update="wrapperPanel, msgs, schedule" type="reset" value="Delete" />
                        <p:commandButton value="Save" actionListener="#{scheduleView.addEvent(AE)}" process="@parent, scope" update="schedule wrapperPanel msgs scheduleForm" oncomplete="eventDialog.hide();"/>
                    </h:panelGrid>
                </p:panel>
            </p:dialog>
           </h:form>
    </ui:define>
</ui:composition>
  • 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-17T08:34:47+00:00Added an answer on June 17, 2026 at 8:34 am

    The problem was this line of code:

    <p:ajax process="scope" update="schedule, scheduleForm, scheduleFormPG" listener="#{scheduleView.changeScopeType()}"/>
    

    update was refreshing the whole page, instead it should’ve only update schedule. When I change it to:

    update="schedule" 
    

    the problem solved.
    Thanks everyone for their effort.

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

Sidebar

Related Questions

I am using primefaces p:schedule component to display events as shown here . p:schedule
I am using primefaces(3.0) scheduler component. http://www.primefaces.org/showcase-labs/ui/schedule.jsf As we can see here there there
I am trying to schedule the tasks from my application using schtasks instead of
I'm using Quartz.NET to schedule a job which loads a bunch of data from
I am looking to extract human readable schedule information from the ReportServer.dbo.Schedule table using
I am using java.util.Timer class and I am using its schedule method to perform
I am using quartz scheduler to schedule my job. I have used CronTrigger. But
I am using quartz.net to schedule regular events within asp.net mvc application. The scheduled
I am using jquery and fullcalendar to schedule activities. When users select a timeslot,
I have a schedule grid based on a HTML table using jQuery/jQuery UI drag

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.