Using Text fields in SWT

Well, the people over on the Swing forum didn't like when I put this over there, and I can't find a dedicated SWT forum, so I hope I can get an answer over here...
In my GUI (developed using SWT), I have a Text field called date.
It appears in the window with this code
date = new Text(dialogShell, SWT.NONE);
date.setBounds(42, 49, 119, 14);
date.setEnabled(false);When the window is started, the appropiate date is set.           date.setText("1/1/2000");However, when the application is run, it chokes on the setText field, throwing a NullPointerException. I can't figure out why it's throwing that exception, even with an explicitly set date. The code to set the Text appears to follow the code in a SWT book I use for reference. Am I missing some small detail? Why the NullPointerException, and what should be done to fix it?

Here's Eclipse's SWT "forum": http://www.eclipse.org/newsgroups/main.html

Similar Messages

  • Insert Date Using Text Field

    Hi,
    i have date item ,Can i insert date from text field in dd/mm/yy format.
    My Column for date is DATE type in table.
    How can i ido this with Text field .
    Thanks

    I think you want to have text field for user to input the date? (instead of date picker item type)
    If you are using custom PL/SQL code, it is fine, because you just use to_date(:Px_DATE_ITEM, 'dd/mm/yyyy'); or whatever format you are expecting, in your insert statement.
    If it is a DML process type, I don't think it's possible - apex probably converts the text from the data picker into a date datatype at run time, but not sure it'd do it when its just a text box.
    Ta,
    Trent
    Edited by: trent on Jan 28, 2011 10:57 PM
    I take that back. So long as you have specified the application date format in the globalization attributes, and the format in the text box is the same/valid (otherwise it must be in the format as specified in NLS_DATE_FORMAT), it will insert no trouble in a DML process. http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15517/bldr.htm#CHDBHCBB

  • Expanding text field in table

    Hi,
    I’m pretty inexperienced with Live Cycle and was hoping I could get some help using text fields within a table.
    I’m creating a form with a table into which the user enters information. I’d like the row height in the table to adjust to the amount of text entered into the text field so as that if necessary the table will expand onto a subsequent page.
    The table exists within a subform and the text fields exist with in the table. In searching this forum I seen talk of dynamic tables but not sure how to achieve this.
    Any help would be much appreciated.
    Thanks
    Graeme

    To make the textfields grow you need to select 'Expand to Fit' under height in the Layout tab. In terms of going onto another page you need to select 'Allow Page Breaks within Content' in the Object>Field tab and make sure your subform is flowed not positioned.

  • Data from one text field to another text field on the next page

    Hi all,
    Hi I have a form, which has data coming in from the data binding, the thing is the data is mapped to a certain text field and if that text field is filled up it should be continued on to the other text field which is on the immediate page following it. the reason for using text field instead of  Subform and make it expandable is  the client does not want to change the position and structure of other fields following that field, they are o.k with the amount overflowed in to the next text field .
    is there any script for the same condition in Java script or form calc.
    Thanks in advance.
    de1209

    This is not as simple as it sounds. You will not be able to split the field up during the time of binding. The entire string must go into the field and only after it has completed the biinding can we change it around. A colleage of mine did this for an interactive field and it involved some pretty complicated code. Here is a link to her blog entry that describes what she did:
    http://blogs.adobe.com/lcdesigner/2008/07/an_example_of_splitting_text_a.html
    But that is only part of the problem.....once you split the information across two fields you will need to recombine it back into a single field so that the data that is submitted can represent it correctly again. So you will have to reverse the process in a presubmission step.
    Make sense?
    paul

  • Marketing attribute in the text field, interactive script

    Hello Gurus,
    We are facing a problem in the interactive script, of the sap crm 7.0.
    We know the possibility of set some of the customer data into the
    script by filling bdc field inthe test field and then adding this text
    field to a script question.
    We did it in the customer data "***" by filling the bdc field with "ext
    field marketing attribute interactive script" and this data is showed
    in the script, but we can not show marketing attribute data in the
    script by using text field and bdc field.
    There is a possiblility of showing the marketing attribute in the text
    field or it is imposible due the structure of bol in crm.
    Thanks  in advance.

    Hello ,
    To display or change the marketing attributes of a business partner in the script follow these steps:
    1.  Run the Interactive Script Editor.
    2.  Create a new Question and in the Answer Area drag and drop the "Marketing Attribute" dynamic answer.
    3.  Select the "Marketing attribute will display here when executing the script" object and go to tab "Dynamic Content Parameters".
    4.  Select the attribute set and the attribute name.
    5.  Save the question.
    6.  Drag and drop the question to your script.
    7.  Change the template of the question node to either "Person Marketing Attributes" or "Organization Marketing Attributes" depending on what type of business partner is expected to be confirmed at run time in the IC_AGENT role.
    8  Save the script.
    9.  Run IC_AGENT or similar IC role.
    10. Confirm an organization ( if you used "Organization Marketing Attributes" ).
    11. Run the script.
    When you reached the question maintained above, the marketing attributes will render for that business partner, if they exists or will be created if they don't exists . To be created a button that will do a navigation is required. It means that the question will have to be linked to a next question or to itself by this button (to itself is required only if it is the last or the only question in the script). To suggest to the user that he or she has to click on the button, to save, is probably better to name the button "Save".
    Octavian

  • Locked in text field

    I'm setting up a daily calendar using text fields for a person to enter their name in a certain time spot. Is there a way that once their name is in that spot on the calendar it is locked in so that no one else can delete or change it? Thanks for the help.

    You can set a text field to be read-only with JavaScript in the Validate event:
    // Custom Validate script for text field
    // Set this field to read-only if it's not blank
    event.target.readonly = event.value ? true : false;
    You can set up something to change it back to not read-only, but exactly what that is depends on how you want it to work.

  • Adding additional text field to infotype in SQ02

    Hi ,
    I am trying to create an additional text filed to the infotype 0034 in a customized infoset, in Tx SQ02 as shown in the link below:
    http://help.sap.com/saphelp_nw04/helpdata/en/d2/cb4468455611d189710000e8322d00/content.htm
    Here the question is :
    The check box "Detemine LIKE reference using text field" is grayed out and I couldn't able to check the box.
    Can any one help me to resolve this and let me know what is the significance of that check box?

    Hi Suresh,
    I tried running the query after deleting the newly added text fields to the infoset, the query is running properly with out any short dump, where as with the additional fields added it is going to short dump and the shot dump states as shown:
    An exception occurred. This exception is dealt with in more detail below          
    . The exception, which is assigned to the class 'CX_SY_DYN_CALL_ILLEGAL_FUNC',    
    was neither                                                                      
    caught nor passed along using a RAISING clause, in the procedure "%_GET_PERNR"    
    "(FORM)"                                                                         
    Since the caller of the procedure could not have expected this exception          
    to occur, the running program was terminated.                                    
    The reason for the exception is:                                                  
    The program "!QZZ/SAPQUERY/H2AAVULA27174228" contains a CALL FUNCTION             
    statement. The name                                                              
    of the function module to be called is "RPAQ_GET_AF_0034".                                                                               
    No function module exists with the name "RPAQ_GET_AF_0034".                       
    All function modules are stored in the Function Library (SE37).                                                                               
    Possible reasons:                                                                 
    a) Wrong name specified. Particular attention should be paid                      
       to upper/lower case and underscores ("_")                                      
    b) Transport error                                                                
    c) If an enqueue/dequeue module has been used, the lock object                    
       may not have been activated (ABAP Dictionary)         
    Any help?
    Best regards
    Vamsi

  • Ad hoc query text field reference

    Hi all,
    Faily new to all this and wonder if you have any insight on the following:
    In ad hoc query I'm adding additional fields to a functional area. They subsequently show up in SQ02 in the left hand pane tree structure for that functional area.
    Now, if I double click on one of the additional fields the most central pane shows the details of this field. One of the boxes in there called 'References' contains a field 'Text field' that associates a long text with the code that the field contains.
    As a made-up example: the add. field could be Personnel Area, value "XY01", and it is associated with a field Personnel Area Long Text that contains "Xeta Yoyo Regional Office". This is the association shown in 'References' -> 'Text Field'.
    My problem is that this 'Text field' field seems to be populated automatically, that is there is some kind of automatic link between the field and the foreign field that contains its associated long text. Also it's greyed out so un-editable.
    Does anyone know where this relationship comes from? Does anyone know how to be able to edit this 'Text field' field?
    Grateful for help,
    Richie

    Ok, I'll try to be a bit clearer.
    For infosets in Ad Hoc Query, a field has an option to be related to another, different field that provides the long text version of this. Example: field P1000-OTYPE 'object type' is related to T7770-OTEXT 'object type text'.
    This relationship is displayed for each infoset additional field: right click on the add. field ->  display/change definition, text identification ->  'Determine LIKE reference using text field' in the pop up window.
    Problem is this text field is <b>always</b> greyed out and uneditable. So the question was, how do you set this yourself?
    Hope this clarifies stuff, thanks for any help,
    Richie

  • How to add a instruction to a text field

    Dear all,
    I am trying different ways to add a guideline to a text field. I tried
    1/ To insert a comment, but clearly it is not working with an interactive form in Adobe Acrobat,
    2/ To use text field and set the guideline as default value on the object palette but the problem are
    - The text field is not expanded horizontally even I chose Expand to fit option
    - The guideline does not disappear in case user do not use it
    - The box does not shrink also as users do not type enough lines
    3/ To use text instead of text field for the guideline, the problem is
    - There will be a large space between the two parts since the guideline is not supposed to be printed.
    My question is whether there is a smarter way to suggest users typing in the text field by giving the instructions without having it printed out. For instance, is there a way to have a hidden box, you know, it appears as users drag a mouse or click the field?
    I know this is might be a naive question, but please help me out. I would really appreciate.
    Edigo

    Wow there is a lot to cover in this thread......
    1. A flowed subform means that the content within that form will be placed from left to right top to bottom. In your case where you want to place objects beside each other they need to be within a positioned subform (this means the objects will maintain their position relative to the subform boundaries). So in your case I would break up the form into logical sections and wrap those sections into a flowed subform (make the subform dimensions span the page) then wrap all of the sections in a Page subform that is flowed. Now when it flows everything the positioned subform containers will span the page and will keep theobjects where they are positioned.
    2. Each cell can only house 1 object. You could add another column to add the second course date.
    3. You can add as many rows and columns as you need....so yes you could add a course code.
    4. The form can access a database for filling the form or for writing to the DB, but there are a few things you shoudl know. Reader does not have this capability and it must be enabled using LiveCycle Reader Extensions. This is a server based product so it is priced as such. If you have a small number of users it might be more cost effective to buy Acrobat for each user. Once that is taken care of the connection to the DB is controlled by an ODBC driver in the Windows OS. This means that each machine that loads the form will need to have this driver configured (cannot be automated) as well this solution will only work on a Windows machine. In bigger installations this becomes a maintenance nightmare for most IT shops. Do you still want to proceed down this path?
    5. A form can only create a single data file structure ....I do not understand what you mean by the last point....can you elaborate?
    Paul

  • Trying to use web app text field to redirect a page.

    I am trying to create a web app, that will provide 'members' with a page that they can use to redirect to other pages of their choice. What I want to do is allow the member user to select (from a dropdown menu, or even input their own into a text field) a specific url (i.e. http://www.facebook.com/myfacebookpage) on their customer page. Once they select the url they want, and save their info, that url will be used in a redirect page, (i.e. <meta HTTP-EQUIV="REFRESH" content="0; url={tag_redirectURL}"> or something to that effect. Has anyone done this or have any ideas how to do it? Ultimately, I want the user to be able to change on the fly where someone goes when they share their user link with a friend (i.e. http://www.mywebsite.com/userpage/ will take someone to a facebook page or to a youtube video, or some other page they redirect to) so they can switch it on their own when they choose to.

    Hi Scott,
    You could create a web app which as a text (string) field in it for customers to enter the URL they want to redirect the customers to. Then place a JavaScript redirect inside the detailed layout, which would look like this:
    <script type="text/javascript">
    <!--
    window.location = "{tag_your-url-field}"
    //-->
    </script>
    Give them access to secure zone, place a web app item creation form onto it and you're good to go.
    Cheers,
    mario

  • HT5392 How can I use an Action List to re-order my layers in iAd Producer?  It looks like there's a tool for this, but I can't figure out how to use it.  I want to use a button to switch between a text field and a drawing pad layer.

    I am working on an iBooks Author Widget and want to allow the user to switch between drawing-pad functions and a text field on screen.  I'd like to create an action that will automatically re-order the layers so that the text field is accessible when typing but covered when writing by hand.  Then, I'd like the opposite to be available, so that the text field is accessible when typing, but the drawing pad is left alone.

    Have you tried using the selections in the Encore menu viewer that show you selected and activated states?

  • How to use the separate symbol in the text field in the adobe form.

    Hi,experts,
    I don’t know how to use the separate symbol to make a paragraph separate into several lines correctly in the text field in the adobe form.
    Action:
    1. config the ADS successfully.
    2. create the adobe form with a mult-line textfield(binding the 'remark' context in the interface of the form) using sfp.
    3. create a WDA for invoke the form and transfer the 'remark' context data.
    I use the following codes to display the paragraph in the PDF document:
    CONCATENATE
    '1&#12289;aaaaaaaaaaa&#65307;'
    '2&#12289;bbbbbbbbb '
    '3&#12289;ccccccccccc'
    '4&#12289;ddddddddd'
    INTO remark .
    lo_nd_z_hr_php_payslip->set_attribute(
    EXPORTING
    name = `REMARK`
    value = remark ).
    But I found all the content aren't paragraph separate correctly in the text field in the adobe form when I run the WDA.
    Could you please give me some hints to make the paragraph separate correctly in PDF document? Thanks a lot in advance!
    My email is : [email protected]
    Best regards,
    Tao
    Edited by: wang tao on Apr 8, 2008 1:58 AM

    Hi,
    If it is just a one word value then you could use this in the exist event;
    this.rawValue    
    = util.printx(">?<*",this.rawValue);
    This changes the first character (represented by the ?) to uppercase (represented by the >) and all trailing characters (represented by the *) to lowercase (represented by the <).
    If you wanted something more general ... if they could also enter a middle name then you could call a function like;
    function        toTitleCase(textValue)
      return  textValue.toLowerCase().replace(/\b[a-z]/g, function replacer(match) { return match.toUpperCase(); });
    This uses a regex to change all lowercase letters following a word boundary to uppercase.
    Bruce

  • How do I use Javascript to populate a text field based on a selection from a drop down box?

    Greetings,
    I have virtually no experience with JavaScript and I am trying to figure out how to add some basic automation features to an Adobe form.  I have a drop down box called "Hospital_Name" that will contain approximately 7 possible selections.  When the user makes a selection, I would like to have the text field (called "Hospital_Address") below the drop down box populate with the corresponding address for the selection.  I have the "Hospital_Address" text field configured for multiple lines and would like the address to have a line break between the street address and the city/state/zip.
    For example, if the user selected "Hospital 1", the text field would display:
    123 Main St
    Anytown, CA 12345
    Any help or examples you can provide would be greatly appreciated.

    You have the element names within the object within brackets.
    Make sure your brackets are properly placed and matched.
    // Place all pre-population data into a single data structure
    var Location = {
    "--Hospital--":{ line1: " ", line2: " " },
    "Bellevue Medical Center":{ line1: "2500 BMC Drive", line2: "Bellevue, NE 68123" },
    "CHI Bergan Mercy":{ line1: "7500 Mercy Road", line2: "Omaha, NE 68124" }, 
    "CHI Immanuel":{ line1: "6901 N. 72nd Street", line2: "Omaha, NE 68122" }, 
    "CHI Lakeside":{ line1: "16901 Lakeside Hills Court", line2: "Omaha, NE 68130" }, 
    "CHI Midlands":{ line1: "11111 S. 84th Street", line2: "Papillion, NE 68046" },
    "Creighton University Medical Center":{ line1: "601 N. 30th Street", line2: "Omaha, NE 68131" },
    "Nebraska Medical Center":{ line1: "4400 Emile Drive", line2: "Omaha, NE 68105" }
    // some debugging code to see location names;
    console.show();console.clear():
    for(I in Location) {
    console.println(I);
    // end debugging code;
    function SetFieldValues(Hospital_Name) {
        this.getField("AddLine1").value = Location[Hospital_Name].line1;
        this.getField("AddLine2").value = Location[Hospital_Name].line2;
    This is not a beginners task but requires a fair amount of knowledge about the structure of objects, defining strings, and structure of arrays.
    Are you sure you have all the field names correctly spelled and capitalized?
    Do you get any error in the JavaScript console?
    Just trying the line that defines the "Location", I get the following error:
    SyntaxError: invalid property id
    1:Console:Exec
    undefined
    All the form field in a PDF are processed by using JavaScript and any error in any script will stop JavaScript processing.
    It might help to have a link to the problem form.
    Make sure your brackets are properly placed and matched.
    // Place all pre-population data into a single data structure
    var Location = {
    "--Hospital--":{ line1: " ", line2: " " },
    "Bellevue Medical Center":{ line1: "2500 BMC Drive", line2: "Bellevue, NE 68123" },
    "CHI Bergan Mercy":{ line1: "7500 Mercy Road", line2: "Omaha, NE 68124" }, 
    "CHI Immanuel":{ line1: "6901 N. 72nd Street", line2: "Omaha, NE 68122" }, 
    "CHI Lakeside":{ line1: "16901 Lakeside Hills Court", line2: "Omaha, NE 68130" }, 
    "CHI Midlands":{ line1: "11111 S. 84th Street", line2: "Papillion, NE 68046" },
    "Creighton University Medical Center":{ line1: "601 N. 30th Street", line2: "Omaha, NE 68131" },
    "Nebraska Medical Center":{ line1: "4400 Emile Drive", line2: "Omaha, NE 68105" }
    function SetFieldValues(Hospital_Name) {
        this.getField("AddLine1").value = Location[Hospital_Name].line1;
        this.getField("AddLine2").value = Location[Hospital_Name].line2;

  • Text field properties-Using the 'required' option in the text field properties.

    Using the required' option in the text field properties.
    The 'help' manual describes the 'required' function as this: Required Forces the user to fill in the selected form field. If the user attempts to submit the form while a required field is blank, an error message appears and the empty required form field is highlighted.
    My users ARE not submitting the form, they open the pdf, fill it out and print it. HOW can I, make a field "required', I don't want them to skip/leave blank specific fields. However, if I choose the box 'required' in the text field properties, and I begin filling out the form, I can just tab past that field that I've choose as 'required', and I do not get
    prompt/error message or anything, it allows me to save, or print.
    I WANT SOME TYPE OF message (similar to enter a company order form
    off the web, where you can't continue without filling out 'required' fields).
    Is there a step/option I am not doing?

    Then you are going to have to write some JavaScirpt to be executed by the "Will Print" document action to check all the requried fields, either by name or by the 'required' property and handle the issue of the imcomplete fields. You will not be able to stop the print, but you could display and error field so the user knows the form is incomplete and the printed form also conatains this information.

  • Sum the values of a text field in a tabular form using JavaScript

    Hi Folks.
    OK, I put my hands up. I don't know Java script but I'm picking up the basics and I WANT to learn.
    Here's my situation.
    I have a tabular form which has lots of Standard Report Columns and ONE text field.
    I want to sum the values entered in the text field, real time, using Java Script without the need to have a round trip to the database.
    I'm guessing this will involve some kind of loop. Once I have that SUM figure I will store it in a hidden item and it will be used for validation when the user submits the form.
    If anyone can give me a simple Java Script to do this, or point me in the direction of one, I'd be very grateful.
    Many thanks.
    Dogfighter.

    Hi Arie.
    Thanks for the link.
    That's a great start,
    What I've got working so far is the following...
    <script type="text/javascript">
    function f_calculate_delta(p_this,p_rownum)
    var amt = $x(p_this).value;
    alert (amt);
    var display_item_to_set = 'f08_'+ p_rownum
    $x(display_item_to_set).innerHTML = amt
    </script>
    This is working fine.
    Where I'm stuck at the moment is how I can 'get' the value of another cell in the same row. They have all been set up using the APEX_ITEM API with their own unique IDs.
    I will continue looking but if you could give me a steer, that would be great.
    Many thanks
    Simon
    PS. APEX 3.1
    PPS. Trying to get the value of another row using...
    var display_item_to_get = 'f04_'+ p_rownum
    var expected_amt = $x(display_item_to_get).value
    PPPS. Also tried...
    var display_item_to_get = 'f04_'+ p_rownum
    var expected_amt = $v(display_item_to_get)
    and
    var display_item_to_get = 'f04_'+ p_rownum
    var expected_amt = $v(display_item_to_get).value
    None of which are working at the moment.
    Message was edited by:
    Dogfighter

Maybe you are looking for

  • How do I resolve the App Store using another apple id within my family

    First time post - please forgive any errors. I've upgraded to an iPhone 6 from a 4S. I used iTunes on my home computer to perform the backup and restore. It worked great. I can purchase new apps and the correct apple id is shown. The problem is when

  • Express document "Update was terminated"  on saving vendor payment F-48

    TCODE F-48. When we are going to pay full payment to party it works fine Problem: When we do partiall payment for example  100 kg material  Price  $100 first time: we purchase 50kg of $50 and create GRN After this when we decide to pay the remaing pa

  • Pasting text from email

    I just update to the recent version of Dreamweaver--version 8. I think the previous version I had was 7. The way text is pasted is entirely different in this version and I can't seem to retain line breaks. Pasting it as is creates one long unbreakabl

  • Report server Load balancing

    short description of the setup: 2 hosts running report services say reportsvc_1, reportsvc_2 in the sanme subnet. reports are called using run_report_object from within oracle forms. Is there any mechanism that these two hosts can share the load, loa

  • HP Pavillion G7 series laptop Windows 7 Home premium 64 bit

    I have an HP  Pavillion G7 series laptop, On trying to install latest version of Skype, Skype downloads but won't install. Error message "internal error has occured"  code 1603.  My local comp engineer investigated and determined that the Sonix integ