pe:timePicker disabled doesn't work

Community Driven Extensions Project
Post Reply
oswalda
Posts: 5
Joined: 03 Apr 2012, 10:31

03 Apr 2012, 11:06

Hello,

I have, besides others, a calendar and a timePicker component. The calendar component works fine but the timePicker component does not work if I include the disabled attribute.
However, the expression language in the disbaled attribute is the same for calendar and timePicker but it only works for calendar.
If I delete the disabled attribute in the timePicker component it works fine, but if I set the diabled attribute the widget pops up but I cannot select any values.

<p:calendar id="calendarTime" disabled="#{cc.attrs.readonly || (cc.attrs.delegate && cc.attrs.backingBean.delegate)}"
value="#{cc.attrs.application.date}"
pattern="dd.MM.yyyy" timeZone="#{timeZone.timezone}"
showButtonPanel="true" navigator="true"
mindate="#{timeZone.currentDate}" />
<pe:timePicker value="#{cc.attrs.application.time}" disabled="#{cc.attrs.readonly || (cc.attrs.delegate && cc.attrs.backingBean.delegate)}"
widgetVar="spinnerTimeWidget" />

I use primefaces 3.2 and primefaces extensions 0.4.0

Thanks

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

03 Apr 2012, 12:37

Hi,

I can not reporoduce your problem. I set disabled="true" in our showcase

Code: Select all

<pe:timePicker value="#{timePickerController.time2}" mode="popup" label="Popup time picker" disabled="true"/>
and TimePicker was disabled - no popup appears on click. This is correct. A disabled component should not react on user interactions.

What is your problem exactly?
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

03 Apr 2012, 12:54

Ok. I see. You mean perhaps disabled UI style. It's disabled with disabled="true", but doesn't look as disabled. We should set CSS "ui-state-disabled" for disabled input field. Did you mean that?

I have created an issue http://code.google.com/p/primefaces-ext ... ail?id=161
Thanks!
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

oswalda
Posts: 5
Joined: 03 Apr 2012, 10:31

03 Apr 2012, 13:09

disabled="true" or disabled="false" works but not for example disabled="#{cc.attrs.readonly || (cc.attrs.delegate && cc.attrs.backingBean.delegate)}", so disabled with an EL expression

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

03 Apr 2012, 13:20

Sure it works with EL. I have checked with EL. It 's works. Example from showcase:

Code: Select all

<pe:timePicker value="#{timePickerController.time2}" widgetVar="popupTimeWidget" label="Popup time picker" disabled="#{timePickerController.timeDisabled}"/>
Resolving of disabled attribute is handled by JSF itself. Check you #{cc.attrs.readonly || (cc.attrs.delegate && cc.attrs.backingBean.delegate)} if it's true.

The issue I have created is fixed. But it was UI look-&-feel only.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

oswalda
Posts: 5
Joined: 03 Apr 2012, 10:31

05 Apr 2012, 16:38

#{cc.attrs.readonly || (cc.attrs.delegate && cc.attrs.backingBean.delegate)} is false. So it should work.

If I use something like that it works:

Code: Select all

<p:calendar id="calendarTime" disabled="#{cc.attrs.readonly || (cc.attrs.delegate && cc.attrs.backingBean.delegate)}"
value="#{cc.attrs.application.date}"
pattern="dd.MM.yyyy" timeZone="#{timeZone.timezone}"
showButtonPanel="true" navigator="true"
mindate="#{timeZone.currentDate}">
<pe:timePicker rendered="false" />
</p:calendar

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

05 Apr 2012, 17:48

It's not a problem of TimePicker as I said. EL or not EL - doesn't matter. Try to output the value with h:outputText

Code: Select all

<h:outputText value="#{cc.attrs.readonly || (cc.attrs.delegate && cc.attrs.backingBean.delegate)}" />

<pe:timePicker value="#{cc.attrs.application.time}" disabled="#{cc.attrs.readonly || (cc.attrs.delegate && cc.attrs.backingBean.delegate)}" widgetVar="spinnerTimeWidget" />
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests