ADF Faces 10g: How to empty an af:table component?

Hi,
I am using JDeveloper/ADF 10.1.3.
I have a page with 2 iterators on the same view (one always in search mode), a search form and a table for results. As there are a lot of rows in the view and I don't want to query it without search criteria to avoid getting all the results, I set the iterator's refresh property to ${adfFacesContext.postback==true}.
I made a Search button binding the Execute action and a Reset button binding the Find action. Now, when I hit the Reset button, I also want to reset the table (the query results) to empty. How to do that? I could not find any method to empty the rowset, neither at table lavel, nor at iterator, nor at view.
Thanks in advance for your replies.

Hi,
I don't have a declarative solution for you, but some possible solutions or ideas to do it.
1. put a method in the application module end expose the method to the client (data control). This method can either remove all rows from the VO (call removeCurrentRowFromCollection() for each row currently in the VO but keep them in the DB).
2. you can try to use executeEmptyRowSet() (I'm not sure it's available in 10.1.3) and hope that it removes all rows from the row set (the method is not documented, so I'm olny guessing it's function).
3. execute your search with parameters you are sure they will not return any result. This can be done from a backing bean.
Timo

Similar Messages

  • ADF Faces Dependent list boxes in an editable table

    Hi,
    I'm working with JDeveloper 10.1.3.1.0.
    I saw the topic "How to build dependent list boxes with ADF II" on F. Nimphius' Blogbuster.
    There it is shown how to handle dependent list boxes in an ADF Faces form. I tried this for an editable table but it doesn't work correctly: If there is more than one row in the resultset of the table, both dependent list boxes have the same content in all the rows though the content in the database is different.
    Can anyone help me?
    Thanks.

    Ok - I will try.
    I built the listboxes like it is described in "ADF Faces: How to built dependent lists boxes with ADF and ADF Faces Part II", Frank Nimphius' Blogbuster July, 2006.
    This is the full code of my ManagedBean:
    package asdb.view.backing;
    import javax.faces.context.FacesContext;
    import javax.faces.el.ValueBinding;
    import javax.faces.event.ValueChangeEvent;
    import javax.faces.model.SelectItem;
    import oracle.adf.model.OperationBinding;
    import oracle.adf.model.binding.DCIteratorBinding;
    import oracle.adf.view.faces.component.core.input.CoreInputText;
    import oracle.binding.BindingContainer;
    import oracle.jbo.Row;
    import oracle.jbo.ViewObject;
    import oracle.jbo.client.Configuration;
    import oracle.jbo.uicli.binding.JUCtrlValueBindingRef;
    public class AktMitFktEdit {
    private BindingContainer bindings;
    public AktMitFktEdit() {
    public void kategorieWechsel(ValueChangeEvent valueChangeEvent) {
    // Add event code here...
    BindingContainer bc = this.getBindings();
    DCIteratorBinding kategorienIter = (DCIteratorBinding)
    bc.get("OrganKategIterator1");
    Row rw =
    kategorienIter.getRowAtRangeIndex(((Integer)valueChangeEvent.getNewValue()).intValue());
    String kategorie = (String)rw.getAttribute("Kategorie");
    OperationBinding opBindingOrganeLovIter = (OperationBinding)bc.get("ExecuteWithParams");
    opBindingOrganeLovIter.getParamsMap().put("kategorieParam",kategorie);
    opBindingOrganeLovIter.execute();
    public void setBindings(BindingContainer bindings)
    this.bindings = bindings;
    public BindingContainer getBindings() {
    return bindings;
    It works fine, when the user only want to update existing rows. But if he had inserted a new row and afterwards want to update existing rows, the listboxes don't show the correct contents. No error messages are displayed.

  • How feed many record in table component and not use append command again

    hi master
    How I feed Multiple records in table component and not use append and save command again and again
    Same as oracle grid
    I give many record and save one time
    Please give me idea how I add Multiple record and save one time not use append and save command again and again
    Thank�s
    aamir

    Hi!
    appendRow() method just add temporal row. For add them to DB commitChanges() method should be used. So you can use appendRow() method several times, fill every new row and only then use commitChanges() method. In this case all new rows will be added to DB per one time.
    Thanks,
    Roman.

  • How-to use captcha with ADF Faces 10g (10.1.3)

    Hi All,
    Could You Pls tell me how to use the captcha using 10g currently i am using the jdeveloper version of 10.1.3. I have found the link for using the *[captcha using 11g|http://www.oracle.com/technology/products/jdev/tips/fnimphius/captcha/captcha.html]* but some of the components here such as af:panelFormLayout and af:panelGroupLayout are not available in 10g.Are there are any alternative components Availablel for the 10g
    regards
    Yeshwant

    Hi John ,
    Thankx for the reply ..
    i am getting the following compilation error *(Error: Attribute: halign is not a valid attribute name)* while doing that .
    i have written the code as follows...
    <f:view>
    <af:document id="d1">
    <af:form id="f1">
    <af:panelForm id="pfl1">
    <f:facet name="footer"/>
    <af:objectImage source="/captchaservlet" id="i1"
    inlineStyle="width:251px; height:76.0px;"/>
    <af:commandButton text="can't read image" id="cb2"
    partialSubmit="false"/>
    <af:panelLabelAndMessage label="Are U a robot?" id="plam1">
    <af:panelGroup id="pgl1" layout="horizontal" halign="left">
    <af:inputText id="it1" value="#{requestScope.bestGuess}"/>
    <af:commandButton text="try" id="cb1"
    actionListener="#{HandleCaptchaBean.verifyAnswer}"
    partialSubmit="true" immediate="false"/>
    </af:panelGroup>
    <af:message id="m1" messageType="info" for="it1"/>
    </af:panelLabelAndMessage>
    </af:panelForm>
    </af:form>
    </af:document>
    </f:view>
    Thankx
    Regards
    Yeshwant

  • ADF Faces: RichTable - How to create a RichTable object

    Hi. How to create a RichTable object to put in a JSF page ? I need to make a method that receive a list of name of columns and a list of list of data. This code that I have writing don't work. What's my error?
            public RichTable getADFTable(
            List<String> lstCols, List< List<String> > lstLstData
            RichColumn adfCol = null;
            List<RichColumn> lstRichCols = new ArrayList<RichColumn>();
            int cont = 0;
            for( String col : lstCols ){
                adfCol = new RichColumn();
                adfCol.setDisplayIndex(cont++);
                adfCol.setHeaderText( col );
                adfCol.setMinimumWidth( "60" );
                lstRichCols.add( adfCol );
            int contCols = 0;
            RichOutputText text = null;
            RichTable AdfTab = new RichTable();
            for( List<String> lstData : lstLstData){
                for( String data : lstData ){
                    text = new RichOutputText();
                    text.setValue(data);
                    lstRichCols.get( contCols ).getChildren().add( text );
                    contCols++;
                contCols = 0;
            AdfTab.setRows(this.lstEntit.size());
            cont = 0;
            for( RichColumn col : lstRichCols ){
                AdfTab.getChildren().add( col );
            return AdfTab;
        }

    I was searching for an example and i found it but whit errors, finally i fixed and it works.
    You just have to generate the data from your webservices and "put" into this structure.
    The java file (Bean)
    package view;
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.List;
    import java.util.Map;
    import org.apache.myfaces.trinidad.model.CollectionModel;
    import org.apache.myfaces.trinidad.model.SortableModel;
    public class DynamicTable {
        private SortableModel model;
        private List<String> columnNames;
        public DynamicTable() {
            columnNames = new ArrayList<String>();
            columnNames.add("Col-1");
            columnNames.add("Col-2");
            generateColumnModel();
        public void generateColumnModel() {
            this.model = new SortableModel(createRows(columnNames));
        private List<Map> createRows(List<String> columnNames) {
            int i = 0;
            List<Map> mapListforRows = new ArrayList<Map>();
            for (String name : columnNames) {
                Map newRow = new HashMap();
                mapListforRows.add(newRow);
                for (String col : columnNames) {
                    newRow.put(col, "data");
            return mapListforRows;
        // Get table model
        public CollectionModel getCollectionModel() {
            return model;
        public void setColumnNames(List<String> columnNames) {
            this.columnNames = columnNames;
        public List<String> getColumnNames() {
            return columnNames;
    }The jspx file (page)
               <af:table varStatus="rowStat" summary="table"
                            value="#{pageFlowScope.DynamicTable.collectionModel}"
                            rows="#{pageFlowScope.DynamicTable.collectionModel.rowCount}"
                            rowSelection="none" contentDelivery="immediate"
                            var="row" rendered="true" id="t1">
                    <af:forEach items="#{pageFlowScope.DynamicTable.columnNames}"
                                var="name">
                      <af:column sortable="true" sortProperty="#{name}"
                                 rowHeader="unstyled" headerText="#{name}"
                                 inlineStyle="width:100px;" id="c1">
                        <af:activeOutputText value="#{row[name]}" id="aot1"/>
                      </af:column>
                    </af:forEach>
                  </af:table>

  • ADF Faces & BC: How to mix JSF EL AND conditions

    I'm trying to do something like the following on an executable defined within my pageDef:
    RefreshCondition="#{processScope.editRecord==false} && ${ adfFacesContext.postback}"
    What should be the proper syntax?
    Many thanks,
    Wes

    Resolved.
    Found the syntax in another post with a different topic.
    Re: ADF Model : Refresh and RefreshCondition on methodIterator and invokeAc
    RefreshCondition="#{ (processScope.editRecord) and (!adfFacesContext.postback) }"

  • ADF Faces & BC: How to perform dynamic navigation.

    Here is the setup:
    Page 1 allows the user to enter a id
    Page 2 and 3 is either a update or insert depending on the id.
    The logic to figure out the insert or update operation is within a method in the AM.
    I have bound this method on a button in Page 1, with the generated actionListener like the following:
    #{bindings.isNewRegistration.execute}
    This business method returns 2 possible String values that are mapped in the face-config.xml.
    <navigation-case>
    <from-action>#{bindings.isNewRegistration.execute}</from-action>
    <from-outcome>validIdSelected</from-outcome>
    <to-view-id>updatePage.jspx</to-view-id>
    </navigation-case>
    ...followed by insert navigation case
    The problem:
    The business method is appropriately invoked when the button is pressed with the correct return value, but the page does not forward to insert or update page.
    I appreciate the help in advance.
    -Z

    Zeoneozero,
    I think you need to use the "Action" and not "ActionListener" on the button. You can programatically look up and execute the operation binding for the isNewRegistration action and get the result via the execute method. Then, the navigation cases need static <from-action> values... something like this perhaps:
    <navigation-case>
    <from-outcome>update</from-outcome>
    <to-view-id>updatePage.jspx</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>insert</from-outcome>
    <to-view-id>insertPage.jspx</to-view-id>
    </navigation-case>and, in the backing bean...
    String myPressedButtonAction()
          OperationBinding b = getBindings().getOperationBinding("isNewRegistration");
          String result = (String) b.execute();
          return result;
    }Hope this helps...
    John

  • ADF Faces Components:how to align af:panelBox with fields in af:panelForm?

    Hi,
    I have an af:panelForm component to which I added af:selectOneChoice and few af:inputText components. af:panelForm aligns all af:inputText fields properly with labels being right justified and the input fields left justified.I wanted to add af:panelBox at the end but don't know how to align it with the input fields.
    I wrapped the last input field and the af:panelBox inside af:panelBorder but this didn't help. I still get af:panelBox displayed at the extreme left hand side.
    I could put af:panelBox inside another af:panelForm but that does not work for me because af:panelBox happens to be target of a PPR, source of which is the af:selectOneChoice. Depending on the selected item of ad:selectOneChoice, I want to either show af:panelBox or hide it. So I had to include af:panelBox in the same af:panelForm that contains af:inputText so that both source and target of PPR are at the same level for PPR to work. I can also add af:objectSpacer before af:panelBox to get the alignment i am looking after but this again doesn't help because when window is restored or maximized, then the alignment gets lost. Any clue how to achieve that ?
    <af:panelForm>
    <af:selectOneChoice
    id="SelectOneChoice"
    autoSubmit="true"
    immediate="true"...>
    <af:forEach var="item"
    items="#{bindings.View_rIterator.allRowsInRange}">
    <af:selectItem value="#{item.id}"
    label="#{item.id}"/>
    </af:forEach>
    </af:selectOneChoice>
    <af:inputText ..../>
    <af:inputText ..../>
    <af:inputText ..../>
    <af:inputText ..../>
    <af:inputText ..../>
    <af:panelBorder partialTriggers="SelectOneChoice">
         <af:inputText ..../>
    <af:panelBox text="Panel Box:"
    background="transparent" width="200">
    <af:panelHorizontal halign="center">
         <af:inputFile .../>
         <af:objectSpacer width="3"/>
              <af:commandButton .../>
         </af:panelHorizontal>
    <af:panelHorizontal halign="center">
    <af:objectImage ..."/>
    </af:panelHorizontal>
    <af:panelHorizontal halign="center">
    <af:panelButtonBar>
    <af:commandButton ..."/>
    </af:panelButtonBar>
    </af:panelHorizontal>
    </af:panelBox>
    </af:panelBorder>
    </af:panelForm>
    Please advice.
    Thanks

    Hi,
    did you try skinning ? Inline style CSS doesn't necessarily work for the whole component as it operates on the root DOM element, which in the case of a composite component isn't the individual facet
    http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/skin-selectors.html
    af|panelPage::about{
    height: 30%;
    Frank

  • ADF Faces 10g af:table row selection using SHIFT Key

    Hello,
    Is there a simple way in 10G af:table with multiple selection facet to enable selecting multiple rows of a table by selecting one row, holding the SHIFT key down, selecting another row way down, and having all the rows in the middle be automatically selected?
    So, this is essentially equivalent to "Select Range" Capability.
    Thank you for any information.

    I think the simple answer to your question is, no.
    In 11g, I think the answer is, yes; but you probably already knew that.
    You might consider altering the keySet associated with the table related to the multi-select checkbox facet. You could have some section above the table that selects these check boxes based on some entered filter criteria. The keySet is a little weird though. You might check out its usage in SRDemo Application Module Impl class code which deletes over this keyset, and work backwards from there.

  • ADF Faces Components: How to fix position of af:panelPage facets

    I have several jsp pages, each of which has af:panelPage component to which I included menuGlobal, appCopyright, appPrivacy, appAbout. What I don't like about those pages is that above-mentioned facets keep moving up and down depending on contents i add to the different jsps. For example, if jsp1 has more content than jsp2, then moving from jsp1 to jsp2 results in above facets moving up. I just hate that. I would like to have those facets have a fixed location at the bottom of any jsp page and not have their location changing as I switch between pages having different contents. One of many things I tried doing is wrapping the content of each jsp inside af:panelBorder and set a fixed height to the af:panelBorder. This works. However, I don't like to set af:panelBoder height to some fixed value because on different displays, user may end up having to scroll up and down to see entire jsp contents and I don't want scolling. So I tried using inlineStyle to set height of af:panelPage to percentage of screen height but this doesn't work either. I am stuck !!!
    Please help/advise!
    It looks like either i am dumb and dont know what I am doing or the flexibility i am seeking isn't supported.
    I am using JDeveloper (10.1.3.2).
    Thanks a lot in advance.
    Message was edited by:
    samsam

    Hi,
    did you try skinning ? Inline style CSS doesn't necessarily work for the whole component as it operates on the root DOM element, which in the case of a composite component isn't the individual facet
    http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/skin-selectors.html
    af|panelPage::about{
    height: 30%;
    Frank

  • How to construct CollectionModel for table component?

    I use ChildPropertyTreeModel to construct CollectionModel for table. If I need find rows in the table by rowkey, how to set rowkey for the CollectionModel?

    Hi,
    the rowKey is of type Set and contains the keys. In the POJO case the key entry in the Set is the row index (zero) based
    Frank

  • How do I add ADF Faces Core and ADF Faces Html to the component palette?

    I have an already made jspx page which I wish to work further on but I can´t choose ADF components from the component palette.
    in my older version I added these two lines to the <jsp:root> element when I wanted to make ADF components available.
    xmlns:af="http://xmlns.oracle.com/adf/faces"
    xmlns:afh="http://xmlns.oracle.com/adf/faces/html"
    but in Jdeveloper 11g preview 3 these two lines seem to have no effect.
    I tried to see what other jspx pages that contained ADF components in 11g had that my page didn´t and found out that they had the line
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    but when I add this line instead of the other two lines and press install JSP tag library Jdeveloper freezes completely. Can anyone help me get ADF components show up in the component palette in Jdeveloper 11g preview 3?
    Message was edited by:
    AtlanticViking

    Hello,
    Jdeveloper 11g uses Trinidad not ADF Faces 10g, to add it, uses the following:
    1. Double-click your project to access project properties;
    2. Select JSP Tag Libraries;
    3. Click Add;
    4. Trinidad Component 11-m3
    Regards,
    ~ Simon

  • ADF faces price

    Hi,
    I am new to ADF faces. I am reading something about adf are donated to apache.
    I cannot figure out what is the price of ADF if I am using with Tomcat? (I have found that the license for adf is around $6000 per processor but I am not sure about this).
    I have downloaded jdeveloper with adf and weblogic for free from oracle web site.
    Is it legal to use them for commercial purposes?
    If not, why you can download them for free. How oracle will know that my application is used for commercials?
    Regards.

    Hi,
    - ADF Faces 10g was given to Apache as MyFaces Trinidad (http://myfaces.apache.org/trinidad). therefore Trinidad is completely free whatever your environment is.
    - ADF Faces 11g is a proprietary Oracle product that was supposed to be given to Apache as well as part of MyFaces RCF (http://incubator.apache.org/projects/rcf.html), but the Apache Software Foundation is about to close that possibility since Oracle is taking way too long. You'll have to check the incubator mailing list to get that info. Oracle has yet to react of publish a standing concerning that issue as far as I can tell. Currently anyway, it's still proprietary, but free to use IF and only if you're using WebLogic or Oracle AS 11g (the latter not yet available). So, if you want to use it on Tomcat, it's NOT free, I don't know the exact price though. Please note that I'm not working for Oracle though so you may want to wait for an answer from one from Oracle team.
    Regards,
    ~ Simon

  • Support for ADF Faces

    Hi Everyone,
    We are planing to use ADF Facses for our upcoming prjoject. so for that we want some sample application or demonstration because the list of component is available in the oracle site is not very rich may be not updated, how can i get detail information about ADF Faces.
    How to get latest trial version of ADF Faces and how to configure ADF with MYEclipse
    Thanks
    Meraj

    Meraj,
    ADF Faces components are as they show in the JDeveloper 10.1.3.3 component palette. The Apache MyFaces open source project Trinidad contains new components that will be in JDeveloper 11. Note that unlike other vendors, Oracle doesn't make trial versions available but always the full version (we don't mind developers using our stack for longer than 30 days ;-) ).
    To configure ADF Faces in Eclipse, just make sure you have MyFaces or JSF-RI installed in Eclipse and adf-faces-api.jar and adf-faces-impl.jar configured for ADF face. The adf-faces-impl.jar fiel contains the tag libraries
    Frank

  • ADF Faces: How do I set values for input controls in an af:table

    Use case: user enters master/detail information into an input form using an af:table for the desired number of detail rows.
    I have an ADF Faces input form with master level input controls, and an af:table (bound to a backing bean CoreTable) for the detail data set.
    The input controls are value bound to updateable view objects built from entity objects, with the appropriate view links providing master/detail iterators.
    Once the user has entered the master keys (via inputTexts, and selectOneChoices), I create a row in the detail VO, thus creating a visible blank row in the af:table.
    The user then completes the key for the detail row (in the af:table) by selecting a value in a selectOneChoice (in a af:column) with autoSubmit on and a valueChangeListener that sets the VO row attribute with the new value.
    The user then continues to enter into the remaining inputTexts and selectOneChoices in the af:columns until all values have been entered.
    I do not have autoSubmit on for any input controls in the af:columns other than the key, for performance improvement.
    The user can then use a command button (which has an action method) to create another row in the af:table.
    But, (in the action method) I need to set the values for the 1st detail VO row attributes, from the input controls, before creating another row.
    The input controls are bound to backing bean CoreInputText and CoreSelectOneChoice objects, and they have not set their values at this point, even though I have partialSubmit on for the "New Row" command button.
    I do not value bind the input controls in the af:columns to the backing bean objects, because we need to display data for all rows entered into the af:table.
    Any advice on the best way to perform this operation would be very appreciated!!!!

    Thanks for the reply Steve!!
    Yes, I followed the techniques in Screencast#7, and it works great in my edit page.
    But I am having problems with my input form.
    I actually have master/detail/detail relationship for which I am creating an input form.
    I created the input form as a copy of the edit form, and am making revisions as necessary.
    I created new view objects for the input form (from my three entity objects), which have the "Tuning" set to retrieve "No Rows (i.e. used only for inserting new rows)"
    I added an invokeAction that binds the "CreateInsert" action on the master iterator, so when the page is first displayed, the master level controls are available for data entry (as in 13.6.2 in the Developers Guide): but the first level detail controls are not rendered, and the af:table (for the second level detail) is rendered but with no rows.
    Once the user enters key values for the master (a three part key), I manually create a first level detail row by executing the "CreateInsert" action binding for the first level detail iterator.
    Continuing on, the user then enters a key value for the first level detail I manually create a second level detail row using it's "CreateInsert" action binding.
    Now the user has a form with all master and first level detail controls completed and one empty row in the af:table for it's first entry.
    The key column in the af:table has autoSubmit on, and an value change listener. That listener uses it's getNewValue() to set the key value ("locationCode" in this case) using
    setLocationCode from the ViewRowImpl. Here is that value change listener:
    public void locationChanged(ValueChangeEvent event) {
    if (null != event.getNewValue()) {
    LocObsCreateViewRowImpl locCreateRow = (LocObsCreateViewRowImpl)appMod.findViewObject("LocObsCreateView").getCurrentRow();
    if (null == locCreateRow.getLocationCode()) {
    locCreateRow.setLocationCode(event.getNewValue().toString());
    Now comes my problem: once they have entered the values in the remaining columns, they can use a command button to create another row in the 2nd detail iterator, thus creating another visible empty row in the af:table. But the values from the first row (other than the key column) are not assigned to the row in the collection and I can't figure out how to set values in the collection's row.
    I imagine I'm missing something using bindings and the Request Processing Lifecycle, and after reading this I can see how much manual work is going on.
    The users have specified the need to have all information available on one page, so I've designed it so they can insert and iterate through the first level detail collection.
    They have also asked to not use the mouse; they are looking for a "heads-down-data-entry" system.
    Again, I really appreciate any advice you could give.
    Jeffrey

Maybe you are looking for