The moose likes JSF and the fly likes How can I set variable in backing bean directly from jspx page? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "How can I set variable in backing bean directly from jspx page?" Watch "How can I set variable in backing bean directly from jspx page?" New topic
Author

How can I set variable in backing bean directly from jspx page?

Tomas Pytlik
Greenhorn

Joined: Sep 26, 2008
Posts: 9
Hi,

I have DataTable and PanelGrid in all cells of this table. When I click, PanelGrid change his color and that way i highlight one cell of my table.

Example follows:



Now to my problem: I need save value of strColor into item.days[1].color when i click. Can anyone help me?


Thanks,
Tomas Pytlik
[ September 26, 2008: Message edited by: Tomas Pytlik ]
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Marshall, please check your private messages.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Pass it as a hidden input value to the server side. You can use h:inputHidden and some piece of JS for this.


Code depot of a Java EE / JSF developer | JSF / Eclipse / Tomcat kickoff tutorial | DAO kickoff tutorial | I ♥ Unicode
Tomas Pytlik
Greenhorn

Joined: Sep 26, 2008
Posts: 9
Thank for your post, but i'm newbie, can you be more specific please?
Tomas Pytlik
Greenhorn

Joined: Sep 26, 2008
Posts: 9
You obviously can't
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3268

Originally posted by Tomas Pytlik:
You obviously can't


Tomas, have you tried the suggestion? What part are you stuck on?


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Tomas Pytlik
Greenhorn

Joined: Sep 26, 2008
Posts: 9
I was traying to wrote InputHidden, but I'm not sure how. Paul said, pass IT as a hiden input, but what IT is exactly?

I understand, that InputHidden is good for storing value. But how it help in my case?

I know, I'm foolish and I'm sorry I need big kick before my light turns on.
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3268

I think Bauke was suggesting that you store the the value of strColor into a h:inputHidden field and then pull it out.
Tomas Pytlik
Greenhorn

Joined: Sep 26, 2008
Posts: 9
It works! Thank you, everybody!
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3268

Well done! Always nice to see people solving their problems
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can I set variable in backing bean directly from jspx page?
 
Similar Threads
Special Characters '&' and ':'
dataTable in JSF
How to use datatable with no records in a list
Problem with submit()
datatable - row colors