Dynamic layout of data

Hi,
I'm new to JSF, and would like to ask how to model my web interface, so it would meet the next challenge:
Imagine I have some very complex entities in my model, with lots of fields and relations. Now, I write a page that contains every bit of data to be read & submitted. How do I go about writing a framework for this in such a way so that if the web designer (who just knows how to write JSP & HTML) can split this page into several pages to his liking, without requiring the intervention of a developer.
The basic approach I'm thinking about is:
* Giving the designer an API for requesting whatever data he needs (i.e., something like 'get me entity A') - how do i do that in JSF? obviously, there should be some server side code for getting the entity, but how can I model the JSP api so that it will remain the same whatever API the server offers (so that i wouldn't need to, e.g., write new tags).
* Writing one monolithic action listener that will listen to whatever data is submitted and will know what entities to update. obviously, there should be some API to the submission, such as the ids of the entities to update. A more subtle point is that since not all pages will contain all fields, the action listener needs to somehow know what fields are in the submitted page (so that if, for example, a boolean (=checkbox) property isn't submitted, it is because it is not there and not because it is false (unchecked)).
Thanx,
Ittay

It's hard to answer such a general question without more detail, but here are some points:
Imagine I have some very complex entities in my model,
with lots of fields and relations. Now, I write a page
that contains every bit of data to be read &
submitted. How do I go about writing a framework for
this in such a way so that if the web designer (who
just knows how to write JSP & HTML) can split this
page into several pages to his liking, without
requiring the intervention of a developer.
The basic approach I'm thinking about is:
* Giving the designer an API for requesting whatever
data he needs (i.e., something like 'get me entity A')
- how do i do that in JSF? obviously, there should be
some server side code for getting the entity, but how
can I model the JSP api so that it will remain the
same whatever API the server offers (so that i
wouldn't need to, e.g., write new tags).JSF components are bound to bean properties, so the "get me entity A" method you're talking about would be a bean property getter method, e.g., getEntityA() bound to a component with through a value binding expression like "${myBean.entityA}". You can have as many beans as you like, typically one per logical set of data, all bound to by components in the same or multiple pages.
* Writing one monolithic action listener that will
listen to whatever data is submitted and will know
what entities to update. obviously, there should be
some API to the submission, such as the ids of the
entities to update. A more subtle point is that since
not all pages will contain all fields, the action
listener needs to somehow know what fields are in the
submitted page (so that if, for example, a boolean
(=checkbox) property isn't submitted, it is because it
is not there and not because it is false (unchecked)).JSF updates the properties the components are bound to, so unless I'm missing something, just make sure you define setter methods for the bean properties you bind to, e.g., setEntityA(String value). An event handler (e.g., an action method) bound to command button can then get all data saved in th beans and do whatever you want with it, e.g., save it in a database or use it to process an order.
I suggest you browser through the spec and the tutorial to get a feel for what JSF is and how it works. The sample chapters for my book may also help you get the Big Picture:
http://www.oreilly.com/catalog/jsvrfaces/chapter/

Similar Messages

  • Dynamic layout elements determination logic for output of Pro-Forma Invoice

    This is my requirement below. Please give the suggestion    
    Business requires output to be generated in name of the client, with client logo and scenario specific data elements. To do this in Standard SAP will require to define hundreds and hundreds of layouts. By making most of the client/scenario elements on the layout we can greatly reduce the number of required layouts and reduce implementatuion effort and lead-time.
         The goal is to define a generic table that will hold most of the dynamic layout elements for different document types and countries, including logo, sender address etc.
          For this we will create Z-versions of the output types BA00 ( Order Confirmation, ZPRI (Pro-Forma Invoice) and RD00 (ZD00 Invoice).The layout text blocks will be permanently fixed.The print Program user-exit should call the Z-table that holds the dynamic layout elements and retrieve these elements and merge them with the matching layout text block.
    Message was edited by: janardhan b

    Hi Janardhan,
       Even I have faced the similar situation.but what we have done is instead of calling the dynamic text elements..Why don't we call the text elements based on the required condition ,Then u dont have to maintain all the text elements required in the table.In the table we can only have the doumnent type,client name,logo name and address.
    In the print program if u r using script layout then call the required text elements (write_text) based on the client name and document type that is fetched from the Z-table,Otherwise if u r going for smartforms then with in the layout give the condition under the conditions node of the window or the text.

  • Webdynpro Dynamic layout manipulation: error attaching elements to Group

    Hi Experts,
    I am trying to create dynamic layout during run time. Itu2019s working partially, but as soon as I add new u201CGroup elementu201D or new u201CTransparent elementu201D I am getting a null error. If I just use buttons, input field or text dynamically layout create it works fine. I want to group this fields in a groups or transparent container so that I can manipulate layout place containers where I need. As soon as I add other element (inputfield/button/text) to transparent element it errors. I have attached code below for more detail. Does anyone have similar issue? Lot of demo and example code show how to create elements (inputfield/button/text) none show how attach those element back to u201DGroupu201D or u201CTransparentu201D element.
    I am creating dynamic elements in u201CViewu201D method u201CWDDOMODIFYVIEWu201D. Any idea or clue much appreciated. Thanks in advance.
    Kind Regards,
    Trim
    method WDDOMODIFYVIEW .
      DATA lr_container  TYPE REF TO cl_wd_uielement_container.
      DATA lr_trans_cont TYPE REF TO CL_WD_TRANSPARENT_CONTAINER.
      DATA lr_input      TYPE REF TO cl_wd_input_field.
      DATA lr_table      TYPE REF TO cl_wd_table.
      DATA lo_nd_sflight TYPE REF TO if_wd_context_node.
      DATA lr_button     TYPE REF TO cl_wd_button.
      DATA lr_o_group     TYPE REF TO cl_wd_group.
      data: lr_text TYPE REF TO CL_WD_TEXT_VIEW.
      constants : gc_trs_cont type string value 'Trscont',
                  gc_text1 type string value 'ePDA goals and activity of the team',
                  gc_text2 type string value 'Complete all box and submit to manager'.
      DATA lo_el_context TYPE ref to if_wd_context_element.
    navigate from <CONTEXT> to <SFLIGHT> via lead selection
      lo_nd_sflight = wd_context->get_child_node( name = wd_this->wdctx_sflight ).
      IF first_time = abap_true.
        lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
        DATA lr_grid_data TYPE REF TO cl_wd_grid_data.
        DATA lr_flow_data TYPE REF TO cl_wd_flow_data.
        DATA lr_matrix    TYPE REF TO cl_wd_matrix_head_data.
        DATA lr_matrix_l    TYPE REF TO cl_wd_matrix_layout.
        DATA lr_matrix2    TYPE REF TO cl_wd_matrix_data.
       CALL METHOD CL_WD_TRANSPARENT_CONTAINER=>NEW_TRANSPARENT_CONTAINER
         EXPORTING
           ID      = '/0CUST/123'
           VIEW    = view
           WIDTH   = '100%'
         RECEIVING
           CONTROL = lr_trans_cont.
       lr_matrix = cl_wd_matrix_head_data=>new_matrix_head_data( lr_trans_cont ).
       lr_container->set_layout_data( lr_matrix ).
        data: lr_o_caption type ref to cl_wd_caption.
        CALL METHOD CL_WD_GROUP=>NEW_GROUP
          EXPORTING
            ID      = 'GRP1'
            design  = '03'
          RECEIVING
            CONTROL = lr_o_group.
       lr_o_caption = cl_wd_caption=>new_caption( text = 'Group1' ).
       lr_o_group->set_header( the_header = lr_o_caption ).
       cl_wd_flow_data=>new_flow_data( element = lr_o_group ).
       cl_wd_flow_layout=>new_flow_layout( container = lr_o_group ).
        lr_matrix = cl_wd_matrix_head_data=>new_matrix_head_data( lr_o_group ).
        lr_o_group->set_layout_data( lr_matrix ).
        CALL METHOD lr_container->add_child
          EXPORTING
            index     = 1
            the_child = lr_o_group.
        CALL METHOD cl_wd_button=>new_button
          EXPORTING
            enabled   = 'X'
            id        = 'B1'
            on_action = 'GET_FLIGHT'
            text      = 'Get Flight Data'
          RECEIVING
            control   = lr_button.
        lr_matrix2 = cl_wd_matrix_data=>new_matrix_data( lr_button ).
        lr_button->set_layout_data( lr_matrix2 ).
        CALL METHOD lr_o_group->add_child
          EXPORTING
           index     = 1
            the_child = lr_button.
        CALL METHOD cl_wd_input_field=>new_input_field
          EXPORTING
            bind_value = 'SFLIGHT.CARRID'
            id         = 'INPUT1'
          RECEIVING
            control    = lr_input.
        lr_matrix2 = cl_wd_matrix_data=>new_matrix_data( lr_input ).
       lr_input->set_layout_data( lr_matrix2 ).
        CALL METHOD lr_o_group->add_child
          EXPORTING
           index     = 2
            the_child = lr_input.
    endmethod.
    Edited by: Trim Chakrapani on Nov 15, 2011 5:01 PM

    Hi
    I suggest you  create a transparent container at design time and then use the below code in wddomodify to get a reference to the transparent container.
      DATA: lv_container TYPE string,
                  lo_container TYPE REF TO cl_wd_transparent_container.
            lv_container = 'TransparentContainer'.
            lo_container ?= view->get_element( lv_container ).
            lo_container->add_child( lo_button ).
    Hope this helps.

  • Dynamic layout

    How do you dynamically add layout to a group/transparent container. Set it to something like Gridlayout with col values etc.

    Hi Deepak,
    U can create UI elements dynamically.For designing layout dynamically use the dynamic layout manipulation correctly, you must understand the structure of a view:
    In a view, a number of UI elements is laid out in relation to one another. This is done in so-called containers. To describe it, a layout is selected for every container: FlowLayout, MatrixLayout, or RowLayout exist (see reference documentation, chapter Layout).
    Every UI element has layout data, in accordance with the embedding container. This layout data contains the description, at which position in the layout of the container an embedded UI element has its place.
    Hope this helps u,
    Regards,
    Nagarajan.

  • How can we get Dynamic columns and data with RTF Templates in BI Publisher

    How can we get Dynamic columns and data with RTf Templates.
    My requirement is :
    create table xxinv_item_pei_taginfo(item_id number,
    Organization_id number,
    item varchar2(4000),
    record_type varchar2(4000),
    record_value CLOB,
    State varchar2(4000));
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'USES','fever','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'HOW TO USE','one tablet daily','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'SIDE EFFECTS','XYZ','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'DRUG INTERACTION','ABC','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'OVERDOSE','Go and see doctor','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'NOTES','Take after meal','TX');
    select * from xxinv_item_pei_taginfo;
    Item id Org Id Item Record_type Record_value State
    493991     224     1265-D30     USES     fever     TX
    493991     224     1265-D30     HOW TO USE     one tablet daily     TX
    493991     224     1265-D30     SIDE EFFECTS     XYZ     TX
    493991     224     1265-D30     DRUG INTERACTION     ABC     TX
    493991     224     1265-D30     OVERDOSE      Go and see doctor     TX
    493991     224     1265-D30     NOTES     Take after meal     TX
    Above is my data
    I have to fetch the record_type from a lookup where I can have any of the record type, sometime USES, HOW TO USE, SIDE EFFECTS and sometimes some other set of record types
    In my report I have to get these record typpes as field name dynamically whichever is available in that lookup and record values against them.
    its a BI Publisher report.
    please suggest

    if you have data in db then you can create xml with needed structure
    and so you can create bip report
    do you have errors or .... ?

  • Dynamic creation of date in selection variant

    Hi All,
    I have a Z program for updating a field in BOM item. One of the input field in the report is "Valid From Date". Actually the current date is automatically fetched through a function module and it is defaulted in that field. 
    Our client is using selection variant for ease of use. The problem here is old date in the selection variant  is replacing the current date. I want current date to be created automatically during insertion of variant also. How can i solve this problem. Is there any selection variable inside the variant for dynamic creation of Date?
    Thanks
    Sankar

    As I know there is no setting for this. For any std or Z report variant function with L should act same way...anyway you discuss with your ADABer.
    See the help for variables
    Selection Variables                                                                               
    The following three types of selection variables are currently          
        supported:                                                                               
    o   Table variables from TVARV                                          
            You should use these variables if you want to store static          
            information. TVARV variables are proposed by default.                                                                               
    o   Dynamic date calculations:                                          
            To use these variables, the corresponding selection field must have 
            type 'D' (date). If the system has to convert from type T to type D 
            when you select the selection variables, the VARIABLE NAME field is 
            no longer ready for input. Instead, you can only set values using   
            the input help.                                                     
            The system currently supports the following dynamic date            
            calculations:                                                       
            Today's date                                                        
           From beginning of the month to today                               
           Today's date +/- x days                                            
           First quarter ????                                                 
           Second quarter ????                                                
           Third quarter ????                                                 
           Fourth quarter ????                                                
           Today's date - xxx, today's date + yyy                             
           Previous month                                                                               
    o   User-specific variables                                            
           Prerequisite: The selection field must have been defined in the    
           program using the MEMORY ID pid addition. User-specific values,    
           which can be created either from the selection screen or from the  
           user maintenance transaction, are placed in the corresponding      
           selection fields when the user runs the program.                                                                               
    The SELECTION OPTIONS button is only supported for date variables that 
       fill select-options fields with single values.                         
    i.e means we can do that with D also.

  • Dynamic Text for data series ?

    Hi, is posible setting dynamic text in data series when use dynamic value ?
    We need show Actual Year value and Last Year value in Label for Series.
    Thank you.

    This is not possible unless you have enhancement pack 1 for visual composer which I think is still in rampup...
    Here is the enhancement noted in the article below.
    Taken from blog:
    Option to dynamically define element titles
    For chart views, form views, table views, HTML views, nested iViews and popup iViews (popup signal), you can now define dynamic titles using the Expression Editor. A new (ellipsis) button to the right of the field in the Configure Element task panel displays the Title Editor dialog box, in which you enter either or define a custom expression.
    /people/judy.kestecher/blog/2008/08/26/whats-new-in-visual-composer--enhancement-package-1-for-sap-netweaver-70

  • Link to Dynamic Layout Record - Task

    Hi All,
    I have added a link from our activity report in to the task record. We use the dynamic layout quite a bit with the task record, however when drill down into the record from the report, Siebel displays the standard layout instead of the actual layout.
    This nullifies the need since the screen should look totally different.
    Anyone come across this and have a solution?
    Thanks in advance.

    you don't have to worry about all that.
    just open up any activity that is read-only and copy-paste the code. Then in the Fx of the field that has values XXX or YYY, write the web-link code as the concatenation of strings and whenever you encounter the Activity ID, replace it with the fx of Activity ID and again concatenat it with the remainder of the string.
    there are many questions in this forum regarding the same issue and i bet you will get your solution here only.

  • Dynamic Variant for Date filed

    Hi All,
    I need to create a dynamic variant for date fields for standard report.
    in date Low field...value will be harcoded as '01.01.2011' and S_Date-high date field should be current date - 1.
    I dnt want to go for code in report to handle this.
    I tried with many option but could not able to see up the dates like as above.
    Kindly help.
    Piyush

    Hi,
    try this code
    data prevday like sy-datum.
    SELECT-OPTIONS s_date for sy-datum DEFAULT '20110101'   .", sy-datum-1.
    INITIALIZATION.
    AT SELECTION-SCREEN OUTPUT.
    *  S_DATE-HIGH = PREVDAY.
      prevday = sy-datum.
    s_date-high = prevday.
    modify s_date index 1.
    Hope the help
    Edited by: j.ortiz on Jan 27, 2011 3:01 PM

  • User exit for dynamic layout determination

    Hello,
      I would to know user exit name for dynamic layout determination for output type of Invoice and Order confirmation.
    My user exit should get fired when user press the print preview button in VF03/VA03.
    Regards,
    Vimal Nair

    Hi
    I dont' think you need a user exit, but you should manage that directly in print program.
    Infact you can choose which output type has to be or not to be loaded in a document by an user exit.
    But only in print program you can know if the user has choosen print or print preview.
    So check in TNAPR which print program are used for orders or invoice and change them or, if they are std program, you can copy them before changing them.
    After calling the sapscript (fm OPEN_FORM) or smartform you can know if user press printpreview by reading the structure of export (like ITCPP for example).
    Max
    Message was edited by: max bianchi

  • Setup dynamic Web Service Data Source

    Hi all,
    is there a way to setup a "dynamic" web service data source like
    WSDL-URL = 'http://${server_ip}:${server_port}/XYZService?wsdl
    and passing in the server_ip and server_port variables from outside upon document rendering?
    As far as we have seen, there is not way to do so - leaving us with a static web service data source configuration that is only able to point to one specific WSDL.
    The use case we have here goes like this:
    1) We have one specific template for a specific document to be rendered.
    2) Depending on the caller, the data source must be different, i.e. the same web service at different endpoint addresses must be called to fetch the right data.
    Any ideas?
    Thanks in advance.
    Best regards,
    Stefan

    Hi Klaus,
    thanks for your reply. We also had that idea with the router web service ;-) But a little more flexibility would be great for us due to our decentralized system landscape.
    Currently, we are in the evaluation phase of BI publisher to replace our local reports (sales documents) with BI Publisher reports having one central instance of BI Publisher and n local store instances all providing a getSalesDocument() web service.
    To be able to call the correct web service, a dynamic config of web service endpoints would be helpful.
    Best regards,
    Stefan

  • Dynamic Layouts For Call

    Hi
    Call Functionality (Account Call/ Contact Call) uses Activity object.We have dynamic layouts for Appointment and task ? Can we create dynamic layouts for Call ( For new Call / Auto Call)

    Dynamic layouts are supported for Tasks and Appointments.

  • Dynamic Layout on Edit Customer page

        Hi, I need to customize Edit Customer page so that when the value of Line Of Business is "A", some fields should hide and some others should show, and when the value of Line Of Business is "B", those hidden fields should appear and some fields should hide.
    I've seen some documentation about customization, but I couldn't do what I need so far. The documents always say to use the Oracle Composer (Administration > Customize Customers Page), then click on "Select" on the left-upper corner, then click on the desired component and "Edit Component". There, I should be able to write some groovy expression on Expression Builder to indicate whether to hide or show the component, based on another field's value.
    My problem is that the options in the menu is always inaccessible! I have a print, but I don't know if I can attach it here neiter how to attach it....
    Does anybody have any idea of how to accomplish this? Is there any other way to do this type of customization?
    Any help would be appreciated...

    In Rel8, app composer introduces dynamic layout. This feature allows an object to have many create and detail layouts.
    These layouts can be dynamically shown based on role, record type, or advanced expressions. Record type and Advanced Expression run against the record.
    Think of it as the state of the record i.e. Record Type = 'Hot' Show Layout 1, Record Type = 'Cold' Show Layout

  • Appointment vs Task Dynamic Layout

    Hello,
    I have an dynamic layout on the Activity Type field.
    Is it possible to check in the default value if the Activity is an Appointment or an Task?
    I tried different formulas but it is always false.
    IIf(FieldValue('<Activity>')='Task',LookupValue("TODO_TYPE", "Value1"),LookupValue("TODO_TYPE", "Value2"))
    Maybe someone have an idea and could help.
    Thanks,
    Kind Regards,

    You have the capability to create dynamic layouts by type, using existing Activity Dynamic Layout Management. There are two options, one each for Appointments and Tasks. The driving picklist is the Type field for both activity types. That requires you to add appointment types and task types to the same picklist. If you are willing to do that, then you can create dynamic layouts.
    Our problem was that we did not want to make users pick between Appointment Types and Task Types. The requirement was to have only the appropriate values show depending on the type. So we default the Type value and created two new picklists, one each to store Appointment Type and Task Type.
    The net result is that we can show users appropriate types based on the activity type, but we only have one layout per activity type per user role as a result.
    Also, you asked about how to determine if it's a task or appointment, and that information is stored in the Activity field automatically by the system when a user creates a new activity record. The values are Task and Appointment, and can not be administered.
    Hope this helps,
    Thom

  • Task Dynamic Layout

    I created different layouts for when someone creates a task, and assigned each of those layouts to a Task "Type" option from the picklist. Everything works great when we choose an option in that field, but the initial layout of a task(before completely any of the fields) doesn't portray any of the layouts we created. It keeps the defaulted layout that came with the system. How do I change this?
    -Amber

    Amber, when you setup your Task dynamic layout in step 1 you can specify the Default Layout.

Maybe you are looking for

  • How do I know if I can get fibre?

    Hello, I live in a remote area and am connected to the Warmingham exchange which I understand has recently (in September having been delayed a few times) been upgraded to fibre. The online checker suggests that there is fibre in my area but that they

  • Tecra S2 - resolution for external monitor on NVIDIA GeForce Go 6600

    Hello! I'm new here ... I have a Tecra S2 with Windows XP SP2 and graphic card NVIDIA GeForce Go 6600. Internal resolution (display of notebook) is 1024 x 768. Its work fine. But I work with an external monitor VGA with "DualView" function. It is a S

  • Picking up mulitple files from same location - FTP?

    I have recently completed ther TBIT40 - Exchange Infrastructure Fundamentals course. One of the questions I raised to the tutor was picking up many files from the same outbound folder (Non R/3), with variable names, via FTP.  These files will be time

  • How to view Contact Person's Occupations in WEB UI

    Hi Experts, While creating Contact Person, you have a provision to select Occupation (drop down list) of a Contact Person. This works fine in SAP GUI, but in WEB UI, the drop down values are not displaying. I activated the Occupation field in assignm

  • RE:Purchase Order/Purchase requisition approvals

    Hi All, I have created my own setups in http://vis1213.solutionbeacon.net, i did all the setups and approval process, but i couldnt able to approve even a single  purchase order. Error shooting like No approver found for the standard purchase order.