-
1. Re: calling backing bean mwthos with argument
mail.micke Jul 21, 2008 5:12 AM (in response to user1234)Doesn't make sense to me to use an inputText with a method parameter. What would be set when submitting the form?
If it was an outputText, you could use the Seam framework which has enhanced EL a bit to allow for passing parameters. -
2. Re: calling backing bean mwthos with argument
user1234 Jul 21, 2008 5:54 AM (in response to user1234)Yes u r absolutley right..actually i have given worng example i need it in <h:outputText> and <h:outputLabel> ...actualy the problem is i can send parameter in action event like commandbutton of link click...but i need to show all the labels or text filed value should come from a single method of backing bean which will take a parameter and return a value depending upon the parameter
-
3. Re: calling backing bean mwthos with argument
mail.micke Jul 21, 2008 6:05 AM (in response to user1234)Hi
Sounds like you want this to act like a resource bundle.
Is the returned value dependant on the state of the backing bean?
If it is stateless and a simple mapping from key to a value (and you don't want a resource bundle for this) you could create a Facelets function which is very simple (simpler than integrating Seam). -
4. Re: calling backing bean mwthos with argument
user1234 Jul 21, 2008 7:33 AM (in response to user1234)With resource bundle with key and var i can get the values and my resource in that case is a properties file..actually my problem is my data is comming from xml..so i want to pass the node name from jsf page and in my backing bean method i will return the value of the node..so can u plz help if i there is anyway to do like this???
thnx for replying.. -
5. Re: calling backing bean mwthos with argument
mail.micke Jul 21, 2008 8:28 AM (in response to user1234)Are you using Facelets?
If you are you can very easily create a Facelets function.
If not I'd suggest you have a look at it, very nice viewhandler with some nice features.
A Facelets function is simply a static method in a Java class, dead simple.
All you need is:
- 1 Java class with the method(s)
- XML file (yourName.taglib.xml), which maps EL function to java method.
- Add the taglib.xml to a context param so it gets loaded.
Some links:
http://www.ibm.com/developerworks/java/library/j-facelets/
http://www-128.ibm.com/developerworks/web/library/j-facelets2.html -
6. Re: calling backing bean mwthos with argument
ilya_shaikovsky Jul 22, 2008 10:09 AM (in response to user1234)If you need just action and some parameter inside - just use f:param. So in your action get the param value from request map and use it.