Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem passing value to method in correct order(SOLVED)

Matt Kohanek
Village Idiot
Ranch Hand
Posts: 484
Java jQuery Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have my jsf page that has an input field and a submit button.

The input field binds the text the user enters to (package.class.variable)
The submit button calls a method that is in a different package though - projectContainer.project.addDevice (package.class.method)

So in this addDevice method, I have tried a few different things, but the value being passsed is remaining null instead of getting the updated name variable from the deviceContainer package.

Here is a snippet of the method that is in the projectContainer package that is receiving a null value:

Now if I put this method in the same device class that holds the name variable it works just fine, I just have to change the device.setName(device.getName()) method to device.setName(name);

But this is not an option in this case.

So is there a way to fix this? I guess what needs to happen will be first when the user hits submit the values are set in the device class. That way when I do device.setName(device.getName()); in the project class it will return the value the user enters instead of null.

solution - I just added a deviceName variable to the project class so it wouldnt need to pull this value froma different class. these things are so simple if you just take a step back and think about them
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic