JavaServer Faces Custom Controller

Hello,
Is it possible to extend or adjust the JSF Controller? I'm in a situation where I need to develop an application for a browser client, and PDA client. Where JSF can render their UI components on different devices, what I need is a totally different view (layout) and navigation structure for the PDA client.
Thus, a few years ago I would code a layer in my controller, sort of front controller, that chooses between a PDAController and a WebController, which in turn handles navigation etc..
Is it possible to do this in JSF? I really like the RAD aspect of JSF, so if there's any way of combining these concepts...?
Kind regards,
Robbie

Yes, it possible to do it in JSF as JSF support multiple renderer kit for different devices. Please read Renderer Kit section of the JSF specification to learn more about it
http://jcp.org/en/jsr/detail?id=252
- Winston
http://blogs.sun.com/winston

Similar Messages

  • JavaServer Faces and Struts

    For those of you interested in using JavaServer Faces and Struts together (and my mailbox indicates that this is quite a few people :-), I'm happy to announce the immediate availability of an integration library that allows you to use the EA3 release of JavaServer Faces with a recent nightly build (20030216 or later) of Struts 1.1 -- it will also work with the upcoming 1.1-rc2 and 1.1-final releases -- together. Nightly builds of the integration library are available at <http://jakarta.apache.org/builds/jakarta-struts/nightly/struts-faces/>.
    The sources for this package are in the Struts CVS repository, in the "contrib/struts-faces" directory, and will be included in the source nightly distributions starting with the 20030307 version. It is not currently planned to include the struts-faces integration library with binary distributions of Struts 1.1, since it is still an EA quality release.
    See the README.txt file (included in the nightly build) for more information on running the example application and using the integration library in your own applications.

    What are the reasons not to have extended
    RequestProcessor from Struts with the
    capabilities of the FacesServlet... a sort of
    "FacesProcessor" (extended the regular
    RequestProcessor)? (should be nice for views
    with no JSF components: in order not to execute
    FacesServlet for each views , event if there is
    no JSF component in the view)It turned out that I needed a customized RequestProcessor anyway (a couple of the processXxx methods had to work differently), but it actually would have been more work incorporating FacesServlet directly into it. In essence, there is now (in the combined version) a "front controller" for UI events , FacesServlet, and a "middle controller" for form submit events (RequestProcessor). When a UI event happens that just causes the current page to be redisplayed (think of a tree control where you click on the "expand this node" icon), you don't really want the Struts controller servlet to even be bothered by this request. Indeed, if you're using a presentation that was based on DHTML+Javascript, such an event would have been handled on the client anyway, and would never have been sent to the server at all.
    The combined approach still supports Faces and non-Faces pages, though. This means you can migrate one page at a time and test things (which is exactly what I did when I ported the pages of the example app).

  • Download javaServer faces business objects enterprise

    Post Author: gzofera
    CA Forum: JAVA
    hello, where do I download the javaServer face enterprise business objects?
    I am preparing an environment to start customizing web intelligence, and I lost well as to libraries, tools, etc.. which FDI sweat, ECLIPSE? NETBEANS? OTHER? WHERE THE PLUGINS FOR MEETING SET THE SDK? is there any tool that characterizes the Gazette to customize the WEBI? thanks

    Post Author: amr_foci
    CA Forum: JAVA
    i didnt know that there is something like that from Business Objects,  thats work in JSF layer
    but you can check you ESD if you've an account
    https://businessobjects.subscribenet.com/control/bobj/login
    good luck

  • When to move from Struts to JavaServer Faces

    Hi all,
    we've noticed that JavaServer Faces appears to be the future for Model-View-Controller (MVC) framework, and eventually make Struts obsolete (IMHO).
    we are just about to embark on a new project and wondering if JavaServer Faces (JSF) is mature enough to deserve our attention, or should we wait until its full production release.
    any comments will be appreciated.
    regards,
    Trajano

    I would say if it's not at a full production release yet, then wait. If you have a real world app, it's not worth using a beta system to run it on. At least not without some thorough testing of your own, but only you know what your application needs.

  • How to get my custom controller updated with the global custom controller?

    Hi all,
    I'm new to CRM Web UI and need some advice from the expert. Currently I'm working on component ICCMP_BT_DATES and noticed something weird with this component. When this component is first launch it display the dates of a service ticket correctly. However when I navigate to another screen, save a new ticket and back, the dates are not reflected. When I went in and debug the component, I noticed that the context is still tied to the previous ticket. I think the custom controller is not updated with the latest from the global custom controller.
    My question is how do I get my custom controller updated with the latest.
    Regards,
    Ricky

    You have to bind your custom controllers context node to the event NEW_FOCUS of the collection wrapper on the global custom controller.
    Best place to do this might be the CONNECT_NODES of the context of your custom controller.
    Get the global CuCo with GET_CUSTOM_CONTROLLER() and then the appropriate context node. Now:
    SET HANDLER yourMethod for lr_global_cuco->typed_context->thecontextnode->collection_wrapper activation iv_activate.
    Of course you have to implement a method similar to ON_NEW_FOCUS as it is on many other nodes.
    cheers Carsten

  • Can i Bind more than one Model object to the Custom controller or not

    Hi All, I trying to bind more than one model object to the custom controller, Both the model objects contains same attribute name called ( output). Both model objects created on to top of the BAPI. So when i bind first model object to the custom controller will work fine. When i am trying to bind the second model object to the same controller. This second model object also having the same attribute name called "output" . So it is giving an error of "Duplicate context element "Detail". Rename or uncheck duplicate elements.
    can i assign more than one model object to the single controller or not?
    But in the reference document, it has given that , we can create model object with more than one bapi.So in this case if both the bapis contains any element with the same name will also be problem. Any body give me the solution.
    Initially we have created one custom controller for each model object. But later i realized that, why con't we use same controller for all the model object. Because, the custom controller context is the public context. this context shared across all the view controllers.
    The concept which I am trying to do is right or wrong?

    Hi Vishal,
    of course, you can bind one controler to many models. When the same name occours you can simply RENAME binded node in controler.
    Regards
    Bogdan

  • How to read the details in the context node of the custom controller

    Hi friends,
        My requirement is i enhanced the component ICCMP_BP_DETAILS , now on EH_ONSAVE i want to read the details of the Context node in the Custom COntroller .
    In custom controller from ICCMP_BP_DETAIL/CuCoBPDuplicate  From this in context node CUSTOMER is there in that attributes first name last name is there i want to read those details
    so can u pls provide the logic for this how can i get the values.
      am very new to the BSP programming
    Regards
    Yogesh

    Hi Suchitha,
    when i am following the above code the lr_entity is not Bound, so can u pls suggest is there any thing is missing
    i used the below mention code but lr_entity is not bound
    DATA: lr_cuco type ref to CL_ICCMP_BP_CUCOBPDUPLICA_IMPL.
                lr_entity type ref to cl_crm_bol_entity.
    lr_cuco ?= me->get_custom_controller( 'ICCMP_BP_DETAIL/CuCoBPDuplicate') .
    CHECK lr_cuco IS BOUND.
    lr_entity ?= lr_cuco->typed_context->customer->collection_wrapper->get_current( ) .
    CHECK lr_entity IS BOUND .
    lr_entityIF_BOL_BO_PROPERTY_ACCESSGET_PROPERTY_AS_VALUE( iv_attibute =  'FIRST_NAME' ev_attribute = lv_firstname ) .
    Please correct the code if any thing is missing
    Regards,
    Yogesh

  • Error when creating custom controller

    I have a non-visual WebDynpro DC that contains a single data model.  The model has been added to the public part of the DC.
    I have another visual WebDynpro DC that makes use of the data model in the first DC.  If I explicitly reference the model in the first DC, everything works just fine.  I can input data, invoke the model, and see the response displayed on the page.
    However, I'm trying to create a custom controller that hides the data model.  When in the data modeller for the visual WD DC, I right click on the 'Custom Controllers' pane, and select 'Apply Template'.  I create a Service Controller, and select the model that's been imported (actually, that's been referenced as a used component) from the first DC.  I then select the data elements from the context that I want bound into this custom controller.  Click next, give a more descriptive method name, and then click Finish.  I get an internal error as follows:
    Source controller implementation file is not accessible (D:/src/.dtc/LocalDevelopment/DCs/example.com/test-wd-view/_comp/gen_wdp/packages/com/example/wd/AdderModelCust.java)
    Exception: java.lang.NullPointerException
    Am I doing this correctly, or am I missing a step or two?

    Hi Ken,
    you didn't miss some steps, this seems to be a bug in the tools. Please open a OSS message with the following information:
    - which Studio version you use (NW04/04s? SP?)
    - description of how to reproduce the effect
    - Studio's error log attached (.log file in <YourWorkspaceFolder>/.metadata)
    In the meanwhile to circumvent the error you should try to
    - create a new custom controller manually in WD explorer and launch Service Controller template from this controller (context menu in WD explorer)
    - if this fails as well, manually create the context definitions and method implementation that the template would produce.
    Regards
    Christian

  • How to get the reference of the View controller in from Custome controller

    Hi friends,
    From one of the Custome controllers in my Component,I am raising a popup based on conditions.
    I want to subscribe to popup buttons.
    Following is the code that I have written.
    IF LT_RECEIPTS_T[] IS not INITIAL.
        data lo_window_manager type ref to if_wd_window_manager.
        data lo_api_component  type ref to if_wd_component.
        data lo_window         type ref to if_wd_window.
    *BREAK-POINT.
        lo_api_component  = wd_comp_controller->wd_get_api( ).
        lo_window_manager = lo_api_component->get_window_manager( ).
        lo_window         = lo_window_manager->create_window(
                           window_name            = 'W_PERSONALCARDPOPUP'
                           message_display_mode   = if_wd_window=>co_msg_display_mode_selected
                           button_kind            = if_wd_window=>co_buttons_okcancel
                           message_type           = if_wd_window=>co_msg_type_none ).
        lo_window->open( ).
        DATA: view_controller TYPE REF TO if_wd_view_controller.
        view_controller = wd_this->wd_get_api( ).
        CALL METHOD lo_window->subscribe_to_button_event
          EXPORTING
            button      = if_wd_window=>co_button_ok
            action_name = 'OK'
            action_view = view_controller.
    as I am In Custome controller,wd_get_api is returing of type if_wd_controller,but the subscribe_to_button_event
    requires action_view of data type if_wd_view_controller.
    but,my problem is that I can keep the view only Custome controller.
    when I pass the 'VIEW_CONTROLLER' variable to method subscribe_to_button_event,I am getting the error  as type missmatch.
    Please suggest how I can rectify this error.
    Regards,
    Xavier.P

    Hi Xavier,
    You try this
    1. Define an attribute in your custom controller to hold your popup window reference for e.g lr_popup of type if_wd_window
    2. Store the popup window reference in lr_popup when calling your popup
    lo_api_component = wd_comp_controller->wd_get_api( ).
              lo_window_manager = lo_api_component->get_window_manager( ).
              wd_this->lr_popup = lo_window_manager->create_window(
                              window_name = 'W_PERSONALCARDPOPUP'
                              message_display_mode = if_wd_window=>co_msg_display_mode_selected
                              button_kind = if_wd_window=>co_buttons_okcancel
                              message_type = if_wd_window=>co_msg_type_none ).
             wd_this->lr_popup->open( ).
    3. Define the custom controller usage in the properties of your popup view
    4. In WDDOINIT of your popup view write the following
    DATA lr_custom_controller TYPE REF TO ig_<Custom Controller>.
            lr_custom_controller = wd_this->get_<Custom Controller>_ctr( );
            lr_custom_controller->lr_popup->subscribe_to_button_event(
         button = if_wd_window=>co_button_ok
         action_name = 'OK'
         action_view = wd_this->wd_get_api( ) ).
    5. Define the event handler for OK in your popup view
    Best Regards,
    Loveline

  • How to call a custom controller method from view

    Hi,
    I ve created a simple web service and consumed it in a model. Mapped the input & output parameters to custom controller context which in turn mapped to component controller's context which in turn to view's contexts.
    How to call a custom controller method from view?
    Please explain the syntax.
    Regards,
    Manoj.

    Hi Patralekha,
    Give some idea for the below scenario:
    I ve created a simple web service and consumed it in a model. What I did was
    1) for the input parameters, mapped the node from view->custom controller->model
    2)for the output parameter, mapping from model->custom controller->view.
    It works fine.
    But I don't want to access model nodes directly, rather I want to set the input param in somewhere else (like custom controller) before calling the appropriate method, same for the response also.
    Share me your thoughts.
    Regards,
    Manoj.

  • How to call a custom controller method in a view

    Hi ,
    I am getting the partner no in the custom controller method . I want  to call that method in the view.How is it possible......?

    Hi Masood,
    now i dont want cross compnent navigation ....
    Requirement : Account Identification number in ZVIEW
    My component is  CRMCMP_BPIDENT
    In the custom controller   CRMCMP_BPIDENT/CuCoBuPa  under context node   SEARCHCUSTOMER
    the attribute struct.partner is available 
    in this component  im navigating from  
    CRMCMP_BPIDENT/ObjectCompVs   to   ZCRMCMP_BPIDENT/ZProducts 
    in the layout of   ZCRMCMP_BPIDENT/ZProducts
    TRY .
    lr_cuco ?= controller->get_custom_controller( 'CRMCMP_BPIDENT/CuCoBuPa' ).
    CATCH cx_sy_move_cast_error.
    RETURN.
    ENDTRY.
    check lr_cuco is bound.
    lr_entity ?= lr_cuco->typed_context->SEARCHCUSTOMER->collection_wrapper->get_current( ).
    check lr_entity is bound.
    lv_account_name = lr_entity->get_property_as_string( iv_attr_name = 'BP_NUMBER' ).
    this code is written to get the account identification number but still the same problem
    lr_entity not getting populated .......
    i checked  IF_BSP_WD_HISTORY_STATE_DESCR~IS_RESTORABLE 
    hr rv_result is set to x.....
    any  suggestions....
    Regards,
    Sijo...

  • Error while creating the custom controller

    Hi experts,
    I am working on a web dynpro object where i need to create an application configuration.I created a custom controller context.I mapped it to main view.I am using the attribute of custom controller context in main view so that another view view1 is displayed based on this attribute.
    custom controller context
    node1 --> display_view1
    mapped above node to main view.
    view1 is triggered in main view onaction method based on display_view1 value.
    Presently i am getting the dump " node1.1.main doesnot have elements."
    Please help.
    Edited by: ch_ravi_sap on Nov 22, 2011 2:11 PM

    Hi I get rid off the error.
    Changes i have made are cardinality from 0:n to 1:n. selection 0:n
    But presently i am changing the attribute of custom controller in component configuration browser.I am not able to see the changed value in main view ( where i have used this attribute ).
    Any help is appreciated
    Edited by: ch_ravi_sap on Nov 23, 2011 12:17 PM

  • Error while binding the model with the custom controller

    Hi All,
    I first started with a dummy project and in that binded the model with the custom controller.
    For some reason, I deleted the project and created a new one. I have deleted the whole project from the workspace.
    Now, when I am trying to bind the model  again , I am getting an error when selecting the response parameters saying that DUPICATE ENTRIES.Ideally it should not happen when I am deleting it completely.
    I am using a Webservice Model. Can any one help me out to resolve the same.
    Looking forward for your response.
    Regards
    Dipendra

    Hi Raman,
    I did that and even I have Installed the IDE again.
    Still I have that error.
    Regards
    Dipendra

  • Issue in Binding Custom controller to Component Controller

    Dear All,
    I have enhanced a standard component ERP_H.
    I created a custom controller with context nodes BTSTATUS, BTSTATUSH
    I enhanced the component controller with context node BTSTATUS, BTSTATUSH
    Now when i try to bind the custom controller to component controller using this code in the context class of my custom controller
    bind to component controller
      owner->do_context_node_binding(
               iv_controller_type = CL_BSP_WD_CONTROLLER=>CO_TYPE_COMPONENT
               iv_target_node_name = 'BTSTATUS'  " component controller context node
               iv_node_2_bind = BTStatus ).
    its not working since this context node in component controller is not the standard one but the custom added one.
    Am i missing something, or is there any way to bind customer context node in custom controller to customer context node in component controller.
    regards,
    pradeep

    Hi pradeep,
        Try the other way round go to the context class in the component controller and paste the following code in the
    create_contextnode( context node = name of the node to be linked).
    *owner->do_context_node_binding(
            iv_controller_type = cl_bsp_wd_controller=>co_type_custom   <-----linking from component to custom
            iv_target_node_name = 'BUILHEADER' "target node: component controller node
            iv_node_2_bind = BUILHEADER ). "source node: current node.
    See if this works.
    Thanks

  • Do I need to use a custom controller & view set

    Good Day,
    Please excuse the long question.
    I am in the process of creating a new BSP application.  In a nut shell, my application is going to accept a bunch of data in the URL and pass the data to an external system.  Depending on what is returned from the external system, it will prompt the user to either supplement the data or to confirm what the external system has sent back. 
    I would like to have all of the business logic that communicates with the external system and decides what type of user interaction to be located in one central class.  I was thinking that I could have a custom controller that is resident for the life of the application.  It would call the external system and navigate to other views depending on what is required.  When the user responds, the response would go to the custom controller and be sent to the external system.  So, my first question is does this sound reasonable?  For my second question, is it possible to have a view associated with the custom controller.  If so, I can use it for the confirmation "screen".
    While looking at the Web IC cookbook, I ran accross the section on view sets.  Are there pros and cons to using a vew set for an application like this?  I expect the browser window to contain one view at a time and it kind of seems like view sets may intended more for where there are several views displayed within the browser and the view set allows you to change only one.  Is that true?
    Thank you very much for any insight you can offer.  I promise to award points for helpful responses.
    Thanks and kind regards,
    John

    Hi John,
    My suggestions would be to use a model class for the business logic and call to the external system.  The controller would only be for eventing and determining what view to call.  I would create a parameter called view_name on the controller and toogle this between your views depending on what returns from your model methods.  As a personal preference I would pass the 'bunch of data' in the form rather than the URL.  Validate it in a model method before sending it to the external system.  I tend to use URL querystrings for small stuff rather than large application data.  Also what would happen to the application if someone saves your URL as a favorite and launchs the app.
    Those are my thoughts hope it was helpful.
    Regards
    Matt

Maybe you are looking for

  • GATP - Allocation with Availability Check

    Friends, Need help setting up the below scenario in GATP : Product Allocation for Product A is 100 per day and allocated only in single bucket (rest of the buckets zero qty). Order comes in for 150 qty. If I check allocation first then only 100 will

  • Runtime Error: java.lang.ClassCastException

    My project is to creat a postfix with boolean. I finished my code, it compiled great, than I got an java.lang.ClassCastException. So obviously I have a casting problem. Any help or hints in the right direction would be greatly appreciated.      impor

  • Single license / Standby Server Preparedness

    I have a production server with a Standard Edition One single CPU license. I need to be ready in case the server has a problem and I need to stand up a new server. At what point is it required to buy another license? Case 1: Standby Server: Oracle is

  • COMM API - Not finding ports

    Hi there. I am having a severely irritating problem with the comm api. I wrote my program in netbeans v3.6 and it runs perfectly, no problems at all. My problem is when I try to run the program using the command prompt. It finds all the relevant .jar

  • JConsole: Meaning of TOTAL WAITED and TOTAL BLOCKED in Thread View

    I'd like to know the meaning of the TOTAL WAITED and TOTAL BLOCKED values shown on the right pane when clicking on a thread in the THREAD tab. I have reviewed the JConsole Documentation but it fails to indicate their meaning. Thank you, Juan Velez