7 Replies Latest reply: Jun 15, 2013 12:08 AM by mostafiz mitul RSS

    Disable auto removing spaces from text-fields in Oracle Forms 4.5

    885756
      Hi everybody!


      Its my first post here, and i hope that somebody could answer for my question :)


      I'm making search form (kind of filtering table) in Oracle Forms 4.5

      Its based on one table and text fields to enter some data. Lets say that data to enter in this text field is "name and surname".

      While entering these information every 500ms timer is firing and re-query (filters) table by information entered so far.

      Everything works fine until the moment when user have to input a space dividing name & surname ex. "Jeff Long". Entering "Jeff" filters table to every guy that has name "Jeff" but it impossible to enter "Jeff ". Oracle automatically deletes space after "Jeff " every time trigger fires. Workaround is to enter "Jeff_" or fast enough (<500ms) "Jeff L" in order to have space between some letters. Other option is to divide name and surname into 2 different text fields. But is there an option to force Forms not to rtrim values in text-fields or some other workarounds?



      Thanks in advice.
        • 1. Re: Disable auto removing spaces from text-fields in Oracle Forms 4.5
          Kleber M-Oracle
          Cannot test it now, as I no longer have Forms 4.5... have you tried changing data type CHAR <> VARCHAR?
          • 2. Re: Disable auto removing spaces from text-fields in Oracle Forms 4.5
            CraigB
            Every version of Oracle Forms I have worked with (Forms 4.5 - 11g) has automatically trimmed spaces from CHAR fields. Oracle allows you to evaluate spaces by enclosing the string value in Double-Quotes ("Jeff "). From forms, I don't know for certain that typing "Jeff " in your field will work as I don't know for certain if Forms 4.5 supports this. I can tell you that in Forms 10g, adding the double-quotes does not work - at least not in the quick test I conducted. If you goal is to search for any instance of 'Jeff' why not just include the wildcard "%" automatically in your query code?

            Craig...
            • 3. Re: Disable auto removing spaces from text-fields in Oracle Forms 4.5
              885756
              CraigB my goal is to be able to search a phrase containing two or more words. And as i wrote here before: Trriger is firing every 500ms and it takes information from field and query (like filter [adding ||'%']) with it my table. But its impossible to write word and after that a space (so its also impossible to write "Jeff[space]") because every time timer is triggering, Oracle Forms is leaving the field we are talking about, and trims it from spaces.

              TABLE

              NAME$SURNAME ___ ID
              Jeff Long 1
              Jeff Short 2
              Mark Spencer 3
              Karol Kowalski 4


              SEARCH FIELD:
              Jeff S


              ^ This should filter table with:= "Jeff S||%" and it does (im using ||% concatenation later in script) BUT only when u write in search field "Jeff_S" (using _ not space) or u write "Jeff S" fast enough (<500ms) to avoid TRIGGER: when timer expired, because when it catches u in a moment that your search Field looks like "Jeff " (with space at the end) it trims last space from search field and it is impossible to search Jeff with specified surname ;)


              is it clear now? :) sorry 4my english ;P

              Edited by: lapa on 2011-09-01 07:32
              • 4. Re: Disable auto removing spaces from text-fields in Oracle Forms 4.5
                CraigB
                because every time timer is triggering, Oracle Forms is leaving the field we are talking about, and trims it from spaces.
                Yes, this is an annoying limitation of Timers; which begs the question "Why do you need to use a Timer?" It sounds like you are trying to implement some type of auto-reducing list as the user types their search criteria. Given the fact that you are using Oracle Forms 4.5, I would recommend you simply let the user enter their search criterea and then have them click a search button or use the default functionality of Enter Query mode and Execute Query (F7 and F8 if I remember correctly).
                is it clear now?
                Very clear! I've run into this very issue myself. It forced me to question whether I needed the Timer or not and if yes, to question if I had the delay set appropriatly. Perhaps a 500 millisecond delay is too short and your users need more time to enter their search criteria?

                Craig...
                • 5. Re: Disable auto removing spaces from text-fields in Oracle Forms 4.5
                  885756
                  When data table\view to search is quite large (about 20 columns) and every column is important, there are 20 filter fields. Having to press the button every time to search and find out if entered data correctly filters our table is quite annoying :D So "the need" of live search is rather a "must have" option. Looking at ur post count makes me pretty sure that its almost impossible :( :D

                  Edited by: lapa on Sep 1, 2011 10:25 PM
                  • 6. Re: Disable auto removing spaces from text-fields in Oracle Forms 4.5
                    CraigB
                    The problem with the Timer is that the Focus leaves the current item (this is true in Forms 10g as well). This is what causes the field to loose the trailing space.

                    For your situation, another option would be to reduce the list after they have finished entering the criteria in the search field. You will still need to use a Timer, but the Timer will fire in response to a When-Validate-Item (WVI) trigger and is not a repeating timer. In other words, you user would enter their criteria in the field and the WVI trigger will create a 1 millisecond non-repeating timer. The When-Timer-Expired (WTE) trigger will then requery your form similar to what you are doing in your timer now - only specific for the field. Unfortunately, you would have to do this for each field you want to semi-automatically reduce your displayed records on. It's a bit of work, but it might get you close to what you want. ;-)

                    Craig...
                    • 7. Re: Disable auto removing spaces from text-fields in Oracle Forms 4.5
                      mostafiz mitul

                      here is the complete solution - find the attachment

                      here i've done auto complete lov like google search hint

                      using oracle 6i........ and 10g database

                      its also possible in 10g developer suite

                       

                      http://itjumitul.yolasite.com/resources/MODULE1.rar