Solved

Initial Value in a JSF input field as Compared to the Bean Name you want to save it in

Posted on 2006-10-19
10
871 Views
Last Modified: 2012-05-05
I'm new to JSF. I'm familiar with using a Bean to save the value by using the value parameter with the inputText component. But, what if I want to save the value to the Bean when I leave the page and I want to pull the initial value from another field on the page? (i.e. Let's say I have a mailing address and a shipping address and I want the default shipping address to be what the mailing address is) Would this need to involved Javascript or is there a simple way/field to handle this in JSF?
0
Comment
Question by:kls1
  • 6
  • 4
10 Comments
 
LVL 10

Expert Comment

by:jaggernat
ID: 17769900
use two hidden fields, one for the mailing address and other for shipping address.
0
 

Author Comment

by:kls1
ID: 17773885
Wouldn't that require a submit? I need this to to immediate as the person navigates the fields.
0
 

Author Comment

by:kls1
ID: 17773892
Maybe I don't follow what you are saying.
0
 

Author Comment

by:kls1
ID: 17773954
I suspect my initial description is poorly worded. My situation is different, but a common example would be that I have a page where there is listed both a billing and shipping street address field. I am familiar with the situation where the person presses the button that says "they are the same" but that isn't really appropriate for my situation. What I need is for the shipping street address field to automatically populate with whatever is in the billing street address.

So, I guess another way of asking this would be: is there a means is JSF where I can do event handling, where when the billing street address is changed then the shipping street address gets a value added if it doesn't already have one.
0
 
LVL 10

Accepted Solution

by:
jaggernat earned 300 total points
ID: 17778098
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:kls1
ID: 17778301
Ok, so JSF doesn't handle this sort of thing then? I would just do the usual Javascript event handling?

I'm trying to do things the "right" way with JSF.
0
 
LVL 10

Expert Comment

by:jaggernat
ID: 17778361
using javascript you are doing it on the client side.
using jsf you will be doing it on the server side, but, UNLESS you click a button or submit the jsp, you cannot do it on the server side using jsf. thats not possible.

since you are not submitting the jsp, javascript would be your best choice. I am also pretty sure thats the only choice!







0
 

Author Comment

by:kls1
ID: 17788798
Yeah, I guess that makes sense. I just haven't been clear on what JSF adds to JSP. So, the event handling mechisms with JSF are server side also (yeah, I know "Java Server Faces") ? This is what I have been unclear about -- what does JSF offer in addition to JSP....
0
 
LVL 10

Expert Comment

by:jaggernat
ID: 17792270
let me make this clear to you:

JSF is a front end framework using which you can control the front-end peice of an application. So JSF provides its own tag library and stuff using which you will design the jsps. So basically, you are putting in jsf tags in a jsp and designing your jsp pages.
 there is no event handling mechanism in jsf. you would have to use javascript to accomplish your event handling stuff

0
 

Author Comment

by:kls1
ID: 17795280
Ok, thanks. That means I need to remove one of my reference urls from my list! (it mentioned JSF doing event handling)

Thanks for your help
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
maven project in eclipse 11 57
immutable object concept 5 111
build fail in maven project 11 179
mask rule in struts validation.xml 5 85
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Knowledge base software has turned out to be a quite reliable method for storing information, promoting collaborative work and for sharing valuable input and solutions.However, some organizations are trying to develop a knowledge base that works wit…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

867 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

22 Experts available now in Live!

Get 1:1 Help Now