How to layout beans for single page design

Hey guys. I'm designing a site that uses the Icefaces framework. I've been reading a book called Real World Java EE patterns. I'm kind of confused how to layout the pages. Normally I would have just a POJO class implement serializable for a bean. This bean would then back each page. With a single page design I'm going to have a bunch of elements on the page. Datatables, trees, inputs, calendars etc. Is it normal or best practice to have separate beans for each datatable, calendar, etc or put that all in one bean? I'm not sure how to approach this. Right now each element is a bean and I'm using the @Inject annotation to have the data table talk to the tree and vise versa. This creates really bad code and if I put this as a member of the class I will get a circular reference because the data table bean has to inject the calendar and the calendar has to inject the data table.
Thanks for any help.

'best' practice is to not follow blindly what other people say, but to reason yourself what works best for you. It has been stated many times before and I will state it again: best practice does not exist. Only personal opinions about what is best exist. Personal opinions are not facts.
So choose what works for you. Is the code easy to maintain? Is it readable? Can you perhaps re-use parts of it? Then I'd say you have a winner.
I'll give you my personal favorite. When working with a page that has input elements, I tend to have two or three beans. Replace XXX with a logical and context sensitive name.
XXXForm - this is a simple request scoped bean that has the action and event methods and will hold some data for reading purposes for the view, possibly taken from a database.
XXXStorage - this is a session scoped bean that holds information from the form; if it is an editing function I initialize it with the current state first. Storing this stuff in a session bean makes it very easy to do Ajax stuff and create input cycles that span multiple requests. Also when data is split in multiple pages, the storage class is the one to remember which page is being displayed.
Optionally, I also have an XXXSearch object, which is a session scoped bean that stores search/sort/filter parameters. I make this session scoped so the information is remembered for the duration of the user's visit, meaning he can navigate away from the page in question, come back and all his choices will still be in place.
So no, I don't have beans specifically for each component, although I might make simple POJOs to hold information gathered from several sources (for example, information gathered from several database tables). These beans are generally used to fill the rows of a datatable and are just created from within the form class, for example in a @PostConstruct annotated method.

Similar Messages

  • How can I view as "single page continuous" in full screen mode?

    how can I view as "single page continuous" in full screen mode?
    preferences->page display:
    preference->accessbility:

    Not possible.

  • Do I need to design on just one page for a scrolling "single page design?

    Hi I want to design a single page scrolling website but I have quite a bit of content. In Adobe Muse tutorials such as this one: http://tv.adobe.com/watch/muse-feature-tour/adobe-muse-layers-panel-may-2013/ it looked like she was designing multiple pages but the preview shows it functioning as one long page. I understand how to use anchors and pins but do I have to design my whole website on one long page or am I able to design seperate pages and "stack them" if you will?

    I am not a complete expert on this, but I have been using Muse since Day 1 and I believe that you do need to create the site on a single page if you want it to scroll with pins and anchors.
    It is possible to create an anchor on a separate page, but would not have the scrolling effect that you describe. It looks more like you're just loading a second page.
    Hope this helps!

  • How can I get Preview to remember my preference for single page view?

    Does anyong know how can I get Preview to remember my preference for a single page view rather than continuos scroll?

    Hi Stop
    Works OK for mine Preference Setting for Prev.
    Cheers Tomi
    Mac Pro, Mac OS X (10.7)BC-(Win7), 8 core 8Gb Ram / Macbook Pro 2009 6G (10.7)C-(Win7) / iBook 2006 2Gb (10.7)BC(XP) /iMac 2010(SL) BC-(Win7) /iMac 2009 (SL) BC-(Win7). iMac 2006(SL) C-(XP)

  • How to scope beans for a JSF Confirmation Page

    I have a web form with corresponding backing bean for each input field. I have two buttons on the form. Here is some of the page:
    <h:inputText id="clientName" value="#{clientBean.company}" required="true"/>
    <h:inputText id="clientContact" value="#{clientBean.contact}"/>
    <h:commandButton id="btn_Submit" value="Submit" action="#clientBean.save}"/>
    <h:commandButton id="btn_Cancel" value="Cancel" immediate="true" action="cancel"/>
    Navigation rules display a confirmation page with the inputs the user has entered, and the cancel button brings them back to a simple menu screen (where they can click a link and re-visit this web form).
    IF THE MANAGED-BEAN-SCOPE for clientBean is set to REQUEST, I cannot use the bean attributes to populate outputText elements on a confirmation page (they are no longer in the current request). (I'm OK with this....)
    IF I SET THE MANAGED-BEAN-SCOPE for clientBean to SESSION, I can use the attributes of the managed-bean to drive the confirmation page, HOWEVER... if the user fills in the form and clicks CANCEL, then re-visits the web form, the values they entered prior to clicking Cancel are pre-populated in the web form.
    I've even gone as far as to have the Cancel button fire a cancel() method on the clientBean where I set all backing attributes to empty strings. That doesn't work either.
    Is there a way I can remove a managed-bean instance from the session scope entirely when the user clicks Cancel? Or is there a preferred method of ensuring that form values make it to the confirmation page using request scoped beans?

    I'd the same problem ever.
    It's not a good way to do these clear in the cancel button,
    for users maybe not click the cancel button, but click others links on the page
    and quit, after a while, then goto the form, there will be the previous data
    displayed as click back on the confirm page.
    at last i resolve the problem by adding a page before the form page.
    all links to the form page are linked to the new page,
    in the new page,
    1st, clear the state of the managed-ben(clientBean),
    there were a few ways to do this,
    (1), change all the properties of the clientbean to a default value.
    (2), remove the clientbean from the session(JSF will create an new instance when it remove from the session)
    2nd, redirect the request to the form page.
    You may write only one page (the clear-state and forword page) for all form in the application by passing the managed-bean to be cleared as a parameter.
    Hope be helpful for you.

  • How do I make a single page website that scrolls like this adobe muse site?

    Hi there, I'm working on this site: http://johanspeaks.businesscatalyst.com/index.html
    I would like a nav bar to function and scroll through the single page like this site: http://asiercarazo.com/
    I can't figure out if it's different pages, sub pages, or the same page and if it's the same page how do I get the menubar to function like that.
    Thank you for any tips!

    Hi Vinayak!
    I am using the feature that you posted (anchors and pins) for my menu bar for my single page site. Preview it here: http://alexandrabenetbusinesscatalystcom01.businesscatalyst.com/index.html
    I would like all of the words from the menu (ADVERTISING, GRAPHIC DESIGN, etc) to be with a lower opacity. When you reach a section, I would like the corresponding word to be bolder. So I'd like to add states. Is this possible?
    Also, is it possible that my menu does not appear on my first layout? And then make it appear after?
    I would appreciate the help!
    Thanks,
    Alexandra

  • Can I use grid layout in JSF visual page designer ?

    Hello dears...
    I am using Jdeveloper 11 g and 10 g .
    When I tried to use JSF visual editor (from the component palette), and when I drag any control to the page I found that the control go to the top left of the page
    and I even can not move the control to another place in the page by the mouse.
    the JSF visual designer seems to use flow layout for the page . (the same as using flow layout in the swing applications).
    The question is Can I change the page layout to be grid layout instead of flow layout ?????? (to be able to move any control to anywhere in the page.)
    Note that in netbeans 6.1 , when u design JSF page , you have 2 options for the page layout, grid layout and flow layout and u can choose as u like.
    Is this feature found in jdeveloper 11 ?????
    if not , Can anybody tell me any workaround to design JSF pages without using flow layout ????
    Thanks in advance
    Samy
    Edited by: user10653280 on Nov 29, 2008 1:30 PM

    We don't provide absolute positioning for JSF application - this is a bad practice since it fills your JSF page with CSS code and create applications that are not portable between different screen/monitor resolutions - so we use flow layout instead and provide a much richer set of layout components.
    See info here:
    http://download.oracle.com/docs/cd/E12839_01/web.1111/b31973/af_orgpage.htm#CACCBCCI

  • How do I rotate a single page in a multi-page document?

    I recently upgraded to Adobe Acrobat X version 10.0.0. Where is the option to rotate a single page in a multi-page document?
    Also, I often receive faxes as PDF's that are upside down. How do I rotate a page so that it remains rotated the next time that I open it?
    Thanks.

    GeorgeRudd wrote:
    It works (it saves the rotation) when I use the rotation method under the tools menu. Thanks.
    Yes.
    Tools > Pages > Rotate permanently rotates the pages (if you save the file afterward of course) and View>Rotate view only changes the view for the current session.

  • How do I use the single page feed on my Canon MX340?

    I am trying to figure out how to feed single pages into the Canon MX340 from the slot on the top. How to make this happen?

    Hello segurry,
    To feed documents into the automatic document feeder (ADF) of the printer, please follow the instructions below.
    Loading Documents in the ADF
    You can load documents to copy, fax, or scan in the ADF.
    Note: To scan a document at optimum quality, load it on the Platen Glass.
    Make sure that any original has been removed from the Platen Glass.
    Load a document in the ADF.
    Open the Document Tray.
    Insert the document in the Document Tray (2) until you hear a beep sound.
    Load the document WITH THE SIDE TO SCAN FACING UP in the Document Tray.
    Note: When you set the alarm to be silent in Device user settings of Device settings, the alarm will not beep even if the document is inserted in the Document Tray.
    Adjust the Document Guides (3) to match the width of the document.
    Do not slide the Document Guides too hard. The document may not be fed properly.
    Hope this helps!
    This didn't answer your question or issue? Find more help at Contact Us.
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • How can i exchange for the new design

    Last year my sister purchased a ipod shuffle 3rd gen, for my 10 yr old daughter. She bought it from Target and spent $145.00 at that time. Shortly there after i became aware apple had replace this 3rd gen shuffle with a new design. One that is more user friendly, especially for my 10 yr old. I have to say we have been very disappoint with her ipod for several reasons.
    1. there is no face so you cant see what your doing
    2. you must memorize the amount of clicks in order to operate it.
    3. we have only been able to upload new music to her ipod once since she got it a year ago. Even with online tech support,reading online forums,owner manuals, help from family and friends. To no avail.
    She has it still in the box neatly packed away. Its used as a show piece on her dresser to show that she has an (ipod). Neadless to say she does not use it,does not  like it mainly because there is no display panel which make it very difficult for her to function.
    So how can i exchange/replace the old design ipod shuffle generation 3  for the new design.

    Try disabling your firewall and try again.

  • CSS Flexbox - a new layout method for web pages

    Hi,
    As you may all know, css flexbox is a new layout method for laying out your web page, and with Firefox releasing version 22 within the next few days, (should have been yesterday) it is now no longer hidden behind browser settings. Add to this the fact that all desktop browser except IE10 and Safari 5 & 6, no longer require the use of a vendor prefix, and that http://html5please.com/ simply say ’USE’, flexbox is now finally a viable layout alternative, especially for responsive layouts.
    Flexbox has been available on all Android and iOS devices, (and any device using the webkit engine, e.g. new blackberry’s and Kindle Fire devices) since they were first release.
    To help find problems, and provide help in using flexbox, we would be grateful if you would experiment and provide feedback in the use of flexbox for layouts.
    To help you get started a video tutorial, (with files to download) and examples of layouts, (more to be added next week) and tips & tricks to help with some of the more common problems have been provided at http://flexboxlayouts.com/. This site will also be updated to provide you with a list of problems and hopefully the solutions to those problems, so that you will have a ’one stop’ reference site for using flexbox.
    If you have any tips in using flexbox, or a flexbox layout that you would like added to the site, then you can use the ’Submit’ email address on the http://flexboxlayouts.com/ site.
    For more info on the css flexbox specifications see -
    http://www.w3.org/TR/2012/CR-css3-flexbox-20120918/
    or if you just want to know what property is supported by which browser/device -
    http://flexboxlayouts.com/pdfs/flexbox%20browser%20Properties%20.pdf
    Note to regular contributors & moderators:
    As I only have time to visit and help in the forum for a few hours per week, should you find any flexbox problems unanswered then please let me know via email.
    PZ

    Hi Al
    Yes I know, and this is why I am asking people to experiment with flexbox.
    The fix for IE10 is to give the right hand sidebar, (or the content) a larger flex-grow property, the bug is caused by the flex shorthand property not recognizing % values, and using the flex-basis as a set width instead of a preferred size.
    I have logged the bug, (and many others) with the various browser bug bases.
    This and other bugs, do have 'fixes', so I hope users will experiment with flexbox and provide feedback.
    Flexbox is no different than any other css feature, "we can only find the problems in actual use".
    Strangely enough, I have found the most consistent to use is the old 2009 implementation on mobile devices, (no doubt iOS7 will change all that ).
    PZ

  • How do I save a single page from a PDF file?

    I am trying to save as a pdf file, a single page from an existing PDF file that has 4 pages. How do I do that?

    In Acrobat: Tools - Pages - Extract.
    In the free Reader: Not possible.

  • How to get pageid for a page

    Does anybody know how to determine the pageid for a page in portal, given the name for that page (i.e., in which table(s) does oracle store the information required to do this mapping)?
    I am trying to use mod_rewrite to translate /foo/a_sample_page to /portal/page?_pageid=63,34033&_dad=portal&_schema=PORTAL, but I do not know how to get the pageid for the page given the name.
    The reason I'm not letting modplsql take care of this, via a direct access url, is that i don't want a redirect to occur, and there seems to be no way to turn off redirection unless I do all the mod_rewrite stuff myself.
    thanks for any help...
    -c.

    Hi thank Q for the guidance but it seem that i having error when i tried this sql
    INTO l_siteid, l_id
    ERROR at line 2:
    ORA-00905: missing keywor
    My Sql sattement as follow:
    SELECT siteid, id
    INTO l_siteid, l_id
    FROM portal.wwpob_page$
    WHERE name = 'MONITORING';
    The 3 page id is it referring to TAB>? can i get the tab name or the tab page name?
    Because i am dispplaying my top pages but it seems that
    my chart has repeated page name because i only uses first 2 number .... while my logging alotof them have 3 numbers

  • How to add totals for each page in main window

    hi
      i have problem in scripts
      how to add total in first page ending and carry it to second page , at the end of second page again adding total and so on until last page.
    very urgent
    regards
    ratna

    Hi,
    Check these
    http://help.sap.com/saphelp_40b/helpdata/en/d1/8035c3454211d189710000e8322d00/content.htm
    http://membres.lycos.fr/jolyeric/SAP/Note_de_Cours_Ben/Sapscript/SAPscript_Control_Commands.doc
    try to use the command 'summing' along with one text symbol .Keep the if condtion when page changes at that time u dispay the total as ur keeping the total in text symbol it can be dispayed in the next page
    or this is round about way
    loop at <table>.
    call write_form.
    endloop.
    here u declare a variable 'c' and increment it by 1 in each loop. Then u chgeck if the program has started printing second page then u can print the number of records before printing the next page.
    eg :
    data : c type c value '0'.
    loop at <table>.
    c = c + 1.
    call write_form.
    endloop.
    in form:
    check when the next page is being printed, then u can print the number
    of lines 'c'.
    Feel free to revert back.
    --Ragu

  • Single page design - how to load images onto page

    Hello,
    Take a look at the site http://www.blacktie.es/ I'm trying to learn how they load the larger images onto the page.
    When you click on the button — the website loads the large project images above — how is this being done. Is this being done with PHP? Can someone point me in the right direction?
    </div>
    <section id="sec_project">
    <div class="project_wrap" id="pro_container">
    </div>

    Ejetty wrote:
    Thanks... but the thing the http:// link does not change when you click/hover on the thumbnail in this example.
    Which example?   When you are directed to a particular solution, don't ever expect the solution to work out of the box.  You need to modify or even adapt it to suit your own circumstances.  There is no such thing as silver bullet when it comes to web design solutions.
    I don't understand your question so I have nothing to add here.
    Good luck.

Maybe you are looking for

  • To Apple engineers: Home sharing and wifi sync not working after fresh install

    Have been using wifi sync and home sharing on my Macbook 5,1 since its early debut. Since Macbook 5,1 is old i am using it to stream MP4 files to my Apple TV. The functionality has been working fine throughout the OSX iterations; then came Mavericks.

  • Chrome stopped working after upgrading to IOS 6

    I updated my iPad 3 to IOS 6 and Google Chrome disappeared.  I downloaded the updated version and can select it for sync in iTunes,  the graphic shows the icon being placed on panel like any other app, but whe the sync is done, the icon is not there.

  • Oracle 8i - select between to date ranges, but exculde time ranges

    Hi, I'm using Oracle 8i I'm trying to select a set of records that are between a certain date time (say between October 15 at 6pm and October 17 at 6am) and then want to include only those records that fall between 6am and 6pm within the range. I've

  • If my ipod locked for 22,047,982 minutes all by itself how do i fix it?

    How do I fix my ipod touch if it locked itself for 22,047,982 minutes? It died and when i turned it on it said ipod is disabled for ever so many minutes... Its been like this for about two weeks and i really need it this weekend!!                   T

  • Logoff Link go to 2 different URLs

    Hi Portal Knowledgeable Ones, I am running EP 6.0 SP13.  For portal authentication, we use IBM's IDM infrastructure. Our portal is used by internal users (intranet) and external users (internet).  For internal users, portal authentication is performe