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
351 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 500 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Microsoft Edge 9 81
Automatic Image Uploading 9 59
allStar challenge 1 43
Re-position the objects 7 52
A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
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.

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now