Call Custom AppModule Method

I would like to use an application module custom method to set <TD> and <TR> "class" attributes. The method requires as a parameter, one of the values in the current row of the view object. Is there a sample on the OTN website that does something similar to this that I can follow? I have searched this forum and have not been able to find anything.
Thanks,
Jeff

Shay,
Thanks for the information from Ronald Grant’s blog, I found it helpful but I am not convinced his is the best solution to my problem. In resolving my problem, I need to be careful not to mix the presentation and business logic tiers. I am trying to build a dashboard type application and the various rows of data in the table represent jobs. These jobs can have certain "issues" that may impact their completion date. Depending upon the severity level of these “issues”, I’d like to color the entire row or just individual cells. Grant used EL language constructs to dynamically set inlineStyle attributes. Specifically, he used a [CONDITION] ? [CHOICE1] : [CHOICE2] construct which in my case would be a bit cumbersome because having multiple severity levels (5+), I’d have to nest these statements. What I would like to do would be to separate the styling from the logic and create individual styles to represent various severity levels:
severity1 {   
background: Green;
color: Black;
severity2 {
background: Yellow;
color: Black;
severity3 {
background: Red;
color: Black;
Then based upon the severity level defined in a column of the view, I would like to set the style to be used like in this syntactically incorrect example:
<tr class=”severity#{row[‘severity’]}”>
<td> <c:out value="${Row['Sernr']}"/></td>
<td>more data</td>
</tr>
which would produce the html like this:
<tr class=”severity3”>
<td>5677AB</td>
<td>more data</td>
</tr>
Can I do something like this using JSTL? I was successful doing it in ADF Faces EL like this:
<af:outputText value="#{row. 'Sernr'}"
styleClass="severity#{row.severty}">
but the row visual properties in the browser did not change. I think it had something to do with the default stylesheet referenced in the page header:
adf/styles/cache/oracle-desktop-10_1_3_0_4-en-ie-6-windows-s.css
It seemed to me that it's visual properties were taking precedence over mine. Is there a way of making a copy of that stylesheet, storing it locally in the html_root directory and telling Faces to use it rather than the default? This solution would work for me also.
Am I way off in my logic trying to solve this problem? If so, is there pattern documented on the web for this type of problem? I need to get a prototype up and running quickly butI’ve been dogged by what seems to be a fairly benign problem to solve. I hope my explanation makes sense. Thanks in advance for any insight you may provide.

Similar Messages

  • Calling custom appmodule method from jclient form

    Does anyone have the code to do this? I can't manage to figure out to go from
    panelBinding -> myCustomApplicationModuleMethod()
    Many thanks.

    Woops...needed to rebuild the project before my custom method showed up in the interface. For the next person...
    MyAppModuleName a = (MyAppModuleName)panelBinding.getApplicationModule();
    a.MyCustomMethod();

  • Creating master-detail VO in custom AppModule method

    Hi.
    I need to create master-detail view objects and save them in DB in my custom AppModule Service Interface method.
    I have the next master-detail view objects:
    RegistryVO (1) -- (*) RegistryItemVO
    Also I have a view link for this relationship.
    I wrote custom method with next signature:
    Integer createRegistry(RegistryVORowImpl registry) {
    Then, I added this method to my AppModule Service Interface.
    Method works fine, but only master row is created and inserted to DB (only Registry but not RegistryItem). I.e. when I testing this method in EM I fill full RegistryVO with nested RegistryItemVO data but in my method RegistryVO comes without nested RegistryItemVOs.
    Then, I added SERVICE_PROCESS_CHILDREN custom property to view link (RegistryVO-RegistryItemVO) as it described in chapter 11.2.5 of Fusion Developer 's Guide for Oracle Application Development.
    After that nested RegisttryVO in my method contains nested RegistryItemVOs.
    In my custom method i need to set primary key for RegistryVO. So I set it in registryVO to PK attribute and set it in nested registryItems to FK attribute.
    But when I doing commit I have an exception:
    Exception while executing the business logic: JBO-26048: Constraint "PP_PST_RG_IT_PP_PST_FK" is violated during post operation "Insert" using SQL stat
    ement " *INSERT INTO PP_PERSON_ST_RG_ITEM* (PP_PERSON_ST_RG_ITEM_ID,IN_DOCUMENT_ID,POL,FULLNAME,NAME,FULLOT,TIN,D_ROG_DT,D_REEST
    _DT,PROCESSING_DT,PROCESSING_STATE_CD,RECEIVE_YEAR) VALUES (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12)".: ORA-02291: integrity
    constraint (PP_PST_RG_IT_PP_PST_FK) violated - parent key not found
    It seems that only registryItems are commited in DB. I'm not seeing INSERT for Registry in ServieInterface log...
    But if I setting primary key for RegistryVO when I invoking method (if I setting id for registry in test console of EM, not in method) - it's work fine .
    What I'm doing wrong ?
    How can I create custom method for AppModule Service Interface to create master-detail view objects and set PK for master and FK for details within method ?
    Edited by: user2975420 on 19.10.2010 4:46
    Edited by: user2975420 on 19.10.2010 4:49

    Thanks for reply, John.
    I have already added master and detail view objects usages to my AppModule Data Model. And yes, I add detail VO as child of master.
    It seems that the reason of my problem is another...
    I can't create master/detail when I'm setting id of master in custom method. If I set id of master in input parameter (RegisterVORowImpl) then method invokes successfull.
    I noted one moment - if I'm not setting SERVICE_PROCESS_CHILDREN custom property for view link, I can set id of master VO inside method. But in this case my master VO haven't got nested RegisterItemVOs.
    Edited by: user2975420 on 19.10.2010 10:23
    Edited by: user2975420 on 20.10.2010 1:31

  • Calling custom Infotype method from Webdynpro Abap

    Hi Experts,
    I am working on an application where i need to call a method of a custom defined infotype.
    I have done this -->
    1. Create a custom infotype 9111
    2. SAP creates a class of that infotype ZCL_HRPA_INFOTYPE_9111
    3. Inside this method there are few inherited method which provide me functionality of insert , update , delete
    i want to call methods IF_HRPA_INFTY_BL~MODIFY,
    IF_HRPA_INFTY_BL~INSERT
    However when i call these method from webdynpro abap this method does not work.
    where as when i try to insert an entry using PA30 transaction it works.
    Does anyone know why does this happen and what is the solution?
    Regards,
    Ashish Shah

    Hi Ashish,
    You need to create method inside your assistance class, the class your webdynpro component talks to.
    Within the methods of Assistance class you will have to create instance of ZCL_HRPA_INFOTYPE_9111 and call its  method IF_HRPA_INFTY_BL~INSERT  passing the data.
    Cheers
    Prashant

  • Calling custom Infotype method from ABAP report

    Hi Experts,
    I am working on an application where i need to call a method of a custom defined infotype.
    I have done this -->
    1. Create a custom infotype 9111
    2. SAP creates a class of that infotype ZCL_HRPA_INFOTYPE_9111
    3. Inside this method there are few inherited method which provide me functionality of insert , update , delete
    i want to call methods IF_HRPA_INFTY_BL~MODIFY,
    IF_HRPA_INFTY_BL~INSERT
    However when i call these method from abap report this method does not work.
    where as when i try to insert an entry using PA30 transaction it works.
    Does anyone know why does this happen and what is the solution?
    Regards,
    Ashish Shah

    Hi,
    This is the code we are using. Just calling the read and modify methods of the check class. Very simple actually .. we just want once update/insert to work but it does not.
    <CODE>
    REPORT  ZTESTRAD_WD.
    FIELD-SYMBOLS <p9106> TYPE p9106.
    DATA : infty_container_tab TYPE hrpad_infty_container_tab ,
           message_list        TYPE REF TO cl_hrpa_message_list,
         w_ok type boole_d  ,
         ref_class TYPE REF TO ZCL_HRPA_INFOTYPE_9106,
         container        TYPE REF TO if_hrpa_infty_container,
         it9106_container TYPE REF TO cl_hrpa_infotype_container,
         p9106_ref        TYPE REF TO data,
        busilog type ref to if_hrpa_masterdata_bl.
    CREATE OBJECT  message_list.
    TRY.
            CREATE OBJECT ref_class
              EXPORTING
                tclas = 'A'
                infty = '9106'.
          CATCH cx_hrpa_violated_assertion .
            write :/ 'Error during initialization'.
      ENDTRY.
    call method cl_hrpa_masterdata_bl=>get_instance
       importing
         masterdata_bl = busilog.
    TRY.
    CALL METHOD ref_class->IF_HRPA_INFTY_BL~read
      EXPORTING
        tclas           = 'A'
        pernr           = 'XXXXXXXX'
        infty           = '9106'
        begda           = sy-datum
        endda           = sy-datum
        no_auth_check   = abap_true
        message_handler = message_list
      IMPORTING
        container_tab   = infty_container_tab
        is_ok           = w_ok.
    CATCH cx_hrpa_violated_assertion .
       WRITE :/ 'Infotype could not be read'.
    ENDTRY.
    *" Fill the local structure with container data:
      loop at infty_container_tab into container.
        it9106_container ?= container.
        TRY.
        CALL METHOD it9106_container->primary_record_ref
          IMPORTING
            pnnnn_ref =  p9106_ref.
         CATCH cx_hrpa_violated_assertion .
        ENDTRY.
        ASSIGN p9106_ref->* to <p9106>.
        write :/ <p9106> .
      endloop.
    *" Just change some field values of the record
      <p9106>-C1name2 = 'Test name'.
      <p9106>-C2name2 = 'Test name 2 3 4'.
    data : return TYPE BAPIRETURN1,
           return1 TYPE BAPIRETURN1.
    *CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
    EXPORTING
       number        = <p9106>-pernr
    IMPORTING
      RETURN        = return1
    *PERFORM do_nothing(sapfp50p).
    The container itself is modified
      container ?= it9106_container->modify_primary_record( <p9106> ).
    CREATE OBJECT message_list.
    the invocation - errors are always fatal !!!
      DATA : lx_exception  TYPE REF TO cx_root,
             update_mode type HRPAD_UPDATE_MODE,
             massn type massn,
             massg type massg.
      TRY.
          CALL METHOD ref_class->IF_HRPA_INFTY_BL~MODIFY(
            EXPORTING
               old_container =                   it9106_container
               massn                          = massn
               massg                         = massg
               update_mode =                 update_mode
               no_auth_check =                   'X'
               message_handler =                 message_list
            IMPORTING
               is_ok =                           w_ok
            CHANGING
               container =                       container
        CATCH cx_hrpa_violated_assertion INTO lx_exception.
          RAISE EXCEPTION TYPE cx_wd_no_handler
            EXPORTING previous = lx_exception.
      ENDTRY.
    </CODE>
    I have also tried by instantiating the cl_hrpa_masterdata_bl and then calling the methods on that object...... makes no difference.
    I used this link to proceed with the modifications:
    http://help.sap.com/saphelp_erp2005/helpdata/en/43/21d2254bba2bebe10000000a1553f7/frameset.htm
    The funny thing is that the WHOLE logic executes without any error messages or dumps or anything. I have now debugged almost every line of code that these methods call. PA30 works just fine. HR_INFOTYPE_OPERATION does not .. that's a whole differnt story.

  • Manage bean methods not able to call application module methods

    Hi,
    I have an ADF application where in my managed bean method needs to call AppModuleImpl methods. I use the code as below:
    public void getSummary() {
    DCBindingContainer binding = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    OperationBinding op = binding.getOperationBinding("getVOData");
    op.execute();
    The code works fine when I run the application in my IntegratedWeblogicServer and I am able to get the data on my .jsp pages.
    I have installed weblogic server on another machine and I need to deploy and run my application on that server. But when I try doing that, the above code is not able to call the AppModule method and I see no data on my page (Also there is no error or exceptin thrown). Seems that the ViewController project is not able to interact with the Model project.
    Is there any extra configuration to be done on the newly installed weblogic server to get this work? Or will some change in the application code help?
    Please suggest.
    Thanks and regards,
    Ansh

    Hi,
    While creating the weblogic domain, we had the following checkboxes checked:
    1. Basic weblogic server domain [wlserver_10.3]
    2. Oracle JRF [oracle_common]
    I hope this is what we need.
    Yes, I also have the adf runtime installed.

  • 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...

  • How to call standard SAP method in the Custom Program ?

    Hi,
    i need to call sap standard method 'OpenItemRollinout' in my custom program. For the SAP Standard method 'OpenItemRollinoun' the BOR(Business Object) is 'PAYSCHEME'. So how to call the SAP standard method in the custom program ???

    Hi,
    In the method that you have provided only one function module is being used so better use the FM and copy the remaining code based on ur requirement.
    FM is ISU_S_PAYSCHEME_ROLLIN_ROLLOUT.
    Regards,
    Vijay.

  • Custom toJSON() method is not called for each property

    I'm getting familiar with JSON in ActionScript 3 (FP 11), and experimenting with custom toJSON methods. The Developer's Guide section on Native JSON Support clearly states:
    JSON.stringify() calls toJSON(), if it exists, for each public property that it encounters during its traversal of an object. A property consists of a key-value pair. When stringify() calls toJSON(), it passes in the key, k, of the property that it is currently examining. A typical toJSON() implementation evaluates each property name and returns the desired encoding of its value.
    However, both the subsequent examples on the very same page and my own tests indicate that, on the contrary, toJSON() is only called once for the whole object, and no argument is passed for k. Take the following trivial class:
    public class JSONTest {
        public var firstProperty:int = 1;
        public var secondProperty:String = "Hello world";
        public function toJSON(k:String):* {
            trace("Calling toJSON on key", k);
            return this[k].toString();
    According to the documentation this should cause the following to print:
    Calling toJSON on key firstProperty
    Calling toJSON on key secondProperty
    And the output should basically be the same as without a custom toJSON method:
    { "firstProperty" : 1, "secondProperty" : "Hello world" }
    Instead, this just throws an error because nothing at all is passed as k.
    So, is the documentation wrong and the engine is not supposed to call toJSON for every property, or is the engine incorrectly only calling it once?

    I just figured out what the documentation means. k refers to the name of a property to which the entire instance being stringified is assigned, not to the names of the properties of the instance being stringified. An example is much clearer:
    var wrapper:Object = { prop1 : 1, prop2 : new JSONTest() };
    trace("Stringify result =", JSON.stringify(wrapper));
    Prints:
    k:String = prop2
    Stringify result = {"prop2":{"firstProperty":1,"secondProperty":"Hello world"},"prop1":1}
    So k is the name of the property on wrapper, not on the JSONTest instance. When stringify is called directly on an instance of JSONTest, k is empty because the JSONTest instance is not assigned as a property of another object, it is just all by itself. Either way the value returned by toJSON must be a string or object representing the stringified form of the entire instance.

  • How to call Custom or Component Controller methods from View Controller

    Hy Guys,
    how do I call Custom Controller or Component controller methods from a View or Context Controlller?
    thanks in advance
    Jürgen

    Hi Juergen
    Yes it is possible, pls follow the below approach to access the component controller in context node class
    1) since the standard component controller class is protect variable , declare a variable of type component controller in your controller class.
    say for example the public variable you declared is  g_comp_controller
    2)  now redefine the controller class method WD_CREATE_CONTEXT  and add the below lines of code
       g_comp_controller ?= me->comp_controller.
    3) go to context node class  (CNXX)  there declare the varaible which of type controller class (IMPL)  as public variable, for example g_owner
    4) redefine the method  IF_BSP_MODEL~INIT  and write the below code
         CALL METHOD super->if_bsp_model~init
        EXPORTING
          id    = id
          owner = owner.
      g_owner ?= owner.
    5) now the variable   g_owner  that is declared in  (CNXX)   contains reference to your controller class
    6) in  on_new_focus  method access your component controller in the below manner and access the entities also.
    DATA: lv_owner                    TYPE REF TO xxxxx_impl,  " Implementation class
                 lr_comp_cont                TYPE REF TO xxxx_bspwdcomponen_impl, " component controller class
                 lv_entity type ref to cl_crm_bol_entity.
    lv_owner ?= g_owner.
    lr_comp_cont    ?= lv_owner->g_comp_controller.
    IF lr_comp_cont IS BOUND.
       lv_entity ?= lr_comp_cont->typed_context->mdfcampaign->collection_wrapper->get_current( ).
    now lv_entity contains the value of component controller context node.
    Thanks & Regards
    Raj
    Edited by: bmsraj on Sep 27, 2011 3:28 PM

  • How to call BOR object- method in custom program

    hi all,
    I have the following details:
    BOR object : INSTLN
    Method: createdirect
    I need to call the above method in my custom program.
    I need to call it entirely. Means if it contains fn modules I dont want to call those fn modules seperately.

    Hi Sammy,
    Phil Soady from SAP Australia provided me with this little gem a few years back. The actual documentation for this can be found somewhere in the workflow programming area, but I just looked and couldn't find it for you. Anyway, this is a sample program I built to show how to do this. In this example I call the Display method of the Sales Document BO.
    INCLUDE <cntn02>.
    INCLUDE <cntn03>.
    FUNCTION zcallbomethod.
    *"*"Local interface:
    * Data declaration
      DATA: vbak_ref TYPE swc_object.
    * Declare and initialise container
      swc_container container.
      swc_create_container container.
    * Create object reference to sales document
      swc_create_object vbak_ref 'VBAK' '0000000009'. "Sales Document Number
    * Call Display
      swc_call_method vbak_ref 'Display' container.
    * Error handling
      IF sy-subrc NE 0.
      ENDIF.
    ENDFUNCTION.
    Cheers
    Graham Robbo

  • Custom Java method call

    I created a new service which should call a java method. It is called from the confirm htm page after check in of a new content item.
    Serice Name INVOKE_ESB_CLIENT
    DIR - custom/component/classes/invokeESBClient
    Class - InvokeESBClient
    method - invokeESBclient
    ServiceHandlers serviceName - DocService
    handler - invokeESBClient.InvokeESBClient
    This is all done in a component which has a service handler to point it the proper directory and class. But I get the following error. Your help is appreciated.
    Unable to execute service INVOKE_ESB_CLIENT and function invokeESBclient.
    (System Error: The service method 'invokeESBclient' is not defined.) The service method 'invokeESBclient' is not defined.
    An error has occurred. The stack trace below shows more information.
    !csServiceDataException,INVOKE_ESB_CLIENT,invokeESBclient!$!csSystemError,\!csMethodNotDefined\,invokeESBclient!csMethodNotDefined,invokeESBclient
    intradoc.common.ServiceException: !csServiceDataException,INVOKE_ESB_CLIENT,invokeESBclient!$!csSystemError,\!csMethodNotDefined\,invokeESBclient
         at intradoc.server.ServiceRequestImplementor.buildServiceException(ServiceRequestImplementor.java:1742)
         at intradoc.server.Service.buildServiceException(Service.java:1997)
         at intradoc.server.Service.createServiceExceptionEx(Service.java:1991)
         at intradoc.server.Service.createServiceException(Service.java:1986)
         at intradoc.server.ServiceRequestImplementor.handleActionException(ServiceRequestImplementor.java:1453)
         at intradoc.server.ServiceRequestImplementor.doAction(ServiceRequestImplementor.java:1420)
         at intradoc.server.Service.doAction(Service.java:452)
         at intradoc.server.ServiceRequestImplementor.doActions(ServiceRequestImplementor.java:1194)
         at intradoc.server.Service.doActions(Service.java:447)
         at intradoc.server.ServiceRequestImplementor.executeActions(ServiceRequestImplementor.java:1114)
         at intradoc.server.Service.executeActions(Service.java:433)
         at intradoc.server.ServiceRequestImplementor.doRequest(ServiceRequestImplementor.java:635)
         at intradoc.server.Service.doRequest(Service.java:1707)
         at intradoc.server.ServiceManager.processCommand(ServiceManager.java:359)
         at intradoc.server.IdcServerThread.run(IdcServerThread.java:197)
    Caused by: intradoc.data.DataException: !csMethodNotDefined,invokeESBclient
         at intradoc.server.Service.doCodeEx(Service.java:518)
         at intradoc.server.Service.doCode(Service.java:472)
         at intradoc.server.ServiceRequestImplementor.doAction(ServiceRequestImplementor.java:1353)
         ... 9 more

    Answers to your questions:
    1. Yes i have compiled the java files, more than once again just to confirm. I unit tested the class by running as a java application before using it in the component.
    2. No, but I did do it after you suggested it. I still get the same error.
    3. Yes classes directory has been added to y components custom classpath.
    4. No, i have not sacified 5.25 in floppy but at this point is I am willing to sacrifice my whole laptop.
    Within the component I have directory named classes and directory name invokeESBClient and then
    component
    ..........classes
    .................invokeESBClient
    .........................InvokeESBClient.class
    .........................InvokeESBClient.java
    This is the contents of resource table
    Resource Tables
    Merge To: ServiceHandlers
    <@table Java_Method_Call@>
    <table border=1><caption><strong>
    <tr>
    <td>serviceName</td><td>handler</td> <td>searchOrder</td>
    </tr>
    <tr>
    <td>DocService</td> <td>invoiceESBClient.InvokeESBClient</td> <td>5</td>
    </tr>
    <@end@>
    I hope this provides enough information.

  • Access custom service method

    in a jsf backing bean, i'm getting a reference to the application module (in order to call a custom service method and pass in parameters) in the following way:
    FacesContext fc = FacesContext.getCurrentInstance();
    ValueBinding vb = fc.getApplication().createValueBinding("#{data.LoginServiceDataControl.dataProvider}");
    LoginService service = (LoginService)vb.getValue(fc);
    I find myself rewriting this code over and over to get a reference to the application module. Researching this to find a better way, I saw a thread that suggested using the following code:
    MyAM appModule = (MyAM) getBindings().getDataControl().getApplicationModule();
    I've added the oracle.binding.BindingContainer bindings property to my backing bean, along with getters/setters. However, when i call getBindings(), I do not see getDataControl() as an option with the code insight dialog that pops up. Can someone tell me a clean/efficient way to access a custom service method and pass in appropriate parameters from a backing bean? Thanks.

    Jammer,
    It is not best practice to use the second way you suggest.
    If you are repeating writing code like that, the best thing is to create a helper class.
    For example, I use the helper class that I posted here:
    http://radio.weblogs.com/0118231/stories/2006/12/18/sourceForMyFavoriteElHelperClass.html
    Using that class, I do what you're doing with one line like this:
      LoginService ls = (LoginService)EL.get("#{data.LoginServiceDataControl.dataProvider}}");Alternatively, if you will be doing this a lot in your backing beans, one thing you can consider is creating yourself a base class for all your backing beans to inherit from that can contain helper methods to simply their individual code.
    For example, if you had a class like:
    public class MyBackingBeanBase {
      protected LoginService getLoginService() {
        return (LoginService)EL.get("#{data.LoginServiceDataControl.dataProvider}}");
    }Then any one of your backing beans for a specific page can extend this class and simply call getLoginService() to have typesafe access to the LoginService interface.

  • How to call a bean method in the faces-config file?

    Hi,
    I would like in my menu to call the method of a bean (it initialize some properties before opening the page) instead of opening directly the page, by I can't find how to do that.
    I tried :
    <managed-property>
    <property-name>viewId</property-name>
    <value>#{listInformationsController.listInformations}</value>
    </managed-property>
    And :
    <managed-property>
    <property-name>outcome</property-name>
    <value>#{listInformationsController.listInformations}</value>
    </managed-property>
    With no success...
    Can someone help me?
    Thank you and merry christmas !

    Hi,
    a managed property only gives you a anlde to a bean or property, it doesn't execute it. To execute a bean, you can use a custom JSF PhaseListener that calls a bean method. The reference to the bean is achieve through value binding
    ValueBinding vb = FacesContect.getCurrentInstance().getApplication().createValueBinding("Name of Managed Bean);
    TypeOfBean theBean =(TypeOfBean) vb.getValue(FacesContext.getCurrentInstance());
    .... theBean.theMethod() ...
    Frank

Maybe you are looking for