Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to use a bean to get the value for a h:inputText and another bean to set it?

Posted on 2008-10-02
1
Medium Priority
?
366 Views
Last Modified: 2013-11-24
I want to be able to get the value for a h:inputText from a bean x and set it into bean y, without changing the value of the x bean. How can I achieve this?
0
Comment
Question by:daraii
1 Comment
 
LVL 1

Accepted Solution

by:
peter-blackwood earned 2000 total points
ID: 22722130
You have probably solved this by now, but just in case, you can define bean x to contain a property of type Y.

In faces-config do the code below, then in class X add setter and getter for ybean.  You can then access any public methods in ybean.


<managed-bean>
	<managed-bean-name>ybean</managed-bean-name>
	<managed-bean-class>
		com.example.Y
	</managed-bean-class>
	<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
 
<managed-bean>
	<managed-bean-name>xbean</managed-bean-name>
	<managed-bean-class>
		com.example.X
	</managed-bean-class>
	<managed-bean-scope>request</managed-bean-scope>
	<managed-property>
		<property-name>ybean</property-name>
		<value>#{ybean}</value>
	</managed-property>
</managed-bean>

Open in new window

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question