How do I commit with JSF + ADF Buisness components

Hello
I following the Building Oracle ADF Applications: Workshop found at
http://www.oracle.com/technology/obe/obe9051jdev/ADFWorkshop/BuildingADFApplicationsWorkshop.htm
Instead of JSP and Struts I'm using ADF Faces.
I'm now doing the "are you sure" page where you confirm that you want to delete a customer. I've added a button to do the delete with the ActionListner : #{bindings.Delete.invoke} but I need to be able to do a Commit afterwards.
Could somebody explain how this is done (I new to Jdeveloper, comming from a
Delphi background).
Thanks is advance
Paul

First, if you're using 10.1.3, I'd recommend the 10.1.3 OBE here so that you're following a JSF-based tutorial that corresponds with the latest-and-greatest 10.1.3 features:
http://www.oracle.com/technology/obe/obe1013jdev/masterdetail_adf_bc/master-detail_pagewith_adf_bc.htm
Second, there are a few different approaches you can use for invoking multiple actions from a single button.
(1) The model-centric approach is to add a custom method to your application module that performs the multiple operations over encapsulated inside the AM, mark the method as exposed to clients on the "Client Interface" of the AM, then drop that method as a button from the data control palette.
(2) The controller-centric approach would be to take your existing page, with the "Delete" action binding in your page definition that was created when you dropped the "Delete" action and...
Insert a new "action" binding inside the "bindings" section of your page definition for the "Commit" operation. (By default, it will be named commit). Double-click on your (Delete) button, and allow JDeveloper to create you a method in a JSF backing bean (keeping the [x] Generate ADF Binding Code checkbox checked. Then, in the backing bean, you can find the "Commit" operation binding and invoke it after the "Delete" operation binding has been invoked. The backing bean method will already contain the generated code to invoke the "Delete" operation. You can just copy/paste that and change the name.
There are other more generic approaches, too, but these two ideas should get you started.

Similar Messages

  • Where can get the adftutoial or adfdevguide for TopLink JPA with JSF/ADF ?

    Hello...
    Can anyone suggest me where on OTN I can find the adftutorial and adfdevguide describing developement using Toplink JPA ( EJB 3.0) with JSF/ADF faces ?
    Thanking you in advance,
    Samba

    Hi Samba,
    - Build a Web Application(JSF) using JPA
    - Oracle ADF Developer Guide
    - ADF Learning Center
    Hope it helps!
    Koen

  • Reusable toolbar with Oracle ADF declarative components(ADf code corner)

    Hi All,
    Using Jdeveloper 11.1.1.2.0.
    Following the how to achieve "reusable toolbar with Oracle ADF declarative components" published here
    [http://www.oracle.com/technology/products/jdev/tips/fnimphius/GenericMenuBar/genericMenuBar.html]
    But I am not getting any method parameters under JSP Objects -> Components when binding the buttons toolbar menu buttons.Following is the code I have in my GeneralToolbarComponent.jspx
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <af:componentDef var="attrs" componentVar="component">
    <af:toolbar id="dc_t1">
    <af:commandToolbarButton text="commandToolbarButton 1" id="dc_ctb1"/>
    <af:commandToolbarButton text="commandToolbarButton 2" id="dc_ctb2"/>
    <af:commandToolbarButton text="commandToolbarButton 3" id="dc_ctb3"/>
    <af:commandToolbarButton text="commandToolbarButton 4" id="dc_ctb4"/>
    </af:toolbar>
    <af:xmlContent>
    <component xmlns="http://xmlns.oracle.com/adf/faces/rich/component">
    <display-name>GeneralToolbarComponent</display-name>
    <attribute>
    <attribute-name>DataSet</attribute-name>
    <attribute-class>java.lang.String</attribute-class>
    </attribute>
    <component-extension>
    <component-tag-namespace>component</component-tag-namespace>
    <component-taglib-uri>/VikramLib1</component-taglib-uri>
    <method-attribute>
    <attribute-name>handleFirstMethod</attribute-name>
    <method-signature>void
    handleFirstMethod(javax.faces.event.ActionEvent)</method-signature>
    </method-attribute>
    <method-attribute>
    <attribute-name>handleLastMethod</attribute-name>
    <method-signature>void
    handleLastMethod(javax.faces.event.ActionEvent)</method-signature>
    </method-attribute>
    <method-attribute>
    <attribute-name>handleNextMethod</attribute-name>
    <method-signature>void
    handleNextMethod(javax.faces.event.ActionEvent)</method-signature>
    </method-attribute>
    <method-attribute>
    <attribute-name>handlePreviousMethod</attribute-name>
    <method-signature>void
    handlePreviousMethod(javax.faces.event.ActionEvent)</method-signature>
    </method-attribute>
    </component-extension>
    </component>
    </af:xmlContent>
    </af:componentDef>
    </jsp:root>
    Thanks
    Vikram

    Thanks for the link. We are trying to write a template as described on this link - Help on JSF Page Template
    However we are running in to issues after defining the attribute.
    Can anyone help?
    Thanks
    Ajay

  • Consuming JSF & ADF Faces Components in Portal Page

    I am totally new to Oracle Portal environment and doing some analysis of using Portal in our application.
    I was reading that we can create JSP Portlets like adding scriptlets, expression and other JSP & HTML elements.
    Is it possible to consume JSF & ADF Faces components in Portal page? I mean, is it possible to create JSF Portlets?

    The WSRP provider, which is shipped with Portal 10.1.4, would provide this functionality through the JSF bridge. You need to install Webcenter to get the bridge. This makes me think whether you should use Oracle Portal or rather decide to go for Webcenter as development platform, especially if you have a J2EE background already.

  • How can I can make a pre-commit in jsf adf

    Hi!
    Can anyone help me on how to create a pre-commit jsf adf page.
    thanks in advance..
    alvin

    Hi,
    not sure what a pre-commit page is in your mind. All pages that don't commit to the database are pre-commit.
    With ADF Business Components fro example, all data is first submitted to the ADF BC cache and persisted only if explicitly calling commit.
    Frank

  • How to solve problem with JSF table's border (style) ??

    Hi, I would like to create table in JSF like this
                   <table  align="center"
                             width="250"
                             style="border-collapse: collapse; border: 1px black solid;" >
                   <tr>
                        <td align="center"
                             colspan="2"
                             style="border: 1px black solid;">
                             Header A
                        </td>               
                   </tr>
                   <tr>
                        <td> a1 </td>
                        <td> a2 </td>
                   </tr>
                   <tr>
                        <td> b1 </td>
                        <td> b2 </td>
                   </tr>
                   <tr>
                        <td align="center"
                             colspan="2"
                             style="border: 1px black solid;" >                          
                             <BUTTON value="12" > button1 </BUTTON>
                             <BUTTON value="12">  button2 </BUTTON>
                        </td>
                   </tr>
                   </table>I don't know how to create borders like this with JSF's components.
    I know how to create table and collspan, but I have a problem with
    border and style.
    below is example that I creat it, but borders are not OK
    IF ANYONE FIND SOLUTION I WILL BE TANKFUL
    JSF:
    <hx:panelBox id="box1"
               layout="pageDirection"
               bgcolor="silver"
               align="center"
               style="border: 1px red solid;"
               border="0">
              <hx:panelBox id="box2" layout="pageDirection" width="100%" bgcolor="#aec74e" height="100%" align="center" style="border: 1px black solid;">
                   <center>
                        <h:outputText styleClass="outputText" id="text9" value="Prazniki"></h:outputText>
                   </center>                         
              </hx:panelBox>
              <h:panelGrid styleClass="panelGrid" id="grid1" columns="3">
                   <h:outputText styleClass="outputText" id="text4" value="#{msgs.planDan}">
                   </h:outputText>
                   <h:inputText styleClass="inputText" id="text3" value="#{pc_Koledar.praznikBean.dan}">
                   </h:inputText>
                   <f:verbatim></f:verbatim>
                   <h:outputText styleClass="outputText" id="text5" value="#{msgs.planMesec}">
                   </h:outputText>
                   <h:selectOneMenu styleClass="selectOneMenu" id="menu1" value="#{pc_Koledar.praznikBean.selectedMesec}">          
                    <f:selectItems value="#{pc_Koledar.praznikBean.meseci}" />          
                   </h:selectOneMenu>
                   <f:verbatim></f:verbatim>
                   <h:outputText styleClass="outputText" id="text6" value="#{msgs.planLeto}">
                   </h:outputText>
                   <h:inputText styleClass="inputText" id="text2" value="#{pc_Koledar.praznikBean.leto}">
                   </h:inputText>
                   <f:verbatim></f:verbatim>
                   <h:outputText styleClass="outputText" id="text7" value="#{msgs.nazivPraznika}">
                   </h:outputText>
                   <h:inputText styleClass="inputText" id="text1" value="#{pc_Koledar.praznikBean.nazivPraznika}">
                   </h:inputText>
                   <f:verbatim></f:verbatim>
              </h:panelGrid>
              <hx:panelBox id="box3"           
                         align="center"
                         layout="lineDirection"
                         width="100%"
                         style="border: 1px black solid;" bgcolor="#aec74e">
                        <center>
                          <hx:commandExButton type="submit" value="Dodaj" id="button1" action="#{pc_Koledar.doButton1Action}" lang="CP1250">
                          </hx:commandExButton>
                           <hx:commandExButton type="submit" id="button3" action="#{pc_Koledar.doButton3Action}" value="Prika�">
                          </hx:commandExButton>
                        </center>
              </hx:panelBox>
    </hx:panelBox>

    Couldn't you use styleClass or id for CSS?

  • How to get startet with JSF?

    I really don't know whats up with JSF. Any Tutorial I found referes to WSDP1.2 . But this Version is not accessable anymore. WSDP2.0 iscompletly different to 1.2 .
    Does anyone know, what I have to dowload and Install? I really want to start coding, but I'm stucked in installing software that doesn't work together.
    Is a tutorial out there thats up to date?

    WSDP? WebServices?
    JSF is a web application framework, nothing for WebServices?
    But if you really want to learn JSF, check out this site:
    http://jsftutorials.net/

  • How to connect servlet with jsf

    hello everybody, please help me
    on how to connect jsf to a simple servlet. jsf bean is populated with values entered by user, but to use that bean in servlet i have instantiated new bean object so how i can access values entered by user as bean object contains initial values of variables.
    actually i m developing a sample application jsf as component framework,hibernate as back end layer & spring as middle layer but right now i want to connect jsf to database using servlet & hibernate .So i want to access form bean of jsf so that i want to use form bean to do ORM in hibernate. but how can i get values entered by user in my servlet so that i can set these values in bean object.
    please reply
    Thanks
    Edited by: Manjinder on Oct 15, 2007 6:31 AM

    Please elaborate 'connect' in this context. This sounds a bit odd namely.
    You can invoke a servlet using a plain GET query or a POST query using a <form> element.
    If you're saying that you want to use some business logic which is available in a servlet, then you're looking in the wrong direction. Refactor that business logic in a separate class so that a simple Servlet as well as a JSF backing bean can use that logic. Then you can use JSF h:form with commandButton/Link to invoke the backing bean's action which on its turn invokes that logic.

  • How to do logoff with JSF effectively?

    Assumed I have a page called "myWeb.jsp" and there is a commandLink which links to the "logoff.jsp". The "logoff.jsp" looks as follow:
    <t:commandLink value="return to login" action="#{logoutBean.doLogout}"></t:commandLink>
    The doLogout is in a back bean "logoffbean.java" as follow:
    public String doLogout() {
    // Invalidate the current session and create a new one
    HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
    HttpSession session = request.getSession();
    session.invalidate();
    session = request.getSession(true);
    return "login";
    How can I do in the "myWeb.jsp" so that if one try to open the "myWeb.jsp" it will jump to the "login.jsp". And if one click the "back" on the browser after logoff it will jump to the "login.jsp" as well?

    Off the cuff, I'd say you might be able to implement a Filter that tests if the session is valid. If it is, then it forwards the request to the requested resource, otherwise, redirect the user to the login page.

  • How to control scheme with JSF commandLink/Button tags?

    Ok, so I've a problem using JSF on Sun AS 9.0.1 when deployed behind an SSL accelerator in production.
    Because secure requests get to the app server unencrypted, I am unable to use regular declarative security user-data-constraint/transport-guarantee/CONFIDENTIAL in web.xml, or it gets in an infinite loop redirecting to https.
    Tomcat 5 provides a way to customize the default behavior (see http://www.unc.edu/~adamc/docs/tomcat/tc-accel.html), but I'm not going to be able to use this until Sun AS 9.1 comes out... :(
    So in the meantime, I'd just like to control the schemes on my links and action post, but JSF doesn't seem to support it! <commandLink/Button>s don't seem to allow you to change scheme. If you put a full URL in the action, it fails to lookup the full URL w/ scheme in the faces-config.xml...
    Is this a Glassfish bug or a JSF oversight?
    I'd appreciate any workaround idea the community would be willing to share. :)
    Thank you,

    Hey guyz plzzz help
    In my navigation rule , generally i call any other jsp, instead of it can i call controller servlet ? And now every action corresponding to any button will call this servlet.
    can i call servlet ?

  • Aggregating table - how to solve this with ADF Faces

    Hello.
    I am trying to solve something that would typically be really simple. However, now i' using ADF faces which is new to me and i'm stuck.
    I want to show a table of rows with aggregated numbers (department in example below) and then "open up" any row by clicking on it to display the numbers that make up the aggregate (the guys in the helpdesk department in the example below).
    Something like this:
    DEPARTMENT SALARIES
    +Sales                  1.234.567
    +Warehouse         3.425.553
    -Helpdesk 655.000
    Joe 155.000
    Jill 300.001
    Burt 199.999
    +Personnel           546.225
    +Management     9.646.383
    And to make things more complicated, some of the aggregate rows in my real life example don't have any underlying rows. They just have the total. Can anyone give me hint about how to do this with an ADF Faces-control? I need to show management this can be solved quick and simple with ADF Faces, so i can convince them that it is the way we should be working in the future.
    Edited by: GoodCoffee on Jun 2, 2009 4:15 AM. Trying to indent the three rows under "Helpdesk"

    Hi,
    if you use ADF BC as the business Service then you can create a transient attribute (one that does not ave a database column ) and compute the total. Using JDeveloper 11g, you can use a Groovy expression. The below example calculates the Overall Salary paid by an department. The transient attribute is defined on the Department Entity Object
    XML View
    <Attribute
        Name="SumSalary"
        ColumnName="SUMSALARY"
        SQLType="NUMERIC"
        Type="java.lang.Long"
        ColumnType="NUMBER"
        IsQueriable="false"
        IsPersistent="false">
        <TransientExpression><![CDATA[Employees1.sum("Salary")]]></TransientExpression>
      </Attribute>The Employees1.sum("Salary") string is the Groovy expression that you need to add for the attribute. You select the created transient attribute in the EO editor and press the pencil icon. Then you select "Expression" as the value type and add the string.
    See: http://www.oracle.com/technology/products/jdev/11/how-tos/groovy/introduction_to_groovy.pdf
    Frank

  • JSF/ADF Faces - ADF-BC example/howto?

    Hi,
    Background:
    ==========
    I know that ADF-BC databinding is not included in the JDev 10.1.3 preview.
    I read and searched nearly all howto's, examples, blogs on ADF-Faces available on the net.
    For the past months I learned how to use the ADF-BC with JClient.
    This convinced me to use the ADF-BC and it's binding features (a fantastic framework!!!!) for my model layer.
    I'm developping a web application.
    Most of the examples on ADF-Faces/JSF are on the View Layer.
    My question:
    ===========
    I read somewhere that JDev 10.1.3 production with drag and drop of ADF-BC databinding will be available only in the summer.
    Question 1:
    ==========
    I suppose that meanwhile it is still possible to use the ADF-BC as the model layer for JSF or ADF-Faces, but the databinding must be done manually, is this correct?
    Question 2:
    ==========
    If answer to 1) is yes.
    Where can I find a howto/best practice document that explains how to use ADF-BC with JSF/ADF-Faces in the backing beans?
    My purpose is to develop my code so that it will be "standard" / "compatible" with the production version of JDev 10.1.3.
    I prefer to use the de-facto JSF standard and code the bindings manualy instead of using Struts with available drag'n drop ADF-BC databinding.
    Your advice will be apreciated
    Frederic

    There is no such document for (1) because we are in the process of delivering design time support for ADF BC integration with ADF Faces, as you mentioned.
    Therefore, you could either continue with ADF UIX, ADFm, ADF BC for the time being, or else try out ADF Faces with session scope Managed Beans. In either case, you'll want to convert this later on, when JDev 10.1.3 completes its support for ADF Faces / ADF BC drag-and-drop integration.
    Kind Regards.

  • Information about adf data model's state management in JSF/ADF faces?

    Dear All,
    i am developing an application with JSF/ADF faces + using
    adf data model (EJB, not adf bc)...
    i want to know more about state management of adf data model..
    1. under what condition, will the data in the binding context
    (methodIterator, variableIterator, accessorIterator..etc) be maintained accross
    http requests? say browse pageA.jspx, pageB.jspx, pageC.jspx..then do data
    in the corresponding pages saved somewhere else until session timeout?
    2. how do the binding context data be saved ?? http session?
    i can't find detail information in the adf bc dev guide and the adf dev guide..
    could anyone give me more information about this?? any better document??
    i have asked these question several times...but seem nobody can give me a
    full picture about the adf data model's state management....it is quite important
    in order to develop good application using adf data model.
    my company have brought oracle's support service...can i get these information
    through metalink (open a SR) ?? or actually no such information available ??
    btw, after playing with adf data model for a few weeks, i do find it is very
    hard to learn it... no complete document, information is just by providing example...
    adf data model do make:
    1. simple logic, supported by adf, more simple in coding
    2. simple logic, not supported by adf, more complex in coding
    3. complex logic, much more complex in coding...brain damage..
    lsp

    Hi,
    actually, these pages don't explain the state management about the adf data model's iterators?
    i want to know the state management of the iterators...for some iterators..it's
    state is maintained across requests...
    please see my previous post: ADF JSF data binding: why state maintained between requests? that Frank Nimphius said:
    "in this case its the iterator that survives the page navigation"...
    in the adf dev guide..section 5.5.5..it says: "Upon each request, the iterator bindings are refreshed to rebind them to the
    underlying RowSetIterator objects. By default, the rowset iterator state and the
    data caches are maintained between requests."
    in dev guide, it seems state is maintained for request for the same page, but not
    accross different pages. but in fact, the rowset iterator do survive...
    any detail document that write down the actual behavior of the iterators?
    thank you.
    lsp

  • How to display BLOB image column with WEB application, JSF, ADF BC

    I looking for a way to display the content from a blob column on a WEB application, JSF, ADF BC
    The blob column contains a JPEG image.
    About the application
    The model contains a viewobject where the blob column attribute (photoimg) type is of type : BlobDomain
    Now I have to create the view to display the content of photoimg inside a JSF-JSP page.
    Any advice ?

    Search is your friend
    How to display the content of a BLOB column in a ADF/BC pages ?
    John

  • ADF with JSF: How to execute a Sql statement created in a form

    Hello to every body,
    I'm working in JDeveloper 11.1.2.1.0, I have to do a development when the user can create a SQL statement and I have execute that before to do commit to the DB(Oracle DB).
    Example:
    The user create the next query:
    "+Select id_boss, boss_name from boss where boss_salary>5000+"
    I don't know how to do that with the current persistence and without create a Connection Method.

    The video tutorial is excellent but I have a problem because I'm working with Release 2 and when I try to do something like the video I had the next error:
    FachadaConsultaLocalImp cannot be cast to ApplicationModule
    the code to try to create a ViewObject is the next:
    DCDataControl dc = this.getBinding().findDataControl("FachadaConsultaLocal");
    String dataProvider=dc.getDataProvider().toString();
    ApplicationModule appModule = (ApplicationModule)dc.getDataProvider();
    Some idea?

Maybe you are looking for