Questions in ADF (ViewObjectImpl VS ViewObject) -- (Row VS ViewRowImpl)

I have some confusion between (ViewObjectImpl VS ViewObject) -- (Row VS ViewRowImpl)
this is the code i mean this code from oracle slides
public void init() {
DBTransactionImpl trx = (DBTransactionImpl)getDBTransaction();
ApplicationModuleImpl am =(ApplicationModuleImpl)trx.getRootApplicationModule();
String user = am.getUserPrincipalName().toUpperCase();
System.out.println("The session user is: " + user);
ViewObjectImpl vo;
vo = getShoppingCart1();
String bindUser =(String)vo.getNamedWhereClauseParam("CurrentUser");
if (! user.equals(bindUser)) {
vo.setNamedWhereClauseParam("CurrentUser", user);
vo.executeQuery();
Row cart = vo.first();
if (cart == null) {
cart = vo.createRow();
cart.setAttribute("OrderDate",
((DBTransactionImpl)getDBTransaction()).getCurrentDbTime());
cart.setAttribute("OrderStatusCode", "CART");
vo.insertRow(cart);
this is another code from the slides
public void addItemToCart(Number productId) {
init();
ViewObject shoppingCartVO = getShoppingCart1();
assert shoppingCartVO != null;
ViewRowImpl shoppingCartRow =(ViewRowImpl)shoppingCartVO.first();
assert shoppingCartRow != null;
OrderEOImpl orderEO = (OrderEOImpl)shoppingCartRow.getEntity(0);
orderEO.addItemToOrder(productId);
in the first code getShoppingCart1(); returned ViewObjectImpl
in the second getShoppingCart1(); returned ViewObject
in the first code vo.first(); returned Row ;
in the seconde Returned ViewRowImpl ;
i want to know why and what is the difference
and in general when i use class and use classImpl what is the difference in general
and row and viewrowimpl
and why i wrote this tow lines
DBTransactionImpl trx = (DBTransactionImpl)getDBTransaction();
ApplicationModuleImpl am =(ApplicationModuleImpl)trx.getRootApplicationModule();
and what is the meaning of gerRootApplicaitoinModule(); what this will return

Briefly, ViewObject is an interface and ViewObjectImpl is (one of) its implementations.
Same with Row and ViewRowImpl.
You might need a good lesson in [object orientation and inheritance |http://en.wikipedia.org/wiki/Inheritance_%28computer_science%29]
and what is the meaning of gerRootApplicationModule(); what this will returnApplicationModules can be [ nested under one another|http://radio.weblogs.com/0118231/stories/2005/07/19/nestedApplicationModules.html] (to reuse business functionality).
[getRootApplicationModule()|http://download.oracle.com/docs/cd/E15051_01/apirefs.1111/e10653/oracle/jbo/server/ComponentObjectImpl.html#getRootApplicationModule%28%29] returns the topmost AM which is not nested under any other one.

Similar Messages

  • Some Question in ADF

    Hi,
    I have some questions in adf for which i do not know proper answers ... Can someone please let me know on the below mentioned questions
    1. What are style sheets in adf ?
    2. what is transaction handling in adf ?
    3. what are adf declarative components ?
    4. how to display radio button in af:query
    5. what is discriminator and change indicator in EO ?
    Thanks,

    4.how to display radio button in af:queryNot possible .. see comments and thread reference @ Re: radio buttons in af:query
    5. what is discriminator and change indicator in EO ?Discriminator is used to setup polymorphic EOs. Change Indicator in EO is used to compare the row in Entity Cache with one in DB to find out if it has changed.
    http://mjabr.wordpress.com/2011/06/10/what-is-change-indicator-property/
    http://mjabr.wordpress.com/2011/06/17/using-discriminator-columns/
    3. what are adf declarative components ?
    Quoting Frank - Declarative components allow developers to build a composite component out of existing ADF Faces components.
    from https://blogs.oracle.com/jdevotnharvest/entry/about_jsf_fragments_adf_regions_declarative_components
    Building them - http://www.oracle.com/technetwork/developer-tools/jdev/declarative-component-adf-084567.html
    For other questions did you first try to go through the documentation or do a basic search ? ... these are pretty broad topics and you would need to do a bit of research on them your self.

  • What's the right OTN-forum for questions on ADF?

    Hi,
    my question? Look at the subject...
    "What's the right OTN-forum for questions on ADF?"

    this... :)

  • ADF Toy Store : create row : problem scenario

    hi (Steve)
    While experimenting with the ADF Toy Store Demo (*1) I tried this scenario:
    (1) Use the "Sign In" icon to navigate to "Register as a New User".
    (2) Without entering data into the input fields, click the "Register" button. You will get errors for the required fields.
    (3) (You change your mind about registering.) Click on "Games".
    (4) (You see a nice game, so you still want to register.) Use the "Sign In" icon to navigate to "Register as a New User".
    (5) Be nice and fill out all the fields and click the "Register" button.
    [!] This will result in errors for the required fields (although you filled out all of them).
    My guess is these errors are related to the first "account row" that was created.
    Could someone suggest a "best practice" approach to avoid problems like these?
    thanks
    Jan Vervecken
    *1 : http://www.oracle.com/technology/products/jdev/collateral/papers/10g/adftoystore.html
    * : using JDeveloper 10.1.2 and ADF Toy Store 9.0.5.2.31 (Built on 21-Jun-2004)

    thanks for your reply Steve
    (1st) I've updated ToyStoreServiceImpl like you suggested:
      public boolean validSignon(String username, String password) {
        System.out.println("validSignon() : begin");
        removeAnyInvalidNewAccounts();
        return getAccounts().findAccountByUsernamePassword(username, password);
      public void prepareToCreateNewAccount() {
        System.out.println("prepareToCreateNewAccount() : begin");
        removeAnyInvalidNewAccounts();
        ViewObject vo = getAccounts();
        vo.clearCache();
         * Mark the view object as insert only by setting
         * it's max fetch size to zero. Executing the query
         * when the max fetch size is zero won't actually
         * perform any query, but will mark the VO as
         * executed so the ADF binding layer will know it
         * doesn't need to re-execute it later.
        vo.setMaxFetchSize(0);
        vo.executeQuery();
        Row newRow = vo.createRow();
        vo.insertRow(newRow);
        newRow.setNewRowState(Row.STATUS_INITIALIZED);
        vo.setCurrentRow(newRow);
        System.out.println("newRow = " + newRow);
        System.out.println("prepareToCreateNewAccount() : end");
       * Purge any new but invalid AccountImpl (and associated SignInImpl) instances
       * from the Entity Cache. These could get into the system if the user visits
       * the "Register a New User" page, enters invalid data and submits, but
       * instead of fixing the invalid data, click on another link to sign-in
       * as another valid account instead.
      private void removeAnyInvalidNewAccounts() {
        System.out.println("removeAnyInvalidNewAccounts() : begin");
        EntityDefImpl def = AccountImpl.getDefinitionObject();
        com.sun.java.util.collections.Iterator iter = def.getAllEntityInstancesIterator(getDBTransaction());
        while (iter.hasNext()) {
          AccountImpl acct = (AccountImpl) iter.next();
          System.out.println("considering acct = " + acct);
          if (acct.isInvalid() && (acct.getEntityState() == Entity.STATUS_NEW)) {
            System.out.println("removing acct = " + acct);
            acct.remove();
            acct.getSignon().remove();
        System.out.println("removeAnyInvalidNewAccounts() : end");
      //...(2nd) I've followed the original problem scenario I described at the beginning of this thread:
    (1) Use the "Sign In" icon to navigate to "Register as a New User".
    (2) Without entering data into the input fields, click the "Register" button. You will get errors for the required fields.
    (3) (You change your mind about registering.) Click on "Games".
    (4) (You see a nice game, so you still want to register.) Use the "Sign In" icon to navigate to "Register as a New User".
    (5) Be nice and fill out all the fields and click the "Register" button.
    [!] This will result in errors for the required fields (although you filled out all of them).
    (3rd) That results in this output:
    prepareToCreateNewAccount() : begin
    removeAnyInvalidNewAccounts() : begin
    removeAnyInvalidNewAccounts() : end
    newRow = toystore.model.dataaccess.AccountsRowImpl@1
    prepareToCreateNewAccount() : end
    prepareToCreateNewAccount() : begin
    removeAnyInvalidNewAccounts() : begin
    removeAnyInvalidNewAccounts() : end
    newRow = toystore.model.dataaccess.AccountsRowImpl@18b
    prepareToCreateNewAccount() : end
    questions
    (1) I never seem to enter the while loop of your removeAnyInvalidNewAccounts() method, how come?
    (2) Although my scenario never signs in with another valid account, do you consider my scenario to be similar to the one you describe in your comment for the removeAnyInvalidNewAccounts() method?
    (3) In general, if creating (and inserting) new rows should be accompanied with methods like removeAnyInvalidNewEntityXs(), what would be the "rule of thumb" to determine where to call these methods? It is my impression that such methods should be inserted in different places to account for all the scenarios (paths in the application) a user can follow (and you better forget none).
    thanks
    Jan

  • Questions on ADF View Objects, Links and Iterators

    I have a number of questions regarding using ViewObjects in applications where there are alot of relationships between tables.
    First, lets say that I have ViewObject SomeView that was added to the App Module (AM) as VO1. And because it has a number of "detail" records that have to be iterated through in a "report like" view it has those other VO's added under it as "children" in the AM.
    So I have
    VO1 (an instance of SomeView)
    --> VO2 (an instance of some other view)
    --> VO3 (an instance of some other view)
    that is used on pages where only a single VO1 is shown at a time.
    Now because I had another page I wanted to make that had a listing of all SomeView objects. Some of the fields in SomeView are foreign keys to records in VO2 and VO3 and while I don't want to show all the fields from VO2 and VO3, I do want to show a name field from each rather than just the foreign key.
    My experience (though I've never read this anywhere) tells me that when doing a "table" that is a list of rows from a VO, you can't display info from the child VO's because the child VO's are on whatever record corresponds to the "currentRow" in the parent VO and just displaying the rows in a rangeSet doesn't make each the "currentRow" so even we display 10 records in a for loop, the "currentRow" is just one, and the child VO's iterators aren't moved as we go through the for loop. (Can someone confirm if I am correct on this conclusion????)
    So the only way I know of to show some field from a related table in each row is to make the VO have the entity objects from the related tables be part of the view as references. Is this the only way?
    If I do that on a view that didn't have other views as children defined in the AM I don't have any problem and it works like I want.
    But if I do it on a view that did have other views as children defined in the AM it makes the page(s) using that view with the children iterators behave badly. Half the information quits showing up, etc.
    For example, ... if I go to the "SomeView" which was defined with only one entity object association, and I add the entity objects (that are the basis of instances of VO2 and VO3 ) as referenceable only, it totally breaks the page where I display a single VO1 and use it's VO2 and VO3 children. IS THIS NORMAL OR AM I MISSING SOMETHING?
    So, is the solution that I have to have more view objects defined for different purposes ?
    Can anyone give any general guidelines for when/where to use different view objects vs. when to use different iterators. I'm not having much luck with using secondary RSI's and haven't found much info on them.
    Also, how about issues of naming iterators that are in various binding containers (ie. UI Model for a page). If I do and LOV it creates an iterator and gives it a default name like ViewNameIterator1. If I already have a different page that uses a regular (non LOV) iterator with that name, and the user goes back and forth between those pages, is that a clash?
    Finally, I've read a couple of Steve Muench's blogs on View Link consistency but I'm not sure what the rules are on when it applies and doesn't. How you turn it on or off, etc. One of his examples in http://radio.weblogs.com/0118231/2004/02/27.html talks about it in the context of two view objects that are NOT typically "linked" in a master/detail kind of way. Like an AllDepartments and a DepartmentsLessThan view. Do you have to create a View Link between them to have results of one be reflected in the other if they aren't used in the same page in a web app? Or does it happen automatically (with the caveat that you have to do the rowQualifies method). Just feels like I'm missing some pieces.
    Thanks in advance,
    Lynn

    Hi,
    I am also interested in a best-practice note from oracle.
    Currently we store history in seperate history tables for columns that changed. All this implemented in our BaseEoImpl overriding the EntityImpl.prepareForDML().
    Thanks

  • Limiting ADF table number of rows is not working

    Dear All,
    I know this question might seems to be a little bit trivial but I have been going in circles for a long time now and can't figure out where I'm going wrong, I'm using Jdeveloper 11g TP4 and developing an ADF RC application, I have a table that I need to limit the number of rows displayed in this table to X number of records and incase the result is more than X navigation buttons should be displayed, I changed the rows attribute in the af:table tag to say 2 but the table is still being displayed with all the rows, could someone please explain where is the missing piece?
    The code looks like the following:
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <f:view>
    <af:document>
    <af:messages/>
    <af:form>
    <af:panelStretchLayout>
    <f:facet name="center">
    <af:table value="#{bindings.allOperators.collectionModel}" var="row"
    emptyText="#{bindings.allOperators.viewable ? 'No rows yet.' : 'Access Denied.'}"
    fetchSize="#{bindings.MnpRequest.rangeSize}" rows="2" first="0"> <f:facet name="detailStamp">
    <af:panelFormLayout>
    <af:inputText value="#{bindings.operatorCode.inputValue}"
    label="#{bindings.operatorCode.label}"
    required="#{bindings.operatorCode.mandatory}"
    columns="#{bindings.operatorCode.displayWidth}">
    <f:validator binding="#{bindings.operatorCode.validator}"/>
    </af:inputText>
    <af:inputText value="#{bindings.operatorId.inputValue}"
    label="#{bindings.operatorId.label}"
    required="#{bindings.operatorId.mandatory}"
    columns="#{bindings.operatorId.displayWidth}">
    <f:validator binding="#{bindings.operatorId.validator}"/>
    <af:convertNumber groupingUsed="false"
    pattern="#{bindings.operatorId.format}"/>
    </af:inputText>
    <af:inputText value="#{bindings.operatorName.inputValue}"
    label="#{bindings.operatorName.label}"
    required="#{bindings.operatorName.mandatory}"
    columns="#{bindings.operatorName.displayWidth}">
    <f:validator binding="#{bindings.operatorName.validator}"/>
    </af:inputText>
    <af:inputText value="#{bindings.routeId.inputValue}"
    label="#{bindings.routeId.label}"
    required="#{bindings.routeId.mandatory}"
    columns="#{bindings.routeId.displayWidth}">
    <f:validator binding="#{bindings.routeId.validator}"/>
    </af:inputText>
    <af:inputText value="#{bindings.mmcCode.inputValue}"
    label="#{bindings.mmcCode.label}"
    required="#{bindings.mmcCode.mandatory}"
    columns="#{bindings.mmcCode.displayWidth}">
    <f:validator binding="#{bindings.mmcCode.validator}"/>
    </af:inputText>
    </af:panelFormLayout>
    </f:facet>
    <af:column sortProperty="operatorCode" sortable="false"
    headerText="#{bindings.allOperators.hints.operatorCode.label}">
    <af:outputText value="#{row.operatorCode}"/>
    </af:column>
    <af:column sortProperty="operatorId" sortable="false"
    headerText="#{bindings.allOperators.hints.operatorId.label}">
    <af:outputText value="#{row.operatorId}">
    <af:convertNumber groupingUsed="false"
    pattern="#{bindings.allOperators.hints.operatorId.format}"/>
    </af:outputText>
    </af:column>
    <af:column sortProperty="operatorName" sortable="false"
    headerText="#{bindings.allOperators.hints.operatorName.label}">
    <af:outputText value="#{row.operatorName}"/>
    </af:column>
    <af:column sortProperty="routeId" sortable="false"
    headerText="#{bindings.allOperators.hints.routeId.label}">
    <af:outputText value="#{row.routeId}"/>
    </af:column>
    <af:column sortProperty="mmcCode" sortable="false"
    headerText="#{bindings.allOperators.hints.mmcCode.label}">
    <af:outputText value="#{row.mmcCode}"/>
    </af:column>
    </af:table>
    </f:facet>
    </af:panelStretchLayout>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    Thanks,
    Amr.

    Hi Frank,
    is there any other solution to this problem?
    Thank you

  • ADF/BC4J fetches all rows, should fetch only if needed

    Hello,
    I'm using JDeveloper 10.1.2. Technologies are Struts, ADF and BC4J.
    I have a problem with viewObjects. I have created components from database tables. I'm fetching in appModuleImpl:
    ViewObjImpl impl = getObjectViewImpl();
    impl.setWhereClause("id=101");
    impl.executeQuery();Problem is that when page is loaded, it fetches ALL ROWS (80 000 rows)from table and then makes another query to fetch group above. I want only fetch rows that i decide to fetch. My application is in immediate mode. Couple of iterators has fetch range -1 and couple 10.
    I have debugged that the first ALL ROWS fetch is made somewhere out of my code.
    What i'm doing wrong? Any feature development hints are welcome also.
    Thank you advance!
    null

    hello
    First of all thank you for commenting on my timeout post
    I think i have a solution for you problem.
    If i understand you correctly, when the page is loaded, you only want the framework to only fetch one page worth of rows, look yahoo and google. Then when you select another page, you want the other records to be fetch.
    public void executeQuery() {
    setAccessMode(RowSet.RANGE_PAGING); //shall do the trick
    super.executeQuery();
    Djbo.debugoutput=console
    SELECT * FROM (SELECT /*+ FIRST_ROWS */ IQ.*, ROWNUM AS Z_R_N FROM (select * from emp) IQ WHERE ROWNUM < :0) WHERE Z_R_N > :1
    [253] Bind params for ViewObject: ViewObj1
    [254] setting rownum query between (0, 4)
    As shown above, the query is designed to only fetch 4 rows and this is managed by manipulating the ROWNUM.
    When you run it the page will only display RANGE_PAGE only execpt of the 80,000 and your first page will run very fast
    This will cause a database hit each time you select another page! If you ask the framework designer, i bet, they shall tell you we are avoiding database hits with this. My answer to them, who would go about navigation all pages anyway!
    Kindly comment if the code above solved your issue or not
    Ammar Sajdi
    Amman - Jordan

  • Refresh adf table and selection row

    Hi,
    I create web application. I have created entity Users from MySQL database and managed Bean. In this managed Bean (sessionScope) is method for connection to database and method for adding new row (data) in database. It works.
    I have 2 problems.
    The first.
    I have form for adding User and commandButton Add.
    How I can refresh (update) adf table after executing SQL command (in commandButton Add) ? Now I must reconnect session.
    The second problem:
    I want to show a panel with data from one row from adf table.
    How I can selection this row in popup ?
    My table:
    <af:table var="user" rowBandingInterval="0" id="t2"
                                                  inlineStyle="margin:20px 30px; width:578pt; height:160pt;"
                                                  value="#{userController.users}"
                                                  rows="15"
                                                  emptyText="#{bindings.UsersprototypView11.viewable ? 'No data to display.' : 'Access Denied.'}"
                                                  fetchSize="#{bindings.UsersprototypView11.rangeSize}"
                                                  editingMode="clickToEdit" rowSelection="single"
                                                  selectedRowKeys="#{userController.selectedUser}"
                                                  selectionListener="#{userController.selectedUser}"> ---- Here I have problem.
                                            <af:column sortProperty="#{user.user_id}"
                                                       sortable="false"
                                                       headerText="ID"                            
                                                       id="c11" width="33">
                                                <af:commandLink id="ot34" text="#{user.user_id}">
                                                    <af:showPopupBehavior popupId="p4" triggerType="action"/>
                                                </af:commandLink>
                                            </af:column>
                                            <af:column sortProperty="#{user.firstname}"
                                                       sortable="false"
                                                       headerText="Firstname"
                                                       id="c20" width="111">
                                                <af:outputText value="#{user.firstname}" id="ot27"/>
                                            </af:column>
                                            <af:column sortProperty="#{user.lastname}"
                                                       sortable="false"
                                                       headerText="Lastname"
                                                       id="c12">
                                                <af:outputText value="#{user.lastname}" id="ot31"/>
                                            </af:column>
                                            <af:column sortProperty="#{user.address}"
                                                       sortable="false"
                                                       headerText="Address"
                                                       id="c9" width="95">
                                                <af:outputText value="#{user.address}" id="ot32"/>
                                            </af:column>
                                            <af:column sortProperty="#{user.city}"
                                                       sortable="false"
                                                       headerText="#City"
                                                       id="c10" width="76">
                                                <af:outputText value="#{user.city}" id="ot33"/>
                                            </af:column>
                                            <af:column sortProperty="#{user.username}"
                                                       sortable="false"
                                                       headerText="Username"
                                                       id="c7" width="102">
                                                <af:outputText value="#{user.username}" id="ot29"/>
                                            </af:column>
                                            <af:column sortProperty="#{user.email}"
                                                       sortable="false"
                                                       headerText="E-mail"
                                                       id="c21" width="106">
                                                <af:outputText value="#{user.email}" id="ot28"/>
                                            </af:column>
                                            <af:column sortProperty="#{user.regdate}"
                                                       sortable="false"
                                                       headerText="Registration"
                                                       id="c8" width="108">
                                                <af:outputText value="#{user.regdate}" id="ot30">
                                                    <af:convertDateTime pattern="#{user.regdate}"/>
                                                </af:outputText>
                                            </af:column>
                                        </af:table>userController is name managed Bean.
    users is list of users.
    My panel window (popup):
    <af:popup childCreation="deferred" autoCancel="disabled" id="p4">
                                        <af:panelWindow id="pw9" title="Delete user">
                                            <af:panelFormLayout id="pfl6">
                                                <af:panelLabelAndMessage label="ID:"
                                                                         id="plam16">
                                                    <af:outputText value="#{userController.selectedUser.user_id}" id="ot50"/>
                                                </af:panelLabelAndMessage>
                                                <af:panelLabelAndMessage label="Firstname:"
                                                                         id="plam17">
                                                    <af:outputText value="#{userController.selectedUser.firstname}" id="ot51"/>
                                                </af:panelLabelAndMessage>
                                                <af:panelLabelAndMessage label="Lastname:"
                                                                         id="plam18">
                                                    <af:outputText value="#{userController.selectedUser.lastname}" id="ot52"/>
                                                </af:panelLabelAndMessage>
                                                <af:panelLabelAndMessage label="Address:"
                                                                         id="plam19">
                                                    <af:outputText value="#{userController.selectedUser.address}" id="ot53"/>
                                                </af:panelLabelAndMessage>
                                                <af:panelLabelAndMessage label="City:" id="plam20">
                                                    <af:outputText value="#{userController.selectedUser.city}" id="ot54"/>
                                                </af:panelLabelAndMessage>
                                                <af:panelLabelAndMessage label="Username:"
                                                                         id="plam21">
                                                    <af:outputText value="#{userController.selectedUser.username}" id="ot55"/>
                                                </af:panelLabelAndMessage>
                                                <af:panelLabelAndMessage label="E-mail:" id="plam22">
                                                    <af:outputText value="#{userController.selectedUser.email}" id="ot56"/>
                                                </af:panelLabelAndMessage>
                                                <af:panelLabelAndMessage label="Registration:"
                                                                         id="plam23">
                                                    <af:outputText value="#{userController.selectedUser.regdate}" id="ot57">
                                                        <af:convertDateTime pattern="#{userController.selectedUser.regdate}"/>
                                                    </af:outputText>
                                                </af:panelLabelAndMessage>
                                            </af:panelFormLayout>
                                            <af:commandButton text="Delete" id="cb18"
                                                              inlineStyle="width:80pt; margin:10px 0px 0px 0px;"/>
                                        </af:panelWindow>
                                    </af:popup>When I cut out row: selectionListener="#{userController.selectedUser}
    Popup (for deleting user) looks like this:
    http://imageshack.us/photo/my-images/404/popupc.jpg/
    I need to get the outputs from <af:outputText> in this popup.
    Thanks for help.
    Edited by: user9202624 on 26.2.2013 7:52

    thanks for answer.
    I added partialTriggers in af:table
    <af:table var="user" rowBandingInterval="0" id="t2"
                                                  inlineStyle="margin:20px 30px; width:578pt; height:160pt;"
                                                  value="#{userController.users}"
                                                  rows="15"
                                                  emptyText="#{bindings.UsersprototypView11.viewable ? 'No data to display.' : 'Access Denied.'}"
                                                  fetchSize="#{bindings.UsersprototypView11.rangeSize}"
                                                  editingMode="clickToEdit" rowSelection="single"
                                                  selectedRowKeys="#{userController.selectedUser}"
                                                  partialTriggers="::t1" >What next ? What should I do next ? Sry, I'm newbie in adf and jDev.
    Edited by: user9202624 on 26.2.2013 8:55

  • Issue in retrieving all the records from ADF Table with multiple row

    Hi,
    As per my requirement, I need to fill the table with multi selected LOV values and when user clicks on commit, I need to save them to database.
    I am using ADF 11g, Multi select table. Using the below ADD method, I am able to add the records but if user clicks on cancel, I need to remove those from view and clear the table as well.
    But the Issue I am facing is, in my cancel method, always I am getting half of the records. Lets assume table contains 100 records but in my cancel method, I am getting only 50 records.
    Please let me know what is the issue in my source code.
    ADD Method:
    public void insertRecInCMProcessParamVal(String commType, String processType, Number seqNumber){       
    try{
    Row row = this.getCmProcessParamValueView1().createRow();
    row.setAttribute("ParamValue7", commType);
    row.setAttribute("ProcessType", processType);
    row.setAttribute("CreationDate", new Date());
    row.setAttribute("CreatedBy", uid);
    row.setAttribute("ParamValueSeqNum", seqNumber);
    row.setAttribute("ProcessedFlag", "N");
    this.getCmProcessParamValueView1().insertRow(row);
    }catch(Exception e){           
    e.printStackTrace();
    Table Code:
    <af:table value="#{bindings.CmProcessParamValueView11.collectionModel}"
    var="row"
    rows="#{bindings.CmProcessParamValueView11.rangeSize}"
    emptyText="#{bindings.CmProcessParamValueView11.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.CmProcessParamValueView11.rangeSize}"
    rowBandingInterval="1"
    selectedRowKeys="#{bindings.CmProcessParamValueView11.collectionModel.selectedRow}"
    selectionListener="#{bindings.CmProcessParamValueView11.collectionModel.makeCurrent}"
    rowSelection="multiple"
    binding="#{backingBeanScope.backing_app_RunCalcPage.t1}"
    id="t1" width="100%" inlineStyle="height:100px;" >
    <af:column sortProperty="ParamValue6"
    sortable="true"
    headerText="#{bindings.CmProcessParamValueView11.hints.ParamValue6.label}"
    id="c1" visible="false">
    <af:inputText value="#{row.bindings.ParamValue6.inputValue}"
    label="#{bindings.CmProcessParamValueView11.hints.ParamValue6.label}"
    required="#{bindings.CmProcessParamValueView11.hints.ParamValue6.mandatory}"
    columns="#{bindings.CmProcessParamValueView11.hints.ParamValue6.displayWidth}"
    maximumLength="#{bindings.CmProcessParamValueView11.hints.ParamValue6.precision}"
    shortDesc="#{bindings.CmProcessParamValueView11.hints.ParamValue6.tooltip}"
    id="it3">
    <f:validator binding="#{row.bindings.ParamValue6.validator}"/>
    </af:inputText>
    </af:column>
    <af:column sortProperty="ParamValue7"
    sortable="true"
    headerText="Comm Type"
    id="c2">
    <af:inputText value="#{row.bindings.ParamValue7.inputValue}"
    label="#{bindings.CmProcessParamValueView11.hints.ParamValue7.label}"
    required="#{bindings.CmProcessParamValueView11.hints.ParamValue7.mandatory}"
    columns="#{bindings.CmProcessParamValueView11.hints.ParamValue7.displayWidth}"
    maximumLength="#{bindings.CmProcessParamValueView11.hints.ParamValue7.precision}"
    shortDesc="#{bindings.CmProcessParamValueView11.hints.ParamValue7.tooltip}"
    id="it4">
    <f:validator binding="#{row.bindings.ParamValue7.validator}"/>
    </af:inputText>
    </af:column>
    <af:column sortProperty="ParamValue8"
    sortable="true"
    headerText="#{bindings.CmProcessParamValueView11.hints.ParamValue8.label}"
    id="c3" visible="false">
    <af:inputText value="#{row.bindings.ParamValue8.inputValue}"
    label="#{bindings.CmProcessParamValueView11.hints.ParamValue8.label}"
    required="#{bindings.CmProcessParamValueView11.hints.ParamValue8.mandatory}"
    columns="#{bindings.CmProcessParamValueView11.hints.ParamValue8.displayWidth}"
    maximumLength="#{bindings.CmProcessParamValueView11.hints.ParamValue8.precision}"
    shortDesc="#{bindings.CmProcessParamValueView11.hints.ParamValue8.tooltip}"
    id="it2">
    <f:validator binding="#{row.bindings.ParamValue8.validator}"/>
    </af:inputText>
    </af:column>
    </af:table>
    Backing Bean Code:
    DCBindingContainer dcBindings=(DCBindingContainer)getBindings();
    DCIteratorBinding dcIterator=dcBindings.findIteratorBinding("CmProcessParamValueView1Iterator");
    RowSetIterator rs = dcIterator.getRowSetIterator();
    System.out.println("In Cancel Row Count is : "+ rs.getRowCount());
    if (rs.getRowCount() > 0) {
    Row row = rs.first();
    row.refresh(Row.REFRESH_UNDO_CHANGES);
    row.remove();
    while (rs.hasNext()) {
    int count = rs.getRowCount();
    System.out.println("Count is : "+ count);
    Row row = rs.next();
    System.out.println("Row === "+ row);
    if(row != null){                   
    row.refresh(Row.REFRESH_UNDO_CHANGES);
    row.remove();
    Thanks.

    Issue resolved.
    remove selectionListener and selectedRowKeys....
    code to get all the selectedRows.
    RowSetIterator rs = dcIterator.getRowSetIterator();
    RowKeySet rks = this.t1.getSelectedRowKeys();
    Iterator rksIter = rks.iterator();
    while (rksIter.hasNext()) {
    List l = (List) rksIter.next();
    Key key = (Key)l.get(0);
    Row row = rs.getRow(key);
    Thanks.

  • [Swing ADF] add a new row based on existing one

    Hi all,
    I start with ADF and here is my problem:
    In a swing ADF application, I'd like to allow user to create new records based on a record already present in the DB. The user selects a record in the data table and then push a button that fill in some JTextField. He can then change whatever he wants. These JTextField are in fact arguments of a method of my Application Module. Then, when a button "add", that is created by drag and drop the method, is pushed, the method of the AM is called.
    The problem is: argument are null. This occure when I fill in the gap (JTextField) programmatically (by getting the currentRow of the iterator of the table). But if the user fill in the gap himself, then arguments are not null.
    Is there someone to help me?
    Thanks a lot!
    Regards

    Hi,
    I created the method, dragged the arguments as textFields and added the method call as a button.
    I then dragged and dropped teh Departments ViewObject as a table and created a button with the following action code
    private void jButton2_actionPerformed(ActionEvent e) {
    DCIteratorBinding dciter = (DCIteratorBinding) panelBinding.get("DepartmentsView1Iterator");
    Number deptId = (Number) dciter.getCurrentRow().getAttribute("DepartmentId");
    String dname = (String) dciter.getCurrentRow().getAttribute("DepartmentName");
    Number locId = (Number) dciter.getCurrentRow().getAttribute("LocationId");
    ((JUTextFieldBinding) panelBinding.get("deptId")).setInputValue(deptId);
    ((JUTextFieldBinding) panelBinding.get("dname")).setInputValue(dname);
    ((JUTextFieldBinding) panelBinding.get("locationId")).setInputValue(locId);
    panelBinding.refresh();
    Pressing the button copies the values to the input arguments and pressing the method button sends the values to the method
    Frank

  • Adf skin, table's row hover

    Hi,
    I'm having confussion with adf-skinning.
    Can i put hover effect so everytime user hovering a row of a table it will change the row's background color?
    What class should I use in my css?
    I've tried with af|table::data-row:highlighted, af|table::data-row:hover..
    If there is anyone knows the link where I can dowload an adf-skin template then it also be very helpful to me..
    Best Regards.

    Hi,
    I found this in the forum. Does it work for you?
    Re: Comment on Frank's blog adding hover effect to table
    af|table::content TR:hover { background-color: InfoBackground ; }
    af|table::content TR:hover TD { background-color: transparent ; }
    regards
    Peter

  • Viewobject rows don't exist when creating a lot of rows at once

    Hello,
    I'm creating a lot of rows at once in a viewobject. Let's say between 100 and 700 rows. After that, I commit the transaction. After the creation of every row I do a postchanges().
    When this is all done, a xml file is sent to another server and returns the same file with a bit more information. That file is parsed and every row will be searched in the Viewobject but then they don't exist!
    When I try this with a couple of rows, 10 or something, everything goes well. Is this a known problem or am I doing something wrong? I don't want a commit after the creation of every row because sending must succeed before saving them.

    No off course.
    I hoped that more people have problems with inserting a lot of rows at once. The code is quite simple, it looks a bit like this:
    for ( about 500 elements )
    Row row = voIterator.createRow();
    row.setAttribute("...", "....");
    voIterator.insertRow(row);
    getDBTransaction().postChanges();
    getDBTransaction().commit();

  • ADF UIX - programmatically deleting rows

    Hi gang
    I'm attempting to programmatically delete rows from an exposed VO client-method as follows:
    public void deleteRecord(String cesId) {
      ApplicationModule am = this.getApplicationModule();
      ViewObject voCes = am.findViewObject("ClinicalDataElementSetsView1");
      ViewObject voDcv = am.findViewObject("DacCesView1");
      Object [] keyValues = new Object[1];
      keyValues[0] = cesId;
      Row[] rowsCes = voCes.findByKey(new Key(keyValues), 1);
      Row deleteRowCes = rowsCes[0];
      voCes.setCurrentRow(deleteRowCes);
      voCes.removeCurrentRow();
      Row currentRowDcv = voDcv.getCurrentRow();
      voDcv.removeCurrentRow();  
      am.getTransaction().commit();
    }However when requerying the UIX screen that shows the relating data, the records are still there? What am I doing wrong? Should I be calling voCes.removeCurrentRowFromCollection() instead?
    Any help appreciated.
    Cheers,
    CM.
    PS. JDev 10.1.2

    I got around this by retreiving the DBTransaction and executing a SQL Delete statement on the data.

  • Doctor Jekyll and Mr. Hyde Question for ADF

    Hi all,
    I have the following problem.
    Below there are two codes that works fine but with these error.
    The code in CASE 1 if the RowSet is more large it throws an OutOfMemoryException.
    The code in CASE 2 work fine but it stop the resetting of
    Application Module until i kill the session by killing the browser instance.
    The code in CASE 2 (with -Djbo.debugoutput=console param) shows the following log:
    (all ok) .....
    06/01/18 09:31:15 [3189] ViewObjectImpl.mDefaultMaxRowsPerNode is 70
    06/01/18 09:31:15 [3190] ViewObjectImpl.mDefaultMaxActiveNodes is 30
    06/01/18 09:31:15 [3191] Default locking mode changed to: optimistic
    06/01/18 09:31:15 [3192] Resetting AM=AppModule
    now still in wait until i kill session.
    After i kill session by killing the browser instance continue with the normal log
    06/01/18 09:31:58 [3193] Application Module failover is enabled
    06/01/18 09:31:58 [3194] Getting a connection for internal use...
    06/01/18 09:31:58 [3195] Creating internal connection...
    06/01/18 09:31:58 [3196] Oracle SQLBuilder: Registered driver: oracle.jdbc.driver.OracleDriver
    06/01/18 09:31:58 [3197] <AM MomVer="0">
    <cd/>
    <TXN Def="1" New="0" Lok="2"/>
    Can anyone help me to resolve this impasse?
    Thanks
    Alessandro
    [in bold the difference code]
    CASE 1:
    OutputStreamWriter out_tmp = new OutputStreamWriter(new FileOutputStream(fileName, true));
    int numTotRows = vo.getRowCount();
    String[] attachFile = new String[numTotRows+1];
    Row currRow = vo.getRowSet().first();
    for (int rowIndex = 1; rowIndex <= numTotRows; rowIndex++) {
    for (int attrIndex = 0; attrIndex < vo.getAttributeCount(); attrIndex++) {
    if ((currRow.getAttribute(attrIndex) != null)) {
    if (attachFile[rowIndex] == null) {
    attachFile[rowIndex] = currRow.getAttribute(attrIndex).toString().trim() + "|";
    } else {
    attachFile[rowIndex] = attachFile[rowIndex] + currRow.getAttribute(attrIndex).toString().trim() + "|";
    } // END - for (int attrIndex = 0; attrIndex < vo.getAttributeCount(); attrIndex++)
    currRow = vo.getRowSet().next();
    } // END - for (int rowIndex = 1; rowIndex <= numTotRows; rowIndex++)
    for (int i = 0; i < attachFile.length; i++) {
    out_tmp.write(attachFile);
    out_tmp.flush();
    out_tmp.close();
    CASE 2:
    OutputStreamWriter out_tmp = new OutputStreamWriter(new FileOutputStream(fileName, true));
    int numTotRows = vo.getRowCount();
    String[] attachFile = new String[] {""};
    Row currRow = vo.getRowSet().first();
    for (int rowIndex = 1; rowIndex <= numTotRows; rowIndex++) {
    for (int attrIndex = 0; attrIndex < vo.getAttributeCount(); attrIndex++) {
    if ((currRow.getAttribute(attrIndex) != null)) {
    attachFile[0] = attachFile[0] + currRow.getAttribute(attrIndex).toString().trim() + "|";
    } // END - for (int attrIndex = 0; attrIndex < vo.getAttributeCount(); attrIndex++)
    [b]for (int i = 0; i < attachFile.length; i++) {
    out_tmp.write(attachFile);
    out_tmp.flush();
    attachFile = new String[] {""};
    currRow = vo.getRowSet().next();
    } // END - for (int rowIndex = 1; rowIndex <= numTotRows; rowIndex++)
    out_tmp.flush();
    out_tmp.close();

    Hi,
    there is someone with an idea?
    I'm very desperate!
    Thanks
    Alessandro

  • Question about ADF BC security

    Frank:
    I was looking at Xtanto's inquiries and your response and this brought up something. I was under the impression that you can use the database to store userid and user information. However, passwords, roles etc have to be defined in system-jazn-data.xml and web.xml for security to work. Am I missing something? I was under the impression that you need system-jazn-data.xml for all the good stuff.
    Please direct me to the section of the doc where this is explained.
    Thanks

    Hi,
    ADF Security requires jazn-data.xml or OID. If you do container managed security where authentication and authorizationis handled by the container then this can be from database tables using custo JAAS LoginModules.
    Xtantos question crossed the two options
    Frank

Maybe you are looking for

  • TS3212 Error Message when Downloading iTunes 10

    When attempting to download itunes for windows (Windows XP), I get the following error message, "The system administrator has set policies to prevent this installation," so I am unable to complete the installation.  Any suggestions?

  • Transactions in MS SQL server 2000

    I'm writing an application whish will real data from MS SQL server 2000. At the same time one table and/or database would be used with couple of users. What should I use for handling transactions? I'm using jtds-0.8-rc1 as JDBC driver. Thanks in adva

  • Instantiating Object with NDS

    I'm having no success in instantiating object with NDS. Does anyone know whether is possible? I can hard code a statement as follows: pkg1.gs_nt(gs_nt.LAST) := NEW SomeObject_ot('x'); where pkg1 is a package with the gs_nt variable declared in the sp

  • Testing AIA PIP XSL files in Jdeveloper

    Hi Guys, i have added some customizations in PIP XSL files when i was trying to test it through JDeveloper it is giving error Failed to transform the source XML start of root element expected shall anyone know the work around for this. kindly help. t

  • HT1689 my ipad 2 doesnt work that well. it always hang by it self after i updated the latest ios 7.

    my ipad 2 doesnt work that well. it always hang by it self after i updated the latest ios 7.