Customize Calendar Button Panel

UI Components for JSF
Post Reply
salvob
Posts: 1
Joined: 03 Sep 2013, 16:23

06 Sep 2013, 10:31

Is it possible to add a button to "button panel" on p:calendar?

Andre Froes
Posts: 155
Joined: 16 Mar 2011, 17:24
Location: Brazil - Curitiba

06 Sep 2013, 15:16

If you inspect the calendar, you will find this:

Code: Select all

<div class="ui-datepicker-buttonpane ui-widget-content">
    <button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" data-handler="today" data-event="click">Today</button>
    <button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" data-handler="hide" data-event="click">Done</button>
</div>
customize at will, since the persisted data will be the one stored at input
PrimeFaces 3.5 | Glassfish 3.1 | Mojarra 2.1.5 (JSF 2.1)
Netbeans 7.2.1 | JDK1.7 | Java EE 6 | SQL Server 2008
Win7 64 bits | Firefox 10 - Chrome - IE (all unfortunately)

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

07 Sep 2013, 05:55

p:calendar = jquery datepicker

search google and stackoverflow, and then let your research begin.
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

07 Sep 2013, 11:51

You can always use javascript (in the form of jquery) to simply manipulate the dom and move buttons inside it. Just keep into account if you want to update the calendar that you have to move the button inside it again, so update a 'wrapper' that contains the additional button and the jquery code... You can even wrap that in a custom component

fredwilliam
Posts: 16
Joined: 13 Dec 2015, 09:28

07 Dec 2017, 03:48

Dear friends!
Sorry for my little knowledge, I already researched a lot and could not find a way to trigger or change the behavior of one of these buttons! could you help me with a practical example?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 40 guests