This discussion is archived
12 Replies Latest reply: Mar 18, 2013 2:31 AM by Tarun.Oracle RSS

going to the end of the text_item's string

newbi_egy Explorer
Currently Being Moderated
db and dev 10g rel2 ,
hi all ,
i've two text_items for instance , t1 and t2 ,
suppose that the t1 has a string 'scott' ,
what i want is , when i get into the t1 , the cursor goes to after the last charachter "t" in the string ,

-- offcourse you know that the normal functionality is to highlight the whole string when you enter any text item , and when you write any thing , the string is overwritten . -- and that is what i do not need , i need to write beside the existed string ?.

thanks
  • 1. Re: going to the end of the text_item's string
    user346369 Expert
    Currently Being Moderated
    Good luck. Oracle has never been able to make this requirement work.
  • 2. Re: going to the end of the text_item's string
    Christian Erlinger Guru
    Currently Being Moderated
    I guess you could write your own PJC extending VTextField, add a MouseListener to it and set the Position using setCaretPositon:

    Something like
    public class MyTextField extends VTextField
    {
      public MyTextField()
      {
         this.addMouseListener(new MouseAdapter() {
         public void mouseClicked(MouseEvent e)
         {
           setCaret();
         }
       });
      }
      private void setCaret()
      {
        this.setCaretPosition(this.getTextLength());
      }
    }
    I didn't test it, but it might work...

    cheers

    Edited by: christian erlinger on 14.03.2013 10:39

    typo
  • 3. Re: going to the end of the text_item's string
    user1935693 Newbie
    Currently Being Moderated
    Have you looked at the cursorpos.jar provided with the Oracle Forms Demo Pack? I'm not sure where you can download the 10g version of that since Forms 10g is no longer supported, but it does exactly what you're asking for. I'm using it with Forms 10.1.2.3.0 and it works fine. I have this in the WHEN-NEW-RECORD-INSTANCE trigger for the block containing the text_item.

    -- set cursor position of URL fields
    CursorPos.setCaretPosition(
         pfield => 'BLOCK1.URL',
         prownum => TO_NUMBER(Get_Block_Property(block_name => 'BLOCK1', property => CURRENT_RECORD)),
         ppos => CursorPos.FIELD_END);

    The Implementation Class property of the BLOCK1.URL Text_Item is oracle.forms.demos.enhancedItems2.CursorPosTextField.

    The code for the CursorPos Program Unit is included in the Oracle Forms Demo Pack.

    HTH,
    Brian
  • 4. Re: going to the end of the text_item's string
    newbi_egy Explorer
    Currently Being Moderated
    The code for the CursorPos Program Unit is included in the Oracle Forms Demo Pack.
    i've found this solution , i think it is helpful like yours
    http://sheikyerbouti.developpez.com/send_key/Send_key.htm,

    but i want to know what is the demo pack please , i've 10g rel2 , does it exist in it ? ,
    and what is the demo pack for ? i know nothing about it .

    thanks to all of you
  • 5. Re: going to the end of the text_item's string
    user1935693 Newbie
    Currently Being Moderated
    Hi,

    The Oracle Forms 11g Demo Pack is available for download here:

    http://www.oracle.com/technetwork/developer-tools/forms/downloads/index.html

    If you have a support contract with Oracle maybe you could get the 10g version via a Service Request.

    Brian
  • 6. Re: going to the end of the text_item's string
    newbi_egy Explorer
    Currently Being Moderated
    The Oracle Forms 11g Demo Pack is available for download here:
    what is demo pack used for ?
  • 7. Re: going to the end of the text_item's string
    user1935693 Newbie
    Currently Being Moderated
    This is in the install guide that's in the demos_11g.zip file:

    "The Forms Demos contain sample applications designed to show various features of Forms. The original source code is included so they can serve as a basis from which you may utilize the same features in your applications."

    One of the demos is a PJC that allows you to control the position of the cursor within text items. From the documentation that is in demos_11g.zip:

    "The CursorPos Pluggable Java Component (PJC) provides extended versions of single line and multi-line text items. These enhanced items allow the caret (cursor) position or selection of a field to be controlled. This control is provided via a PL/SQL that you can use in Forms, which interacts with the PJC."

    There's much more than just CursorPos in the demos so even if that doesn't fit your needs, you might find something else useful like a calender PJC or a progress bar PJC.

    That being said, I have no idea where to get the 10g demo pack any more since Forms 10g isn't supported.

    Good luck,
    Brian
  • 8. Re: going to the end of the text_item's string
    newbi_egy Explorer
    Currently Being Moderated
    do not i get this demo pack with the installation ? or should i download it separately ?

    2- can not i use demo 11g in my forms 10g ? i mean can not use any version of any demo with another version of forms ?

    thanks a lot man
  • 9. Re: going to the end of the text_item's string
    user1935693 Newbie
    Currently Being Moderated
    You have to download the demo pack separately from the installation files and only install the demo pack after your Forms installation is fully functional.

    I personally don't know if you can use the 11g demo files with 10g. They do include source code so you can compile them in 10g and see what happens. You might have to recreate the PJC jar files; I have no idea.

    Brian
  • 10. Re: going to the end of the text_item's string
    Andreas Weiden Guru
    Currently Being Moderated
    There are forms modules in the demos, and you can't open 11G forms-modules with 10G forms-builder.
  • 11. Re: going to the end of the text_item's string
    HamidHelal Guru
    Currently Being Moderated
    10g Demo download link in not available now on.. But i post for you Click Here.

    Hope this helps

    Hamid
  • 12. Re: going to the end of the text_item's string
    Tarun.Oracle Newbie
    Currently Being Moderated
    You simple do one thing.
    In the fields property "Keep Cursor Position" to "yes".

    When ever you navigate to the field your cursor will be at the position where it was lastly.

    I think this will solve your problem.

    Tarun

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points