AF:inputListOfValues sets the value of the first item in the result set when using enter key or tab and component value autosubmit = true

I use JDev 11.1.1.6 and when I type in a value in an af:inputListOfValues element and press enter or the tab key, it will replace the value I entered with the first element in the set of results LOV. If enter a value, simply click on the component af:inputListOfValues it works correctly. If I use the popup and find a value it works properly as well. I have a programmatic view object that contains a single transitional attribute (this is the view object that is used to create the list of the components of the value of) and then I have another object from view based on entities which defines one of its attributes in a list of the attribute value. I tried to use a base object view of entity to create the LOV to and everything works as expected, so I don't know if this is a bug when using programmatic view objects or if I need more code in the VOImpl. In addition, it seems after that first of the value being replaced by the first value in the result set that it will work correctly as well. Here are some excerpts of important code.

Also, it seems that this does not work only if the text entered in the component af:inputListOfValues would have only a single game, returned in the result set. For example, given the result defined in code: Brad, Adam, Aaron, Fred, Charles, Charlie, Jimmy

If we get into Cha, the component works as expected

If we register A, the component works as expected

If we get Jimmy, the component does not work as expected, and returns the first value of results IE. Brad

If we get Fred, the component does not work as expected, and returns the first value of results IE. Brad

I also checked that I get the same behavior in JDev 11.1.1.7

UsersVOImpl (programmatic view with 1 transitional attribute object)

import java.sql.ResultSet;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import oracle.adf.share.logging.ADFLogger;

import oracle.jbo.JboException;
import oracle.jbo.server.ViewObjectImpl;
import oracle.jbo.server.ViewRowImpl;
import oracle.jbo.server.ViewRowSetImpl;

// ---------------------------------------------------------------------
// ---    File generated by Oracle ADF Business Components Design Time.
// ---    Wed Sep 18 15:59:44 CDT 2013
// ---    Custom code may be added to this class.
// ---    Warning: Do not modify method signatures of generated methods.
// ---------------------------------------------------------------------

public class UsersVOImpl extends ViewObjectImpl {

    private static ADFLogger LOGGER = ADFLogger.createADFLogger(UsersVOImpl.class);
    private long hitCount = 0;

    /**
     * This is the default constructor (do not remove).
     */
    public UsersVOImpl () {
    }

    /**
     * executeQueryForCollection - overridden for custom java data source support.
     */
    protected void executeQueryForCollection (Object qc, Object[] params, int noUserParams) {

         List<String> usersList = new ArrayList<String>();
         usersList.add("Brad");
         usersList.add("Adam");
         usersList.add("Aaron");
         usersList.add("Fred");
         usersList.add("Charles");
         usersList.add("Charlie");
         usersList.add("Jimmy");

         Iterator usersIterator = usersList.iterator();
         setUserDataForCollection(qc, usersIterator);
         hitCount = usersList.size();
         super.executeQueryForCollection(qc, params, noUserParams);

    } // end executeQueryForCollection

    /**
     * hasNextForCollection - overridden for custom java data source support.
     */
    protected boolean hasNextForCollection (Object qc) {

         Iterator usersListIterator = (Iterator)getUserDataForCollection(qc);
         if (usersListIterator.hasNext()) {
     
             return true;

         } else {

             setFetchCompleteForCollection(qc, true);
             return false;

         } // end if

    } // end hasNextForCollection

    /**
     * createRowFromResultSet - overridden for custom java data source support.
     */
    protected ViewRowImpl createRowFromResultSet (Object qc, ResultSet resultSet) {

         Iterator usersListIterator = (Iterator)getUserDataForCollection(qc);
         String user = (String)usersListIterator.next();
         ViewRowImpl viewRowImpl = createNewRowForCollection(qc);

         try {

             populateAttributeForRow(viewRowImpl, 0, user.toString());

         } catch (Exception e) {

             LOGGER.severe("Error Initializing Data", e);
             throw new JboException(e);

         } // end try/catch

         return viewRowImpl;

    } // end createRowFromResultSet

    /**
     * getQueryHitCount - overridden for custom java data source support.
     */
    public long getQueryHitCount (ViewRowSetImpl viewRowSet) {
         return hitCount;
    } // end getQueryHitCount

    @Override
    protected void create () {

         getViewDef().setQuery(null);
         getViewDef().setSelectClause(null);
         setQuery(null);

    } // end create

    @Override
    protected void releaseUserDataForCollection (Object qc, Object rs) {

         Iterator usersListIterator = (Iterator)getUserDataForCollection(qc);
         usersListIterator = null;
         super.releaseUserDataForCollection(qc, rs);

    } // end releaseUserDataForCollection

} // end class

<af:inputListOfValues id="userName" popupTitle="Search and Select: #{bindings.UserName.hints.label}" value="#{bindings.UserName.inputValue}"
                                              label="#{bindings.UserName.hints.label}" model="#{bindings.UserName.listOfValuesModel}" required="#{bindings.UserName.hints.mandatory}"
                                              columns="#{bindings.UserName.hints.displayWidth}" shortDesc="#{bindings.UserName.hints.tooltip}" autoSubmit="true"
                                              searchDesc="#{bindings.UserName.hints.tooltip}"                                           
                                              simple="true">
                          <f:validator binding="#{bindings.UserName.validator}"/>                       
</af:inputListOfValues>



I found a solution to this problem. It seems that, when using a view object programmatic that has a transient as its primary key attribute, you need to override the methods in the ViewObjectImpl so that he knows how to locate the line related to the primary key when the view object records are not in the cache. That's why it would work properly sometimes, but not always. Here are the additional methods that you must override. The logic you use in the retrieveByKey would be on a view view object database object and would be different if you had a primary key consisting of multiple attributes.

@Override
protected Row[] retrieveByKey (ViewRowSetImpl viewRowSetImpl, Key key, int i) {
    return retrieveByKey(viewRowSetImpl, null, key, i, false);
}

@Override
protected Row[] retrieveByKey (ViewRowSetImpl viewRowSetImpl, String string, Key key, int i, boolean b) {

    RowSetIterator usersRowSetIterator = this.createRowSet(null);
    Row[] userRows = usersRowSetIterator.getFilteredRows("UserId", key.getAttribute(this.getAttributeIndexOf("UserId")));
    usersRowSetIterator.closeRowSetIterator();
    return userRows;

}

@Override
protected Row[] retrieveByKey (ViewRowSetImpl viewRowSetImpl, Key key, int i, boolean b) {
    return retrieveByKey(viewRowSetImpl, null, key, i, b);
}

Tags: Java

Similar Questions

  • Got a 27 "monitor from Apple, with thunderbolt (error). My MacPro can't love at first sight. Apple won't bring back the monitor. Will using a USB 3 map and then using a hard drive with USB 3 and Thunderbolt works?

    Got a 27 "monitor from Apple, with thunderbolt (error). My MacPro can't love at first sight. Apple won't bring back the monitor. Will using a USB 3 map and then using a hard drive with USB 3 and Thunderbolt works?

    N ° you need a computer logic board which has built in Thunderbolt.

  • All IT gurus out there who know Firefox... have lost the passwords saved when FF created a new profile and delete old files key3.dbf and logins.json profile.

    All IT gurus out there who know Firefox... have lost the passwords saved when FF created a new profile and delete old files key3.dbf and logins.json profile. Any ideas, anyone?

    So it's not a logins.json file?

    I see a signons3.txt file and a file signons.sqlite older, if you can try to see if you can import passwords stored in this file.

    You can force Firefox to re-import the passwords in the file signons.sqlite and regenerate the file logins.json with the following steps:

    • reset the signon.importedFromSqlite pref on the topic: config page by default via the context menu
    • Delete the logins.json file in the closed Firefox with Firefox profile folder

    When you restart Firefox, then you should have the pref signon.importedFromSqlite with the value set to true.
    You have passwords that are imported in the password manager, unless there were errors or signons.sqlite signons3.txt.

    You can open the topic: config page via the address bar.
    You can accept the warning and click on "I'll be careful" to continue.

    You can use this button to go to the current Firefox profile folder:

  • How to manage the photos Lightroom when using 2 computers, keeping any changes made on one or the other?

    Based on http://forums.Adobe.com/thread/1308132?TSTART=0 I decided to add each question separately:

    Hello, I am very interested in buying Lightroom 5.2. I tried the RC that was missing today. Yet, I have several questions that I can't find really good conclusive answers, I'd like to get an answer before buying LR. Please do not write maybe like this or that (assumptions), because I don't want to start my entire workflow and then realize that I have to change all around, please reply, if you know for sure that something works and you are, preferably, using this method too.

    Is the big question, where I want to especially a conclusive answer:  How to manage the photos Lightroom when using 2 computers, keeping all the changes made on one of them, using the same photos for editing. I'm not going to use DNG. Details: I mainly use my old MacBook Pro, but I wish I could use my PC as it is much better (card: i5 2500K, 16 GB of RAM, SSD, USB3, nVidia GTX 560 TI etc.). I have 2 external HD that I could use, one for backup and one for the actual Photos/changes. I you will probably need to use as my internal HDs are fairly complete and I cannot be the kind of things simply delete or move to one (developer, without loss of music, programs etc.).

    On this basis, how do I save all such Photos folder (pictures and retouching and preferably presets too)?

    According to me, that it should be possible to work cross-platform without having to create a link to the files each time, or without having to keep export/import of the catalog, keeping the single catalog and the picture library on an external drive that is then switched between systems as needed.

    Obvious first requirement is an external drive that is formatted in a way (for example, FAT32) that it can be used on both platforms in read/write mode. Given that, if the catalogue AND folder parent si le catalogue ET le dossier parent images are both set to the same level in a global parent folder, then it should be possible to take advatage of ability of Lightroom to use relative paths instead of absolute paths to detect the images, no matter if the player is named (Mac) or lettering (PC). This is how "export as catalog of ' works, that is, it creates a 'package', alias a parent folder, containing the catalog and a replica of the folder hierarchy to exported along with the catalog images. Take this 'package' to another system (same OS or not) and "it works" even if the drive letter is different or the operating system is different... because the relative path of the image catalogue is always the same.

    I have not tested this cross-platform (if I have between various PC systems with letters of different readers) so for me it's still just a theory, but there may be others who have done this successfully.

  • Where do I put the AutoFill feature when using Firefox?

    You people do a great job of describing 'How to use Auto Fill'... but nowhere in this article does say WHERE - to implement the feature when using Firefox.

    How and where can I find the setting?

    Thank you.

    PS: maybe that should be in the article somewhere.

    What about filling the data in a form (input field) on a web page?

    See:

  • Is it possible to blackBerry smartphones can remove the BBM5.0 when using OS5.0?

    Is there a way to remove the BBM5.0 when using OS5.0? I tried using DM6.0 but BBM is marked as a component of basic impossible to remove.

    I hate BBM in general because it is always on. I don't want to install an older version.

    If anyone can help me, thanks in advance.

    lusilveira wrote:

    Is there a way to remove the BBM5.0 when using OS5.0? I tried using DM6.0 but BBM is marked as a component of basic impossible to remove.

    I hate BBM in general because it is always on. I don't want to install an older version.

    If anyone can help me, thanks in advance.

    • with a few OSes 5.0.X.X, BBm is a basic application and cannot be deleted.
    • BUT the other OSes, the BBm 5.0.X.X became an addon application and can be removed. (i.e. 5.0.0.43 6 and 5.0.0.462)

    If you have the first category OS, I suggest you try and install BBm for example using AppWorld. Perhaps by upgrading BBm, it will become an add-on.

  • When using a 2010 macbook pro and a mini display port to hdmi adapter, will be the macbook pro display be sent to a TV that has hdmi inputs, or do you need a keyboard command

    When using a 2010 macbook pro and a mini display port to hdmi adapter, will be the macbook pro display be sent to a TV that has hdmi inputs, or do you need a keyboard command

    Yes it will be displayed.

  • Since I load Acrobat Reader DC, when I try to save the document, word to PDF, the pdf file pages are cut on the width. I use Microsoft Office Word 2007 and I have no problem with the previous version of Adobe Reader. Should what settings I adjust?

    Since I load Acrobat Reader DC, when I try to save the document, word to PDF, the pdf file pages are cut on the width. I use Microsoft Office Word 2007 and I have no problem with the previous version of Adobe Reader. Should what settings I adjust?

    Hi judithl34724699,

    If you want to convert Word files to PDF with the Adobe Reader application then it is possible with the service Pack of PDF. Try to use the service on the web: https://cloud.acrobat.com/convertpdf

    Also try to use a different file type.

    Thank you

    Abhishek

  • I don't have the Edit option when using my iPad

    I don't have the Edit option when using on my iPad

    The forum of cloud is not on the use of individual programs

    The forum of cloud is on the cloud as a delivery & installation process

    If you start the https://forums.adobe.com/welcome Forums Index

    You will be able to select a forum for the specific Adobe products you use

    Click on the symbol "arrow down" on the right (where it says all communities) to open the drop-down list and scroll

  • How to set the distribution desc when using interface to import bills of the AP

    I'm working on the importation of processing AP invoices, and there is a problem for me in the future.

    I'm still not find a way to set the description of distribution ap invoice when using interface to import bills of the AP. The version of the application is 12.1.1.

    Does anyone have any suggestions?

    Thanks in advance!

    Hello.

    The DESCRIPTION column in table AP_INVOICE_LINES_INTERFACE does not serve for this purpose?

    Octavio

  • How can I get the default value of the cursor in the address bar when I open a new tab, rather than the cursor by default a search engine text box?

    Using Firefox 17.0.1 and then I XP

    Firefox does by default. You probably have an add-on installed that changed the focus of the cursor in the URL bar of the search bar.

    http://support.Mozilla.com/en-us/KB/troubleshooting+extensions+and+themes

  • How to remove the variable created when using definedNamedWhereClauseParam()

    Hello

    My Jdev version 11.1.1.7.0.

    I'm Executive where clause programatically where I need to bind two bind parameters under certain conditions. Example, I have two bind variables X, Y.

    Here's the problem:

    Assume that the first time I'm setting one variable X, so I define X bind variable and execute the query.

    What second time I send only Y but not X. In this implementation of the scenario of VO throw an exception, given that the variable X is already created in the VO object and where clause does not have this setting.

    So how to remove variables created in the original Version all in definedNamedWhereClauseParam(). I need to erase what ever the previously created variable every time I execute method.

    I can make the similar functionlity using setWhereClauseParam (using literals). But I have a few technical restrictions for use.

    Could you please help me how to remove the variable before vo using definedNamedWhereClauseParam.

    Caused by: java.sql.SQLException: try to set a parameter name that does not intervene in the SQL: itemNumber
    at oracle.jdbc.driver.OraclePreparedStatement.setObjectAtName(OraclePreparedStatement.java:15969)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.setObjectAtName(OraclePreparedStatementWrapper.java:911)
    at weblogic.jdbc.wrapper.PreparedStatement_oracle_jdbc_driver_OraclePreparedStatementWrapper.setObjectAtName (unknown Source)
    at oracle.jbo.server.OracleSQLBuilderImpl.bindParamValue(OracleSQLBuilderImpl.java:4669)
    at oracle.jbo.server.BaseSQLBuilderImpl.bindParametersForStmt(BaseSQLBuilderImpl.java:3687)
    at oracle.jbo.server.ViewObjectImpl.bindParametersForCollection(ViewObjectImpl.java:22742)
    at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:1298)
    ... more than 96



    Thank you.

    -Diette.

    Published by: Vidya Diette on February 28, 2013 08:43

    Hello

    You need access to the variable Manager. Order of reading in the JavaDocs:

    http://docs.Oracle.com/CD/E28389_01/apirefs.1111/e10653/Oracle/JBO/ViewObject.html--> http://docs.oracle.com/cd/E28389_01/apirefs.1111/e10653/oracle/jbo/VariableManagerOwnerBase.html#getVariableManager%28%29--> http://docs.oracle.com/cd/E28389_01/apirefs.1111/e10653/oracle/jbo/VariableValueManager.html--> http://docs.oracle.com/cd/E28389_01/apirefs.1111/e10653/oracle/jbo/VariableManager.html#removeVariable%28java.lang.String%29

    Frank

  • Save the results locally when the database is offline

    Hello world!

    I work to justify the implementation of teststand for automation of test on the company where I work, far it seems that is the way to go, but they are some of the senior management, hesitating on this subject. One of the things that will be great for us (he will give him a +) is the ability to store the results locally on the workstation, where the database is offline (failure of the server or client disconnected from the network), and once he returns, the data is transferred to the database.

    We want to use SQL server for the database. I thought creating a SQL Server express locally on the computer, so all of the results will always be saved in the station first, I tried to use the sql import/export wizard to import data from a sql server to another, but I did not find any way to do it automatically, we are looking for one of the solution of the box free of charge or regular very very cheap It will be installed on each workstation.

    Thanks for your help and congratulations!

    Abelino,

    You can take advantage of the new features in later versions of TestStand.  In 2012, and most recent, you can write raw results.  As said Dennis you could just always write raw results.  Then use the TestStand Offline results new treatment utility write those in the database: http://zone.ni.com/reference/en-XX/help/370052K-01/tsref/infotopics/offline_processing_utility/

    You can create a service or something to do.

    BTW - Plugins can run in its own thread.

  • Why '-' cannot be accepted in the content of the configuration file by using vi key reading

    Thank you.

    turbot wrote:
    I use by default, but replaced by mass code differently every time.

    Do you mean replaced by LabVIEW? If so, the function write key automatically adapts to the type of data that connect you to the Terminal value. Write Key is polymorphic and does not display the ' String is believed to write? F ' option if you right-click on the function and switch from automatic to string.

    I have attached a VI (LabVIEW 7.0) that shows examples of different ways to write and read a path to an INI.

    Open the INI created by this VI and compare the ways data are written and read from the file...

    [Backslash]
    PathAsString = "C:\\Documents and Settings\\pbrooks\\Desktop\\Escaped Backslashes.ini"
    PathAsPath = "/ C/Documents and Settings/pbrooks/Desktop/escaped Backslashes.ini.
    PathAsRawString = "C:\Documents and Settings\pbrooks\Desktop\Escaped Backslashes.ini"

  • When using my computer, all applications and the windows are closed at the same time, got disconnected and the computer turns off as if someone stops manually.

    Original title: it's a virus that's causing this?

    It happened a few times now. While I use my computer, all applications and the windows are closed at the same time, I am disconnected and the computer is off, as if someone manually stops the computer. I turn on the computer and log in and everything seems to be okay. No data deleted, not that I could find and detect anyway. One day when I turned on the computer, it run chkdsk before doing the usual startup. I use the computer for 2 years and this is the first time, she never did a chkdsk on its own. I used Microsoft Essentials and no viruses were found.

    Should I worry?

    Hello

    You can read the following article and try to download the Microsoft Safety Scanner and perform a full scan on your computer and check.

    Microsoft safety scanner

    Note: The data files that are infected must be cleaned only by removing the file completely, which means that there is a risk of data loss.

    Check if there are logs of events related to the issue in the event viewer which may help us to solve the problem of the:

    What are the information contained in the logs of the event (Event Viewer)?

Maybe you are looking for