[SOLVED] TimePicker: How to realize an editmask ?

Community Driven Extensions Project
Post Reply
RueKow
Posts: 331
Joined: 21 Jun 2011, 23:34
Location: Germany - Wiesbaden

07 Jul 2014, 15:38

I need an editmask like "__:__" in TimePicker component. Is that possible?
Last edited by RueKow on 08 Jul 2014, 13:26, edited 1 time in total.
Rüdiger

PrimeFaces 11.0 | Ultima 2.0
Mojarra 2.3 | Tomcat 8/9 | Win7/10 | OS X 10.14

RueKow
Posts: 331
Joined: 21 Jun 2011, 23:34
Location: Germany - Wiesbaden

08 Jul 2014, 13:25

I have found a solution with a small jQuery plugin called "Masked Input Plugin". You can find it here:
http://digitalbush.com/projects/masked-input-plugin

This is working fine for me:

Code: Select all

<h:head>
	<h:outputScript name="jquery.maskedinput.js" />
</h:head>

Code: Select all

<h:outputScript>
	jQuery(function($){
		$.mask.definitions['H']='[0-2]';
		$.mask.definitions['M']='[0-5]';
		$('[id="tpID1_input"]').mask('H9:M9');
	});
</h:outputScript>
<pe:timePicker id="tpID1" value="#{myBean.time}"
	mode="popup" locale="de" showOn="button" style="width:40px" showCloseButton="true"
	required="true" requiredMessage="Bitte geben Sie eine Uhrzeit ein." />
Rüdiger

PrimeFaces 11.0 | Ultima 2.0
Mojarra 2.3 | Tomcat 8/9 | Win7/10 | OS X 10.14

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests