Data binding and screen communication

It seems to me that the "backing bean" concept for a view is becoming the common way to implement JSF pages. I just wanted to get some feedback on something I was thinking about concerning the data that the components bind to and communication between screens. I think there are two options:
1) Create a "ViewDataBean" more or less a "sister-bean" to the backing bean, and is stored in session scope. All of the components in the backing bean are bound to the data in the ViewDataBean. That ViewDataBean would also be used to communicate from one screen to the other (binding related pages to the ViewDataBean attributes).
2) Eliminate the "ViewDataBean" and put the actual data in the backing bean itself, binding the components in the backing bean to the data. Communication between screens would then be done by binding components in one backing bean to the data in a different backing bean. This means that all backing beans would be in session scope and I would need to figure out a way to clean them up. Other than that I think this would be a good solution.
I asked this same question during the "Q&A" portion of the "Meet the JSF Expert group", and didn't get a lot of feedback. What do you guys think of this?
Dave

I beleive Adam Winer just said there are some problems in using session beans.
That why many experts will say: "keep session storage to a reasonable minimum."
Inside "blueprints solutions" you can find rules:
Request scope
Information in this scope is created some time after the request is received and is disposed of some time before the response is complete. It is a good practice to have the backing beans for pages be in the request scope where possible, and maintain separate beans that store only the information that will not need to be continually passed between the client and server.
The following types of information are good candidates for storing in the request scope:
Value bindings (e.g. <h:inputText value="#{MyBean.lastName}" /> should always be stored in request scope since they are automatically restored on every request.
Component bindings (e.g. <h:inputText binding="#{MyBean.lastNameComponent}" />) should always be stored in request scope since their value is no longer valid after a request has been processed anyway. The component tree is reconstituted during each incoming request, changing the physical instances these component bindings will point to.
References to database resources such as connections, statements, and result sets should be properly closed and discarded before a request is complete (see the section on resource management below for details).<>
<>Caches of database query results - see section on caching database query results for details.
<>Temporary results of calculations used for rendering the current view.
Session scope
Information in this scope is created some time after the current user's first request is received and is disposed of after a configurable period of inactivity (i.e. when a request has not been received in a certain period of time), or when a session is explicitly invalidated by the application. It is also disposed of when the application is undeployed. Depending on the robustness of the application server, it may also be disposed of when the application server is shut down or crashes.
The following types of information are good candidates for storing in the session scope:
Navigational context, for example the album the user is currently editing in a music catalog application. This type of information could potentially be carefully passed back and forth via hidden input fields, but this is error prone and can be difficult to manage together with form validation and when forms are shared between different parts of an application.
Information that is specific to this session, but temporary, such as short-lived shopping carts. The information can be made persistent by also updating a database table. The recommended way to do this is via entity EJBs, but this can be done by manually coding database-aware JavaBeans as well.
Security sensitive information that should not be continuously sent back and forth between the client and server.
Caches of database query results - see section on caching database query results for details.
Application scope
Information in this scope is created some time after the application starts and is discarded some time before the application is undeployed. Depending on the robustness of the application server, it may also be disposed of when the application server is shut down or crashes.
The following types of information are good candidates for storing in the application scope:
Information that transcends particular users or sessions, such as application settings.
Caches of database query results - see section on caching database query results for detai
I'm sure we just have to make real JSF application, not some kind of jsp or html pages.
Rules for creating real JSF application:
1) using only native JSF navigation
2) using only JSF tags
3) easy way to exchange information between beans
(probably suggestion Adam Winer about input and output parameters for action is good idea in this direction)
4) using only good jsf components
In good JSF application using session scope can't be problem at all.

Similar Messages

  • IPod nano 5 date & time and screen problems.

    My iPod nano 5th gen. The screen has white lines going from side to side. And more and more keep appearing. Also when I go to change the date and time setting it keeps shutting off and restarting. I've tried to do a hard reset and it didnt work. Someone please help !!!!!!!!!

    I have sorted out the playing problems.
    However it's still not showing battery is charging either through usb or mains charger - although I can play music - but cannot switch nano off.  Any advice appreciated

  • UIX with XSQL as XML data provider and event handler

    Hello ,
    I would like to bind XML data to messageinput elements of a form element
    as values to be presented before entering (data provider)
    as well as input values to be persisted after completing the form (event handler).
    My impression (as a newbee) is that only for BC4J integration there is a bidirectional binding with view objects.
    Can i use 'include' to bind a static xml file as data source for output?
    How can i use XSQL to be bound as data for input as well as for output of a form?
    A last question concerning a page with 3 tabs:
    do i need 3 different pages and requests to get the data of the 3 tabs
    or is it possible to get the whole data of the page in one request
    and distribute it over the 3 tabs.
    Any help appreciated
    Thanks
    Klaus Dreistadt

    You could do this, but we don't provide any tools to make this easy.
    You'd have to write an implement of the DataObject interface
    that gives your UI access to the XML document, and write custom
    event handlers to perform the "set" side of things. The Data Binding
    and UIX Controller chapters of the UIX developer's guide will give you
    a high-level view of how to accomplish this, but nothing specifically
    about reading or writing to XML documents.

  • How to handle html:multibox in jsp with ADF Data Binding

    Hi,
    I like to use html:multibox feature in my jsp with ADF Data Binding. I am able to retrieve checked values in the DataForwardAction form. However, when the page is refreshed, the checkboxes are not persistent and yet an error showing
    "JBO-25009: unable to create object type ....oracle.jbo.domain.Array" appears.
    Here is my jsp code:
    <c:forEach var="type" items="${bindings.SystemTypeView1.rangeSet}">
    <c:if test="${Row['SystemGroup'] == type['SystemGroup']}">
    <br>
    <html:multibox property="selectedSystemType">
    <c:out value="${type.SystemType}"/>
    </html:multibox>
    <c:out value="${type.TypeDesc}"/>
    </c:if>
    </c:forEach>
    Can anyone tell me how to handle html:multibox with ADF Data Binding and make the checkboxes persistent.

    Generally this can be done.
    I see a problem with your use case, which has nothing to do with jdev or java:
    How do you identify the user when he comes back to finish the form?
    For this you can't use information like session cookie or IP address because they change.
    So you have to save some information about the user which lets you identify him when he comes back. All other requirements can be implemented by ADF.
    Timo

  • How we will implement SAPUI5 Routing ? Provide Example with DataModel and Screen Shots

    Hi,
          I am working on Routing and have seen one example in Blog : SAPUI5 & Netweaver Gateway CodeJam Antwerp 
    which is good, but there is no clarity on data model and screen shots of the functionality.
    As i am working this Routing on high priority, Can you please provide example with all the details?
    Thanks,
    seshu

    I would say that that SAPUI5 & Netweaver Gateway CodeJam Antwerp is enough to understand how SAPUI5 Routing is working, to see functionality just copy/paste the code to correct place.
    Another option to see SAPUI5 routing functionality is to check SAPUI5 demokit 'sap.m.SplitApp' Demo Application
    when you select item from the menu, you can see that actually url is changed
    https://sapui5.netweaver.ondemand.com/sdk/test-resources/sap/m/demokit/splitapp/index.html#/mail/item1
    Please feel free to check the source of SplitApp.

  • Is there a Difference between Binding and Mapping

    Hello together,
    in SAP NetWeaver Library they speak about Data Binding and Mapping
    http://help.sap.com/saphelp_nw70/helpdata/en/77/3545415ea6f523e10000000a155106/frameset.htm
    Is Binding and Mapping the same thing? Or is there any difference?
    Am I right in thinking binding works the following way:
    There´s Context-Element NAME into the Component-Controller-Context,
    a Context-Element NAME into the View-Controller-Context and one UI-Element on my View-Layout.
    In the next step, I bind View-Controller-Context-Element NAME against the Element in the Component-Controller-Context, and the UI-Element against the element into the view controller.
    While runtime, the Context-Element of the Component-Controller-Context gets created.
    Is it right, that because of the binding, all involved Controller-Contexts work on the same reference of the
    data-object, which is behind Context-Element NAME?
    Thank you very much.
    With regards,
    Oliver

    Hi,
    Both are different,binding is between view UI element and view context node/attribute.Mapping is between two controlleres like view controller and component controller.The detailed information is given in the below article about context.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/60730016-dbba-2a10-8f96-9754a865b814
    also check this document about different contrlleres in Web Dynpro for ABAP
    http://help.sap.com/SAPHELP_NW04S/helpdata/EN/b9/b82c4142aef623e10000000a155106/content.htm

  • When i click the listview items I have to call two odata webservice and pass that data to next screen ?

    Hi All,
                I Have two odata webservices When i click the listview items I have to call that two odata webservice and pass that data to next screen ?

    You don't have to pass the data to any page.
    onInit method of controller set your oData model like this.
                  onInit: function() {
                  //var oModel = sap.ui.model.json.JSONModel();
                  var oModel = sap.ui.model.json.JSONModel("http://services.odata.org/V3/Northwind/Northwind.svc/Customers?$format=json");
                  sap.ui.getCore().setModel(oModel,"oDataId");
    After this you can access your model from any views by just binding the elements with your odata. Suppose i have a table in a view of my application then i can write like this.
                  var oTable = sap.ui.table.Table({
                         tableId: "myTable",
                         visibleRowCount: 5,
                         editable: false
                  oControl = new sap.ui.commons.TextView({text: "{CustomerID}"});
                  oTable.addColumn(
                               new sap.ui.table.Column({                             
                               label: new sap.ui.commons.Label({text: "Customer ID"}),
                               visible:true,
                               template: oControl  
                  oControl = new sap.ui.commons.TextView({text: "{ContactName}"});
                  oTable.addColumn(
                               new sap.ui.table.Column({                             
                               label: new sap.ui.commons.Label({text: "Contact Name"}),
                               visible:true,
                               template: oControl  
                  oControl = new sap.ui.commons.TextView({text: "{ContactTitle}"});
                  oTable.addColumn(
                               new sap.ui.table.Column({                             
                               label: new sap.ui.commons.Label({text: "Contact Title"}),
                               visible:true,
                               template: oControl  
                  oControl = new sap.ui.commons.TextView({text: "{CompanyName}"});
                  oTable.addColumn(
                               new sap.ui.table.Column({                             
                               label: new sap.ui.commons.Label({text: "Company Name"}),
                               visible:true,
                               template: oControl  
                  oTable.bindRows("oDataId>/value");
    Here you can see i have binded the oData with table.
    Just what i am seeing that you are trying to pass this model to a page. You don't have to do so. Just bind your oData with relevant elements lite table or anything by writing like this.
    oTable.bindRows("oDataId>/value");
    these functions are different for different elements.
    for listItem you may write like this.
                  var oList = new sap.m.List({
                  inset: true,
                  items : [
                                        new sap.m.DisplayListItem({ label :"Category ID", value : "{oDataId>/CategoryID}"}),
    {oDataId>/CategoryID} this has been used for binding.
    Regards
    Dhananjay

  • Context Mapping and data binding

    Hi,
    Please explain about the context mapping and data dinding
    and also differences
    Thank's & Regard's.
    Sri

    Hi Sridevi Sudunaguntla ,
    context mapping-> means mapping between different contexts
    ie suppose if we are creating a node in the component controllet and if we want to use that node in view a and view b, then  we have to map this node from component controller to the required view.. this mapping of context nodes is called context mapping..for context mapping, create nodes in compcontroller.. tehn go to view-> context-> tehn drag and drop required node from component controller to the view ..
    data binding-> means binding the data from nopde to the ui elements or viceversa... after the nodes are created in indudual views or after context mapping.. we have to bind these nodes to the ui elements... suppose we have an input field and we want to read that,, so we have to bind the input field to an attribute in the node.. this binding is called.. data binding.
    Regards
    Sarath

  • How to bind dynamic row data to submit it by HTTP submit (PHP) - addInstance and Data Binding

    Hi,
    i have got a problem with submit HTTP all data (variables) from PDF to submit.php.
    I have got table with dynamic add/remove Table Row button. When i add it their names are Table.Row[0] , Table.Row[1], Table.Row[2] etc. Only Table.Row is real, and every other row is create dynamically by addInstance script command.
    When i fill "Data Binding" box like this: "Use name(Row)" then after submiting it do PHP i will see only last Table.Row data. For example if last would be Table.Row[3] then i will see only this on my submit.php and the others will be replaced by this value. This is happen becouse of replacing value by value with the same name (data binding is seeing only one Table.Row without instance name:"[1]", "[2]", "[3]" etc.).
    I guess that if i would change something to get addInstance command with Row names like Row1, Row2, Row3 then all will be ok.
    Another way it`s to change something in the "Data Binding" box (Object > Binding Tab) to get relative name like Row[*] instead of "Use name(Row)".
    I don`t know how to solve it and i need your help

    Create a binding for your dataTable.
    In the binding create a UIData element with gettters and setters.
    You can manipulate rows and columns from it.

  • Data Binding using DataSet and ComboBox

    Hi guys, hope someone can help me with this. Seems it should
    be simple, but it's not, that's why I'm here. I have data loading
    into a DataSet component. I have a ComboBox on the stage with
    predefined values and lables, so it's not dynamic at all. After
    loads into the DataSet I have the value Bound to the the Combobox,
    but nothing is being selected. I know the ComboBox is a little bit
    trickier, unlike the Textfield or TextInput wich work right away.
    Again, hope someone can help.

    Hi,
    I think the data binding concept you asked for Dropdown listboxes and RadioButtonGroups .If My Guess Correct follow the links provided here you may get useful information,
    [http://help.sap.com/SAPHELP_NW70EHP1/helpdata/EN/bb/69b441b0133531e10000000a155106/content.htm]
    for Example refer this link,
    [http://help.sap.com/saphelp_nw04/helpdata/en/74/450e8af57065468e88e4b86de47e4b/frameset.htm]
    Hope This information Useful for you.
    Regards,
    Raghava Channooru.

  • Data binding - Arraycollection and Datasource

    Hi All
    1. Can any one paste a snippet of .MXML code and relevant WDA code (get_Attributes) for an ArrayCollection(Flex) and Datasource(WDA) data binding ?
    2. What is the procedure to set default values for the flex components at application initialisation. Already tried setting the relevant attributes in the WDODOINIT methods of  View and Componenet controller.  Also tried raising an event just after the FlashIsland.Register (this) delcaration in MXML but the event is not fired however subsequent events raised based on user clicks are raised properly. Any pointers as to what is being missed ?
    Thanks in advance
    ksQ

    Hi All
    1. Can any one paste a snippet of .MXML code and relevant WDA code (get_Attributes) for an ArrayCollection(Flex) and Datasource(WDA) data binding ?
    2. What is the procedure to set default values for the flex components at application initialisation. Already tried setting the relevant attributes in the WDODOINIT methods of  View and Componenet controller.  Also tried raising an event just after the FlashIsland.Register (this) delcaration in MXML but the event is not fired however subsequent events raised based on user clicks are raised properly. Any pointers as to what is being missed ?
    Thanks in advance
    ksQ

  • Xcontrols and Data Binding

    Hi
    Is it possible to bind specific controls in a Xcontrol to e.g. a Shared Variable programmatically? I have tried using the Bind to Network Path method, but I only manage to bind the Xcontrol it self. When I try to bind a controller inside the Xcontrol, nothing happens. I have tried applying the method in both Init.vi and under Exec State Change in Facade.vi.
    Regards gelmin
    Message Edited by gelmin on 03-06-2007 11:46 AM

    Hi Nick_CH.
    Thank you for your reply. I have actually looked at this example, but unfortunately it doesn't help me as I want to bind the control inside the Xcontrol, and not the Xcontrol it self. The reason why I'm looking in to this is that I need a way to dynamically both read and write several shared variables inside a Xcontrol. With data binding of controls I could sort of do something like this.
    The most obvious way to achieve this though is to use Datasocket, but I'm afraid this will affect performance as I will have a lot of variables to manage. I have read somewhere that one should only use Datasocket when dealing with less than 30 variables or so. Are there some clever way to dynamically read/write Shared Variables whit out loss of performance?
    Best regards gelmin

  • How to find and replacing the path (url) given for data binding from type 'datasocket'

    Hi everyone,
    I'm sorry to pose this question as my own knowledge is still very limited.
    I have an assignment (bachelor level). We were asked to adjust a plc program in step7 so that multiple of an existing sequence could be run indepently.
    The settings for that sequence are controlled by labview. Sensor data is also viewed in labview.
    There is an existing labview VI that was made by someone else before us. It uses 'Datasocket' type for data binding. Because we would like to adjust this VI to be used with the other sequences, we would like to change the original path or URL quickly, as in a 'Find&Replace' solution. Yet the find and replace only works for objects or text, not entries in the properties.
    Can someone please tell me if there is a way to do is, without having to use shared variables, as we are not at all known with this type.
    Many thanks,
    Niels

    Dear Niels,
    Please find the attached example. I placed 5 controls on the front panel, all with a data socket URL (control 1 = URL1, control 2 = URL2 etc). Through property nodes I did the following;
    - I got a reference to the front panel
    - with this reference we can get an array of references to the controls on this front panel
    - one by one we will read the references and check the data socket URL from the control, we compare this with the URL we are searching
    - if found, stop we will use the reference to write a new URL to the control.
    Please notice the default values of the controls; it is set to search for URL3 and replace this with URL10, run the VI once and you will see that happening. I also included a sting indicator which will show you the label of the control which we find. Also a Boolean indicator in case we were not able to find the URL.
    I downsaved the VI to 8.6, I'm not sure in which version you are working, if you have 8.6 or higher you are able to open it. Hope this brings you further,
    Best regards,
    Martijn S
    Applications Engineer
    NI Netherlands
    Attachments:
    findURLexample.vi ‏12 KB

  • How can I set screen saver clock which show time and date when all screen is black. Other phones have this option but I didn't find on iphone. Pl guide.

    How can I set screen saver clock which show time and date when all screen is black. Other phones have this option but I didn't find on iphone. Pl guide.

    HA!  I figured the find my iphone out!!!!! You can have more than one icloud account in "Mail, Contacts and Calendars".  So my husband's & kids' phone icloud account under "settings, icloud "is their individual @me.com account.  Set it to everything you want EXCEPT Find My Iphone.  Then under "settings, mail/contacts/calendars" you set up both accounts (your @me.com which may already be there), then add another with the main appleID and enable ONLY Find My Iphone.  Now when any of us log into Find My Iphone from any device with our main apple ID for the app store, all the devices show up!!!! YIPPEE.  I made my own day!
    I think the message I got previously was because I hadn't disabled the find my iphone on the @me.com account first.

  • Removing time and date from lock screen

    how do i remove time and date from lock screen?

    LarryE wrote:
    As noted in the title, I would like to know if it is possible to remove the Time, Day and Date from my custom Lock Screen?  Is it possible or not? 
    Not a feature of Windows Phone OS, you can only change wallpaper, show artist when playing music or have password request upon lockscreen.
    Happy to have helped forum with a Support Ratio = 42.5

Maybe you are looking for

  • IDvd on MacBook pro

    I have a Mac Book pro that I purchased August of 2011 running 10.7.3 and I can't find iDVD. Anyone else have this problem?

  • FIFA 13

    I have macbook pro 13 mid 2012. Intel hd4000 graphics. 4gb ram what best game settings can i use to play fifa 13 smoothly on my mac.?

  • Can anybody help....SQL to display row as column and column as rows

    Can anybody help in writing a SQL to display row as column and column as rows? Thanks

  • Skip when shuffling not working

    I have all the songs in one playlist marked "Skip when shuffling" but they play anyway, no matter how many times I un-do and re-do it then re-sync my iPod.

  • 6602 more than one channel

    "i cant choose more than one channel on the daq assistent vi to measure. how is it possible to measure more channels? my other measures in this vi are done with the traditional daq. i would like to do this with the 6602 too. please give me an easy vi