How do I use f:subview with referance class attributes

Hi all,
Any pointer on the below problem will be greatly appretiated....
I have a "Address" class used in "Customer" for billing and shipping address and "Customer" Class is placed in faces-config.xml as named with "CustomeBean".
public class Address {
     private String street;
     private String city;
     private String state;
     private String zip;
// Empty construtor + all getter and setter methods
public class Customer{
private String firstName;
private String lastName;
private Address billingAddress;
private Address shippingAddress;
//Empty Constructor and all getter and setter methods
public void add(Customer customer){
// Logic to make this as persitance
customer.jsp
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<html>
<head><title>Login</title></head>
<body>
<f:view>
<h:form id="customerForm">
First Name: <h:inputText id="firatName" value="#{CustomerBean.firstName}" >
Last Name: <h:inputText id="lastName" value="#{CustomerBean.lastName}" >
Billing Address
Street: <h:inputText id="bstreet" value="#{CustomerBean.billingAddress.street}" >
City : <h:inputText id="bcity" value="#{CustomerBean.billingAddress.city}" >
State: <h:inputText id="bstate" value="#{CustomerBean.billingAddress.state}" >
Zip: <h:inputText id="bzip" value="#{CustomerBean.billingAddress.zip}" >
Shipping Address
Street: <h:inputText id="sstreet" value="#{CustomerBean.shippingAddress.street}" >
City: <h:inputText id="scity" value="#{CustomerBean.shippingAddress.city}" >
State: <h:inputText id="sstate" value="#{CustomerBean.shippingAddress.state}" >
Zip: <h:inputText id="szip" value="#{CustomerBean.shippingAddress.zip}" >
</h:form>
</f:view>
</body>
</html>
Now, what I want to do is "address" part as re-usable with <f:subview> by makeing it in seperate page and make it include in customer.jsp.
customer.jsp
<f:view>
<f:subview id = "bAddress">
<jsp:include page="address.jsp" />.
</f:subview>
<f:subview id = "sAddress">
<jsp:include page="address.jsp" />
</f:subview>
</f:view>
How do I make refer the CustomerBean.billingAddress.* and CustomerBean.shippingAddress.* values when I use <f:subview> ?
How to make to access the values of address in managedbean(Custoer.java) in add(customer) method?
Any help ...
Thanks
pvkr

Martin,
I'm still bothered by "CustomerBean.shippingAddress".
Please post a snip of the management of this object
from your faces-config.xml. You actually name your
object instance with the first letter captialized
like your class?
Sorry for breaking coding convestion ...:-)
faces-config.xml
<faces-config>
<managed-bean>
<description>Customer Bean Holder</description>
<managed-bean-name>CustomerBean</managed-bean-name>
<managed-bean-class>com.my.test2.Customer</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
</faces-config>
I'm still not sure what you are trying to achieve.
<f:subview> is mostly like an import of a frag of
f jsf tags. Does not have runtime storage capability
but is a way to repeat a frag different places. It
does not control the workings, serial state of managed
beans.
Post more snips...All i am trying to achive is , address(Address.java) part is gona simillar in most of the places in application and it is gona just like an attribute to all other classes like customer, insurance, company etc ...SO when I do create data entry screens for customer, insurance, company etc .. i need to just include address part as a snippet with <f:subvirew> and wire that seamlessly to customerBean, insuranceBean, companyBean etc...
So in my previous posting what i mention customerBean.billingAddress.*(street,city,state,zip) and customerBean.shippingAddress.* is directly inside customer.jsp
But when you try to re-use address part as address.jsp, address.jsp knows only some object simillar to Address class. And the address attributes are unchanges extect the prefix of those attributes in valuebinding is changing based who is the parent object of that address attributes.
So in address.jsp in the place of "???" , i need to find a way to pass the "parentObject.addressObject" (ex: customerBean.shippingAddress , customer.billing Address , insurance.mailingAddress etc ...) so that in process it should look like "parentObject.addressObject.street" , "parentObject.addressObject.city" etc ...
Street: <h:inputText id="bstreet" value="#{???.street}" >
City : <h:inputText id="bcity" value="#{???.city}" >
State: <h:inputText id="bstate" value="#{???.state}" >
Zip: <h:inputText id="bzip" value="#{???.zip}" >
Any clue ....

Similar Messages

  • How do I use my ipad with Apple TV?

    How do i use my iPad2 with Apple TV?

    If it's an ATV2 or 3, you can use AirPlay. AirPlay automatically becomes available when the two devices are on the same Wi-Fi network.
    HOWEVER! You should be aware of that AirPlay is, in some circumstances, far inferior to VGA / HDMI-cabled solutions. Please see my posts at https://discussions.apple.com/message/18697551?ac_cid=sa123456#18697551 for more info.

  • How do I use apple remote with iPhone 5 ?

    How do I use apple remote with iPhone 5 ?

    Iphones dont have ir at all which the remote use for comm
    Only option is to use a dock which have ir

  • When I try to sign in to iTunes, it tells me that my Apple ID has not yet been used with the iTunes Store. How do I use my account with the iTunes Store?

    When I try to sign in to iTunes, it tells me that my Apple ID has not yet been used with the iTunes Store. How do I use my account with the iTunes Store?

    Hello Daijalove97,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at:
    Using an existing Apple ID with the iTunes Store and Mac App Store
    http://support.apple.com/kb/HT2589
    To use your Apple ID at the iTunes Store
    Open the latest version of iTunes.
    Choose Store > Sign In from the Store menu.
    Enter your Apple ID and password, then click Sign In.
    Click Review when asked to review your information.
    Enter your billing information, a credit card will be required.
    Click Continue when you're done entering your credit card and billing information.
    Best of luck,
    Mario

  • How can I use an iPad with two itunes accounts?

    How can I use an iPad with two itunes accounts?
    Hi there
    My partner has a works iPad, which has her works Apps on (ones that are specifically made by her company and are NOT available in the App store).
    What I want to be able to do is to ALSO have my itunes account on there so that I can put all the apps I have purchased previously from my iPhone on it.
    This is so I can put on VLC player (thats already in my itunes account) so I can add videos to the iPad.
    How do I do this please?
    I tried it before by connecting it to my mac, but it wiped everything off the iPad completely and also deleted the data settings for using 3G.
    So I want to avoid this happening again the future as it had to be sent back to her head office to be sorted again.
    Any advise please?
    Thanks

    You can't. The iPad is desgined to be a 'one user' device and only really works with one apple ID at a time.
    The only way would be if she, at work and with her work apple id, downloaded your apps (repurchasing them of course).
    It's not meant to be a multiple user/multiple ID device.

  • How can i use text expander with the new Mavericks,

    how can i use text expander with the new Mavericks,

    I regret upgrading to mavericks for the same reason
    ftamez wrote:
    how can i use text expander with the new Mavericks,
    Now I have been searching - and you have to buy an app and it will cost you $34.99 (what a rip off)

  • TS1629 How do I use home sharing with direct TV / Verizon internet. I have turned on Home sharing on apple tv and in iTunes but can't see the library in apple tv. I can see the photo stream but thats it. Any Ideas????

    How do I use home sharing with direct TV / Verizon internet. I have turned on Home sharing on apple tv and in iTunes but can't see the library in apple tv. I can see the photo stream but thats it. Any Ideas????

    go to home-sharing on Apple TV and type in your info as ask.
    hope this help

  • How do I use Home Sharing with two different apple accounts?

    How do I use Home Sharing with two different apple accounts?

    Morning Saintine,
    Thanks for using Apple Support Communities.
    Home Sharing enables you to stream or transfer music, movies, TV shows, apps, and more among up to five authorized computers in your household. To do so, you will need to Turn on Home Sharing on each computer using the same Apple ID.
    Understanding Home Sharing
    http://support.apple.com/kb/HT3819
    Hope this helps,
    Mario

  • How do i use itunes server with itunes match?

    Hi all,
    I am using itunes server on my synology NAS. On my desktop i've always used itunes with match. How can I combine the two? In other words, how can i use itunes match with itunes server?
    thanx

    I don't know if you've already solved it yourself, but I had this problem too. Try signing out of iTunes Store under 'Settings', then signing back in with JUST your iTunes user name, with no '.mac' or '.me' suffix. If, for example, your usual sign-in method is '[email protected]' try using 'joebloggs'.
    Worked for me.

  • How do I use my iPad with a digital projector

    How do I use my iPad with a projector

    Have a look at this:
    http://www.epson.com/cgi-bin/Store/jsp/Landing/ProjectorApp.do

  • How do you use an iPad with Apple TV

    How do I use an iPad with Apple TV?

    Read the iPad manual:  http://support.apple.com/manuals/#ipad
    See this article: http://support.apple.com/kb/HT4437

  • How can i use "icloud backup" with ios 4.2.1?

    How can i use "icloud backup" with ios 4.2.1? I tried to update my ihpone 3G wih the newest IOs. Seems not to be possible.

    You cannot.
    It requires ios 5.
    Your iphone can only go to 4.2.1

  • How can I use the NI PXI-6508 with Lab View 7? what are the first steps to get started??How can I use the channels with lab view 7????

    I have a 8 slot PXI system with 2 NI PXI 6508 and 1 DMM 4070 in it. I want to get started with programming the digital I/O cards (6508)! How can I use this cards with LabView 7?what is the best way to get started, or where can I get examples showing how to use the several channels?
    Thanks!
    Philipp

    Philipp,
    The best way to get started is to decide if you want to use traditional NI-DAQ or NI-DAQmx. Recently we released NI-DAQ 7.1 which provides NI-DAQmx support for the PXI-6508. In my opinion, NI-DAQmx is more efficient and much easier to use.
    To get started with examples, simply launch LabVIEW and go to Help>>Find Examples. Then expand Hardware Input and Output>>DAQmx and select the appropriate digital group for your application. This should help get you started.
    Please repost if you need addition assistance. Good luck with your application!

  • How can I use the DBAdapter with SequencingPollingStrategy in OSB Cluster?

    Hi!
    I have a OSB cluster. I need to read a view with the DBAdapter. I use SequencingPollingStrategy to implement the adapter.
    Then I import it into OSB and make it work and the service works normally in the single node.
    But if I import it into OSB cluster, the service always read the duplication records from the view.(the Distrbute polling is not worked in SequencingPollingStrategy )
    So how can I use the DBAdapter with SequencingPollingStrategy in OSB Cluster?
    Thank you!

    Nope. Version 5 is a fashion accessory: it looks like software, but it doesn;t actually do anything. Sort of like a sports car with a lawn-mower engine. Looks snzzy. Doesn't really work. (And given how buggy it is, I should further specifiy that the lawn-mower engine comes with a blade: it chews up your old templates, produces files that cannot be sent as email attahcments [yes, really], and—this just in—doesn;t play well with the new SMB facility of Mavericks. In short, as one reviewer put it, "un unmitigated disaster."

  • How can i use MS word with MAVERICK

    how can i use MS word with MAVERICK?  None of the MS Office applications work with new IOS!!!

    What version of Microsoft Office Mac are you running?  You probably just need to update it to the latest release:
    http://www.microsoft.com/mac/downloads?pid=Mactopia_Office2011
    Office 2011 Mac's latest version is 14.3.8 for instance.

Maybe you are looking for

  • Yahoo emails from Trash folder in Outlook reappear in Inbox

    Using Yahoo in Outlook on OS X Mountain Lion - deleted emails repeatedly reappear in in-box after a minute or so, but when I delete them from the Trash they no longer reappear. This has been going on for weeks. Any suggestions?

  • PF contribution at time of Arrears

    Hi Guru's When we pay the arrears there is mismatch in Employee and Employer PF amounts in Wagetype Reporter. in normal scenario  /3f1 = 6000/- /3f3 = 5459/- /3f4 = 541(Pension) at time time of arrears employer contribution is showing less amount com

  • Problem mapping styles to tags

    How do I prevent creation of the "Story" tag during mapping of styles to tags? I need to achieve the following using a script: I have two XMElements in the structure view, say Title and Body as follows: <Root>   <Title/>   <Body/> </Root> Also, I hav

  • Movies play in old QT versions but not now?

    Hey everyone! I have a .mpg file created about 5 years ago on a G4. I recently tried opening it on my G5 with QT Version 7.5.5 but it said "This file could not be opened because it is not a movie file." When I went back to the G4 and tried opening it

  • IMovie 11 doesn't finish loading.

    I'm on OS X 10.7.4 and running iMovie '11.  When I load iMovie, the menu bar loads, but all options are greyed out.  Further, the errors below appear in the console.  I've tried removing the relevant plists and repairing permissions with no luck.  An