• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ajax and p:picklist (PrimeFaces)

 
Ranch Hand
Posts: 35
Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello guys, here the issue:
I need to update the disable attribute of a commandButton based of the number of item in the picklist target, in particular if the target size is 0 the button must be disabled.
here my code (i'm using PrimeFaces 3.4):
Face:


Bean:


The idea was to use the setter method of the pickSize component in a non-ortodox way...
So, when an user transfer an item, the ajax will execute the hidden inputText trought its setter that in turn will set the size value in the pickSize, and finally it will change the value of the disabled attribute of the button.
...I have this is the track error:
any suggestion? thanks guys.

 
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're doing this the hard way. The hidden control is not going to gain you anything.

You're also not defining the selectItems properly for the pickList. Unfortunately, you didn't include the definitions, and the stacktrace error messages for dropdown list-style controls are famously useless, so we'll need specific data.



 
massimo tarantelli
Ranch Hand
Posts: 35
Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for the answer, i have sorted out the problem in this way:



ajax now works.
Anyway it evaluates the target size before the transfer, so it's always one click shifted...
how can I sort out it?
reply
    Bookmark Topic Watch Topic
  • New Topic