Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

null value being passed to method. value should come from inputText field but not working (SOLVED)  RSS feed

 
Matt Kohanek
Village Idiot
Ranch Hand
Posts: 484
Java jQuery Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a very simple page, with just some text, an input field that is bound to the "name" value, and a submit button that calls a method to add this value put into the field to a web service. Here is the jsf:



projectContainerProject.name is just a class that declares variables and setters and getters. Name is one of those variable (I know variable isnt the right word, can someone correct me on that please?)
Here is a snippet:



projectContainerAddProject.addProject (the action of the submit button) is just a method to add the value of "name" to a web service.
Here is the class with the addProject method. If I explicitly put in a value for the setName method it works just fine, so the method is good. It is just when I try to make the setName method take its value from whatever I type in the input filed from the jsf code. Here is the code for it:



I have also tried measurementProject.setName(measurementProject.getName());

So it seems the value I type into the inputField is neevr even being passed to the name variable. If it were this should work fine right? Or am I missing something else? This seems like it should be something relatively simple, so Im sure Im just doing some little thing incorrectly
 
Matt Kohanek
Village Idiot
Ranch Hand
Posts: 484
Java jQuery Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nevermind, I figured it out.

This whole deal with the rich tree taking two weeks to work had me doubting my abilities to the point of me posting the problem before I even try to fix it myself!

I was just calling these get and set methods, when the name value was already set, I just needed to pass that instead. It took me a few seconds of going over the balusc tutorial to figure it out.

Nice to have confidence in my programming abilities again lol

I still would like to know the answer to what to call this:

String name;

I have been calling name a variable but that seems incorrect, can someone correct me please?
 
Paul Clapham
Sheriff
Posts: 22374
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's a variable.
 
Matt Kohanek
Village Idiot
Ranch Hand
Posts: 484
Java jQuery Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh haha OK, I was right then.
Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!