I want to make a method call from the jsf and pass parameter to it.
Shruti B
Greenhorn
Joined: Jan 19, 2006
Posts: 7
posted
0
Problem: I want to make a method call from the jsf and pass parameter to it.
1. I have a description field which is of 500 characters. 2. I want to show only 37 charcters of the whole description field in the jsf page. 3. So i decided to write a mthod which would convert those 500 characters from the database to the 37 characters but this i dont know how to make the mehtod call and pass the parameter to it.
Please Help
Regards,<br />Shruti
Rajeev Ravindran
Ranch Hand
Joined: Aug 27, 2002
Posts: 455
posted
0
Did you try calling your method from the getDescription() of ManagedBean/BackingBean, whichever you used to bind to your component.
Thanks,
g madhava
Ranch Hand
Joined: Sep 14, 2001
Posts: 85
posted
0
3. So i decided to write a mthod which would convert those 500 characters from the database to the 37 characters but this i dont know how to make the mehtod call and pass the parameter to it.
What parameter are you planning to pass ? what method are you planning
I am assuming that you know how JSF handles the method calls using value binding expressions. (for example, in your case it will be #{someBean.description}. This will invoke the getDescription() method of "someBean" managed bean to set the value for that JSF component(In your case, it might be a "textbox" or a "textarea").