• 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

Method in Backing bean doesn't work

 
Greenhorn
Posts: 20
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, this si my first post in the forum, I hope you can help me because i'm geeting crazy with this.

I have a jsf page, with vusal jsf, and a div container, in this container i also have a Layout panel, and inside this four hiddenFields. This hiddenFields are wired to a managed bean.

When i submit the page it just don't do the method, instead, do init, set's and get's and preprocess methods and break the work with no Exceptions in the server, Glassfish V2.

But when I comment the lines of the hiddenFields in my jsp it work's wonderful.

Any advice, please?
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Add <h:messages /> to the page to take note of any conversion and validation errors. Read the application server logs as well, it might contain some warnings.
 
Victor Sosa
Greenhorn
Posts: 20
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I try this with a messageGroup to print all system messages, but in the postback didn't print anything, so i think there is no errors, from the server view, in the request.

Please anyone who can help me
 
Victor Sosa
Greenhorn
Posts: 20
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok, I did this.

change the hiddenFields to textField, so i can see the values of them, and add a message to each text.

now when i press the button and the page is returned, print me a NullPointerException i one textField, the strange thing is that I use this textField for an ajax operation and do it well, so I can't find why is the NullPointerException.

Can you help me?
 
Victor Sosa
Greenhorn
Posts: 20
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I check my code and result that I was submiting a value, and in hte set method of that value i was using another value not yet submitted, so there is de NullPointerException, but I'm in the start point, it just don't do the action method of the button.

Do all the get's and set's, but no the action method.

I'm working on that, but if someone has an idea, please do tell
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Show the commandButton code line and the action method code snippet.
 
Victor Sosa
Greenhorn
Posts: 20
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I find what was my problem.

In javascript I set disabled my button and in the server just set null in the action of the bean, and never get in the method.

Sorry for al the problems guys. Thank you so much.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, if you set some input element to disabled, then its name/value pair won't be sent as request parameter to the server side. If it concerns the submit button, then that way JSF won't know if any button was pressed.
 
Create symphonies in seed and soil. For this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic