How to auto complete text field

Hello!
I have the following behavior request for a text field.
An user must write a date in a text field. The date format is yyyy/MM/dd (as 2003/02/04). The user would begin writing "2003" followed by the "0" character but would see in the text field "2003/0". The "/" would be automagically putted there.
I hope this table will make the behavior more clear.
User User
writes sees this in the text field.
2003 2003
20030 2003/0
200302 2003/02
2003020 2003/02/0
20030201 2003/02/01
Also, if the user deletes the characters "1" and next the "0" from the previous example, it would automatically erase also the "/" character.
Could someone point me to some sample code or give me some clues how to implement the previous behaviour? Does this pattern behavior has some well know name, where I can "google" for?
Thanks!
Eduardo

Hello!
I found a solution for my request feature, explained above.
Maybe someone will find it also usefull.
Regards,
Eduardo
public class JFormattedDateTextField extends JFormattedTextField {
Format _formatDt = new SimpleDateFormat("yyyy/MM/dd");     
public JFormattedDateTextField() {
     super();
     MaskFormatter mformat = null;
     try {
          mformat = new MaskFormatter("####/##/##");
     } catch (ParseException e1) {
          e1.printStackTrace();
     mformat.setPlaceholderCharacter('_');
     setFormatterFactory(new DefaultFormatterFactory(mformat));
     this.addFocusListener(new FocusAdapter() {
          public void focusGained(FocusEvent e) {
               if (getFocusLostBehavior() == JFormattedTextField.PERSIST)
                    setFocusLostBehavior(JFormattedTextField.COMMIT_OR_REVERT);
          public void focusLost(FocusEvent e) {
               try {
                    Date dt = (Date) _formatDt.parseObject(getText());
                    setValue(_formatDt.format(dt));
               } catch (ParseException pe) {
                    setFocusLostBehavior(JFormattedTextField.PERSIST);
                    setText("");
public void setValue(Date strDt) {
     super.setValue(convertDateToStr(strDt));
public Date getDateValue() {
     return convertStrToDate((String)super.getValue());
public EFADateValue getEFADate() {
     return new EFADateValue(getDateValue());
private Date convertStrToDate(String txt) {
     Date date = null;
     if (txt == null) return null;
     try {
          date = (Date)_formatDt.parseObject(txt);
     catch (ParseException pe) {
          date = null;
     return date;
private String convertDateToStr(Date date) {
     try {
          return _formatDt.format(date);
     } catch (Exception e) {
          return "";

Similar Messages

  • How to auto-complete text field in the form?

    Hi,
    I have a table CustTable that has 2 columns:
    1. Column_A
    2. Column_B
    I have a form that has 2 fields:
    1. Field_A - Lookup Field - it takes data from a custom table lookup (Lookup Query: SELECT Column_A from CustTable) - it works fine.
    2. Field_B - Text Field - I would like to autocomplete this field (as value from Column_B) based on the value selected in the Field_A (SELECT Column_B from CustTable where Column_A = "value from Field_A") - is it possible to autocomplete a text field ?
    I have made it using 2 lookup fields and it works, but then user has to make a select on the lookup twice and I would like to make it only once.
    Thanks in advance!

    I don't think w/o UI Customization it is possible.
    UI customization won't be a small one as it is a common wizard and used at multiple places. So it will be a huge work.

  • Tutorial Announcement :: How To Use Auto Complete Text Form Control ::

    Hello Everyone...
    Here in this tutorial we gonna to learn a new and amazing feature of (ADDT), we will learn how to use Adobe developer toolbox (ADDT) form controls.
    Form controls help you to add a fantastic features to your forms, that helps you to expand the form abilities and functionality...
    The Auto complete Text Field is an enhanced text field that dynamically completes what you type with matched values from a table. You can also select the values from a list.
    You can use the Auto complete Text Field in user registration forms, such as allowing users to select their country or city easier, Also in other forms that needs the user to pick one of many choices without any difficulties.
    Requirements
    To complete this tutorial you will need to install the following software and files:
    Adobe Dreamweaver Cs3
    Adobe Developer Toolbox (ADDT)
    Don't forget: to try out the Demo type the first three letters :A - B - C
    :: Go To Tutorials ::
    :: Go To Tutorials ::
    Best Regards
    Waleed Barakat
    Developer-Online Creator and programmer
    http://www.developer-online.com

    Heya Waleed,
    I use spry to create an autocomplete form that works great across browsers that have javascript enabled. You can store info in a database and parse the info to xml for a dynamic approach. Take a look at the filter examples in spry.
    http://labs.adobe.com/technologies/spry/samples/data_region/NonDestructiveFilterSample.htm l
    http://labs.adobe.com/technologies/spry/samples/data_region/ZuggestSample.html

  • How to create Auto complete text box in share point 2010 Visual web part

    Hi All ,
    I am want to use Auto complete text box in share point 2010 Visual web part ,data need to get from share point list how to  create 
    please guide me how to use Auto complete text box
    Thanking you,
    Arun Darly

    Hi Arun,
    Please refer to the following article.
    SharePoint 2010: JQuery Autocomplete Textbox Containing List Items
    http://smarttools.codeplex.com/wikipage?title=Autocomplete%20Text%20Field
    Please don't forget to mark it as answered, if your problem resolved or helpful.

  • How to auto populating the field in MS crm

    How to auto populating the field in MS crm

    Hi,
    To populate URL of account based on account name please refer this link.
    If you are asking about the address auto populate/complete refer this link
    To Retrieve from other entity and populate the fields, for example on entering the account name in opportunity form the fields from account form like Sector, Region can be retrieved and can be auto populated in opportunity form using Odata as follows.
    Call the function getAccountDetails in onchange event of Companyname. Do not forget to add Jquery and Json in libraries.
    function getAccountDetails() {
        var companyName = Xrm.Page.getAttribute("customerid").getValue();
        if ((companyName != null)) {
            var companyNameValue = companyName[0].name;
            var companyNameID = companyName[0].id;
            var serverUrl = Xrm.Page.context.getServerUrl();
            //The XRM OData end-point
            var ODATA_ENDPOINT = "/XRMServices/2011/OrganizationData.svc";
            var odataSetName = "AccountSet";
            var odataSelect = serverUrl + ODATA_ENDPOINT + "/" + odataSetName + "(guid'" + companyNameID + "')";
            //alert(odataSelect);
            $.ajax({
                type: "GET",
                contentType: "application/json; charset=utf-8",
                datatype: "json",
                url: odataSelect,
                beforeSend: function (XMLHttpRequest) { XMLHttpRequest.setRequestHeader("Accept", "application/json"); },
                success: function (data, textStatus, XmlHttpRequest) {
                    var result_account = data.d;
                    var name;
                    var Id;
                    var entityType;
                    //replace the fields with the fields on your entity
                    Xrm.Page.getAttribute("new_sector").setValue(result_account.new_Sector.Value);
                    Xrm.Page.getAttribute("new_region").setValue(result_account.new_Region.Value);                     
                error: function (XmlHttpRequest, textStatus, errorThrown) { alert('OData Select Failed: ' + odataSelect); }
    Also as another option if you donot wat the java script then you can go for a workflow to poplate, please refer this link:  https://www.powerobjects.com/blog/2013/11/25/retrieving-data-from-a-related-entity-crm-2013/
    Regards, Rekha.J

  • How to add new text field in standard report

    how to add new text field in standard report?

    Hi,
    I presume you are talking about a report display in ALV and u wish to add a column to it .
    If it is a global requirement ,as in table being used there in ALV can be modified, then you can append the table and the system should pick up the same automatically from there.
    Otherwise , you can make a Z program . Modify the catalog being used in ALV.
    Regards,
    Shweta

  • Auto populate text fields with a trigger such as entering text into input fields in ADF

    Hello all,
    I am not able to auto populate text fields with a trigger such as entering text into input fields in ADF.
    I tried AdfFacesContext.getCurrentInstance().addPartialTarget(val); in the back end using setter method of input text field.
    its not working ..
    is there any way to achieve it
    Regards,
    Shakir

    Hi,
    Always mention your JDev version.
    The valueChangeListener would fire only when you set the autoSubmit property of the field to true. Can you elaborate your requirement? What do you mean by related data? Are you performing some sort of search?
    If you want to get the value you entered on the field, just set autoSubmit to true and get the new value from the valueChangeListener. If your requirement is something like as and when you type, do something, you need to check out this approach :https://blogs.oracle.com/groundside/entry/auto_reduce_search_sample
    -Arun

  • How to populate the TEXT field in MIGO

    Hi folks,
    While creating material document in MIGO or MB01, i am inserting some data in TEXT ( Field in line item level ). This text data is disappearing , once mat doc is created.
    how to populate the TEXT field in MIGO?Is there any cusomisation?it's urgent .
    Regards
    pabi

    Hello Pabitra,
    I had a similar issue in my Project.
    Please verify if the SMOD enhancement MBCF0002 (EXIT_SAPMM07M_001) is active in your system.
    If this is the case, verify from two angles:
    a) Whether the Enhancement was accidentally activated - If yes, then De-activate the same
    b) If there is some logic coded in the User Exit, but, the Text is somehow not determined...even the existing content in the text field (input to EXIT_SAPMM07M_001) will get vanished.
    Hope that your problem will be resolved by this.  Pls reward points.
    With Regards
    Vijay Gajavalli

  • How to collapse unused text field in PDF form

    Hi all, may i know how to collapse unused text field in a PDF form. Etc, we have alot of description line for user to enter the info, but some line will be left unused, so i was wondering whether can i hide those unused text field. But when i need them, i just expand it and use it.

    I don't think w/o UI Customization it is possible.
    UI customization won't be a small one as it is a common wizard and used at multiple places. So it will be a huge work.

  • How to validate an text field item using javascript for numbers only.

    hi,
    how to validate an text field item using javascript for numbers only.please help me on this urgent
    please mail me solun if posible on [email protected]

    Hi,
    Page HTML header
    <script>
    function onlyNum(evt) {
      // Usage: onKeyPress="return onlyNum(event)"
      evt = (evt) ? evt : window.event;
      var charCode = (evt.which) ? evt.which : evt.keyCode;
      if (charCode > 31 && (charCode < 48 || charCode > 57)) {
        var status = 'This field accepts numbers only!';
        alert(status);
        return false;
      var status = '';
      return true;
    </script>Item HTML Form Element Attributes
    onKeyPress="return onlyNum(event)"Br,Jari

  • ITunes 10.5 crashes every time I type in an auto-complete enabled field

    Greetings,
    I have my music collection on a NAS drive, and have recently upgraded my laptop and so moved the iTunes library files to the new machine.
    Both the old and new machines run Windows7 Home Premium 64-bit.
    While playing and syncing work well, I am unable to edit any auto-complete enabled field in a track's (or track group's) properties (e.g. artist, album) without having the iTunes application crash immediately.
    I am able to edit these fields only by pasting from an external editor (e.g. open notepad, write the new content, copy, switch to iTunes and paste).
    I have tried a complete uninstall of iTunes (including apple program support), but the issue recurred after iTunes was re-installed.
    Any help will be appreciated.
    Best regards,
    ShaiB

    Greetings,
    I have my music collection on a NAS drive, and have recently upgraded my laptop and so moved the iTunes library files to the new machine.
    Both the old and new machines run Windows7 Home Premium 64-bit.
    While playing and syncing work well, I am unable to edit any auto-complete enabled field in a track's (or track group's) properties (e.g. artist, album) without having the iTunes application crash immediately.
    I am able to edit these fields only by pasting from an external editor (e.g. open notepad, write the new content, copy, switch to iTunes and paste).
    I have tried a complete uninstall of iTunes (including apple program support), but the issue recurred after iTunes was re-installed.
    Any help will be appreciated.
    Best regards,
    ShaiB

  • How to rotate a Text Field?

    Is there anyone who knows how to rotate a Text Field? I just need to move some degrees (for example: clockwise).
    Thanks in advance for any help you can provide

    You can onlt rotate it in 90 degree imcrements ...this is controlled on the
    layout tab next to the anchor setting.
    Paul

  • How to create-Form text field to simultaneously preview the text over an image

    I am trying to make a web page similar to the link below…where when a customer types in the form text field, and simultaneously, the text will preview in another area of the webpage over and image. See example when you create a label @ www.customwinesource.com custom labels…http://www.customwinesource.com/index.cfm?method=storepairing.listPairing&wineryid=auto
    Any help would be much appreciated

    I wasn't able to (easily) find anything in the way of a textfield to type something into that you describe, but you can assign code for input textfields to detect when something changes in them and take action from that event.  How you do it depends on which version of actionscript you are using.

  • Auto Complete Text

    How do I turn off the auto complete in texting?  It is a nuisance.  Thanks. 

    No, the 8330 doesn't.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Forms 11g auto-complete date field

    Hi,
    In forms60 we had a few registry keys that made it possible for the end user to type in parts of a date and have it auto-completed.
    Example :
    The user wants to type in 20/10/2010 but merely had to type in 20<ENTER>
    This worked in forms60, is there a way to achieve this in forms 11g?
    Thank you
    PS: I have already tried
    NLS_DATE_FORMAT=DD/MM/YYYY
    FORMS_OUTPUT_DATE_FORMAT=DD/MM/YYYY
    FORMS_USER_DATE_FORMAT=DD/MM/YYYY
    In default.env with no luck.

    Dear Christian, yes I am certain.
    I just investigated it a little more and it appears it all depends on the following registry keys :
    HKLM\Software\Oracle\forms60_user_date_format which has value : ddmmyyyy|ddmm|dd|dd/mm/yy|ddmmyy|dd/mm|dd/mm/yyyy
    HKLM\Software\Oracle\forms60_user_datetime_format which has value : ddmmyyyyhh24mi|ddmmyyyy hh24mi|dd/mm/yyyy hh24:mi|ddmm hh24mi|ddhh24mi|dd hh24mi|ddmmhh24mi|ddmmyyyyhh24mi
    These appear to define in what formats a user can input a date.
    The one I was talking about appears to be about the *|dd|* which would imply the user can input the day and the rest will be autocompleted.
    I did find another thread about this issue, but it is for 10g and they never really found out the whys and hows...
    Date field in 10g Form
    Thanks for your help.

Maybe you are looking for

  • Firefox can't open the application "because it is not supported on this architecture

    "You cannot open the application "Firefox" because it is not supported on this architecture."

  • How to use GSS and JAAS with kerberos

    Hi, I am new to this subject, I have setup a kerberos server on win 2000, and i have registered my other servers to it, this setup works fine , now what i have to do is the following 1, Display a HTML page where i will take the user id and password f

  • Cannot insert PS_TXN ORA-00942 table or view does not exist

    We are using jdev 11.1.1.4.0 We have two users in the database and various application modules which connect to these users using datasources We have tested the application with applicatin module pooling enabled off to test for passivation and activa

  • Audigy, no sound after rest

    I recently formatted my hard dri've. After I finished installing Windows XP, I got my Sound Blaster Audigy, DR release 2.2. driver from this website. Except whenever I restart my computer, the sound doesn't work and I have to reinstall the driver to

  • Health and Utilization Monitor page

    Hello, On my ciscoworks hum page, by default i have the cpu utilization summary chart and device availability report chart (2 pie graphs). The chart for device availability is for 30 days. When i click on my pie chart, i only see data for the last da