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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:29:16+00:00 2026-06-12T22:29:16+00:00

I have a component,where users can choose to set any date at all even

  • 0

I have a component,where users can choose to set any date at all even null, but when the date is not null, it should render a panel to allow for other options. But, the date is not getting updated and is always null as a result it never renders the panel. Help needed on this. Below is my code:

        <p:calendar id="dt"
                    value="#{user.deadline}"
                    pattern="MM/dd/yyyy"                        
                    showOn="button"
                    mindate="#{userr.minDate}">
            <f:validator validatorId = "dateValidator"/>
            <f:attribute name="minDate" value="#{user.minDate}" />

            <p:ajax event="dateSelect" listener="#{user.updateDeadlineDate}" update=":userForm:userReminderForm"/>
        </p:calendar>

        <p:panel id= "myPanel" rendered="#{user.getDeadline != null}">
         .. some component that needs user.deadline

        </p:panel>

snippet from my bean:

   public Date getDeadline() {
    return deadline;
     }

public void setDeadline(Date deadline) {
    this.deadline=deadline;
      }
 public void updateDeadlineDate(DateSelectEvent event) {

    this.setDeadline(event.getDate());

}
  • 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-12T22:29:17+00:00Added an answer on June 12, 2026 at 10:29 pm

    First, your update target is probably wrong (nested forms :userForm:userReminderForm are invalid in HTML/JSF), maybe you wanted to do update=":userForm" (since you can’t update the panel directly as siebz0r pointed out):

    <p:ajax event="dateSelect" listener="#{user.updateDeadlineDate}" update=":userForm"/>
    
    <p:panel id= "myPanel" rendered="#{user.deadline != null}">
         .. some component that needs user.deadline
    
    </p:panel>
    

    The getDeadline is unnecessary, when you reference backing bean properties just use their names like deadline.

    Note that you can use the validator of the calendar component, so you can avoid the additional <f:validator validatorId = "dateValidator"/> tag.

    Your <f:attribute name="minDate" value="#{user.minDate}" /> tag is probably unnecessary in this case. If you want to set your deadline to the value of minDate (since they are in the same bean) just do:

    public void updateDeadlineDate(DateSelectEvent event) {
        mindDate = event.getDate()
        this.setDeadline(mindDate);
    }
    

    and remove the <f:attribute name="minDate" value="#{user.minDate}" />.

    Finally I would use the empty keyword in the rendered attribute instead of != null: rendered="#{not empty user.deadline}"

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

Sidebar

Related Questions

I have inherited a jquery component that simulates a dropdown for users to choose
I have an application where users can set how values are displayed. The users
I have a form in which the user can choose a component type from
How can I set the default font of an NSTextView component? I need to
I have this small app that loads plugin type components that other users can
I have a java swing application which expects the users to choose YES or
Say I have a web component that uses jQuery and I want to distribute
I have got a TTable component that uses the BDE to access a DBase
We have a a VB6 app (in a COM component) which uses CDate() to
I have an applet. In this I have a JLabel component. When the user

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.