How to determine if a control on a form has the value NULL

I have a form with some fields that are not necessary. Once the user completes the form and click on send, I write back form fields values to a .db file. Problem, I'm running into is that, if a form textinput field is left empty, my insert statement fails because he says "hand Thread (Suspended: TypeError: Error #1009: cannot access a property or method of an object. null reference)" for the value of the blank form field (in the example below, 'phone' is not necessary).

var sql:String =
"INSERT INTO investigation." + "
"(firstName,» +)"
'lastName ', +.
"email" +.
"phone" +.
'bio ' +.
") " +
'VALUES ' +.
"('" + firstnameValid.text+",)" "" "
' + lastnameValid.text +' "," '.
' + emailValid.text +' "," '.
' + phone.text +' "," '.
+ bio.text + "')";

I tried:

var phone_input:String;
If (phone.data == "")
{phone_input = ' ' ;}}
on the other
{phone_input = phone.text ;}

But get the same error on the if (phone.data == "") line.

Any suggestions? Thank you!


I'm a little confused, then, I think. The error seems to imply that there is no 'phone' and so try to call the 'data' or 'text' on it throws the error you see. The only other suggestion I could make (without seeing the code) would be to try something more vague, such as:

[code]
var phone_input:String;
If (! phone) {}
phone_input = "";
} else {}
phone_input = phone.text;
}
[/ code]

Or, if you prefer a little shorter code, something like the following should work:

[code]
var phone_input:String = (! phone)? "": phone.text;
[/ code]

Or, if you're the kind of person who likes using the try/catch blocks, why not do something like this for a spin:

[code]
var phone_input:String;
try {}
phone_input = phone.text;
} catch (err: TypeError) {}
phone_input = "";
}
[/ code]

Hope that helps,

Peter

Tags: Flex

Similar Questions

  • How to create a custom control for a button where the look apply to everyone else but not the Boolean text?

    Hi all

    I would like to create a button custom as a master, so that if I change the look of the master all other buttons are changed.

    I did it with a custom control, such as a 'type strict def' otherwise the look will change , BUT if I do this as a strict type def I can't change the Boolean text more which should be different on each button.

    How to create a master control of a button where the look apply to everyone else but not the Boolean text?

    Steve Chandler wrote:

    I don't think that you can do. I just looked and as I suspected the Boolean property text is read only for strict typedefs, you cannot use the nodes property to change the text.

    As a just solution make it a typedef. When you want to change the open look the typedef and strict rendering, make your changes, then make no strict again. You will need to update the text Boolean yet once for all instances. Kind of pain. This is perhaps something for the exchange of ideas.

    Alternatively, remove Boolean text and replace with legend

  • How do you multiline text in a continuous form between the lines without scaling of the text?

    Help. How do you multiline text in a continuous form between the lines without scaling of the text?

    I tried to put each line of the form for amounts of specificity so that it ends at some point and does not change the text size to fit on the line but different key characters have different widths, so you do not get a length of the same line.

    I tried to remove the long text scrolling, but it changed nothing.

    I can create a text box great to fill out and have this scrolling of additional lines, but then I get too much information from people and I would need to clarify the lines behind the answer multi line text, or delete the lines...

    Is there a better solution?

    I usually just remove the lines and set the field "Does not scroll long text" so that all the text is visible. Including the lines is really only useful if the form may be printed and completed by hand, in which case you can use scripts as in this example is: http://acroscript.net/pdf/demos/multiLine_Demo1.pdf

    It works as expected in Acrobat/Reader, but not in Chrome and other PDF viewers who have little or no support for JavaScript. It uses scripts customized to validate on Focus and blur.

  • How to check if there is data in form of the signatory

    I use the v2 API and have a problem with the last update.

    We have an an optional field on one of our documents. When we built our integration, we ask the form data, and if the field was not filled, we would get an error. Now, we get form data downloaded even if the user has not filled what whatsoever. I know that now is the expected behavior and see the value. However, it leaves us with a problem.

    How can I have a query, using the api v2, there is data from form provided by the user or not? Web echosign as GUI seems to have access to this information because it will put a flag on the agreement, but I can't find how to do it in the api.

    Thank you

    Darren

    I worked with the support of Echosign on it and there seems to be no direct api solution. My concern in creating my own solution was successfully manage all our current and future agreements with all the fields they have and being as safe as possible future changes in the behavior of EchoSign. That's what I came with:

    Every day, I call getFormData for an old agreement without data form called. I save the headers in the first row of the csv file. When we have a new agreement in the next 24 hours, I call getFormData for him and then compare the new csv headers to the known empty headers. If they match, I guess that's empty, if they do not match I guess that the signer filled in some fields. It will be immune to future changes EchoSign to the fields returned by getFormData (with a window of 1 day of possible error). This solution is based on the current behavior of getFormData only the fields with the data returned.

  • How to create table selectable line or not based on the value of the line

    Hello.

    JDeveloper 11.1.1.2

    Is it possible to make a selectable table row or not based on a value in the line.

    That is to say. lets say that the row contains a Boolean LOCKED = TRUE.
    This line should not be selectable.

    A line whose value LOCKED = FALSE should be selectable.

    / Erik

    Erik,

    No particular reason to disable a selection of lines for a particular line? If I'm an end user, I would be clicking on the same line of thought again and again my mouse does not ;) (call me dumb :)). How do you differentiate this line (using inlineStyle / styleClass) based on the value of line? In addition, you can disable the other buttons when a row with a particular value is selected (so that the user knows that the selected line is not treatable).

    Arun-

  • How to view multiple records to a report form - as the model?

    Hi all
    I developed a form - like model report
    I want to show him several records at once (on the same page)
    I tried assigning a value of "Maximum records per page" property for the extensible framework 10
    but when I close the range property and open it again the value returns to 1!
    How to display multiple records on the same page?

    Thank you

    Hello

    check around your formatting images if all have the "vertical stretch" value to the variable or develop.

  • How can I fix monitor control center catalyst which has stopped working?

    This program has stopped working & therefore a Driver Detective

    Hi foxy1948

     

    1. did you of recent changes on the computer?
    2. for how long have you been faced with this problem?
    3. what happens when you try to use programs? Do you get any error messages?
    4. have you tried to reinstall the programs?

    The catalyst control center monitor and driver detective programs are non-Microsoft programs. So, you can even try communicating with the support of the manufacturer for assistance in case the problem is only with these programs in particular.

     

    I hope this helps.

  • How to determine what security policy to be used in the HTTPClient.java?

    Hi team,

    I tried invoke Fusion Web Service, not always successful, got a few entries and still ongoing.

    The first question is to know how to identify the security poicy should be used in the resulting WSDL webService HTTPClient?

    Ex :
    
          //setup security feature with OWSM policy
          SecurityPolicyFeature[] securityFeature =        new SecurityPolicyFeature[] { new  SecurityPolicyFeature("oracle/wss_username_token_client_policy") };
    

    In the WSDL XML, how to identify, what strategy to use when calling webService

    < ExactlyOne >
    < wsp >

    Plese provide your inputs.

    Reg

    Sridhar

    What is the error that you are experiencing? Security policy is in the WSDL file and documentation for GOSA provides details on the assertion. Generally, I think that you would use "oracle/wss_username_token_over_ssl_client_policy", which is the easiest to use. Also usually the easiest way to set up a call must first make the call using SOAP UI for you ensure that your envelope is correct and then to implement in any client that you need. For more details on how to make a SOAP UI call refer to this blog post.

    --

    Jani Rautiainen

    Relationship with the developers of Applications in fusion

    https://blogs.Oracle.com/fadevrel/

  • How to determine if a data type is used in the comic book?

    Background:
    I am currently planning to install GoldenGate proof of Concept and have questions about the data types supported by the capture mode (pg 1-5, 1-6 in the installation guide). Is not in itself a matter of GoldenGate.

    Our source and target databases are 11.2.0.2
    The GG server will be 11.2.0.3
    I'm new to the environment and want to confirm that we needn't upgrade the source and target the DBs to 11.2.0.3 in order to use the integrated capture mode. This forces me to know if 3 specific types of data are used in the comics. The problem is, Oracle docs aren't clear to me, when they refer to 3 specific data types.

    Here's the question:

    Does anyone know how I can confirm that the following 3 data types are used in the DB by querying the dictionary: "XML stored in binary form',"XML stored as object-relational","abstract data Type "?

    If I select the types of data separate from dba_tab_columns, I see no data enumerated type that indicates, for example, that an XML string is stored as a ' binary '.

    For me, when Oracle made reference to a "stored as binary XML" on page 1-6 on the installation guide, I guess that makes Oracle refers to a BLOB that contains an XML reference, but I can't be sure.

    Someone has an idea that they could share? I just want to confirm that we do not have to upgrade our source and target DBs at 11.2.0.3 by searching in the database is possible to confirm that the above 3 data types are not used by the application.

    Thanks in advance for any help.
    Tony G

    You should find XML columns stored in binary form or CLOB using the DBA_XML_TAB_COLS view referenced in http://docs.oracle.com/cd/E11882_01/appdev.112/e23094/xdb01int.htm#g644983.

    You should find XML tables using storage relational object in the view DBA_OBJECT_TABLES with:

    select
    owner,
    table_name,
    table_type
    from
    dba_object_tables
    where
    table_type='XMLTYPE';
    

    To abstract data type, you can query DBA_TAB_COLUMNS using ADT as literal for DATA_TYPE column:

    SQL> select * from v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE    11.2.0.2.0      Production
    TNS for 32-bit Windows: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    
    SQL> drop table t purge;
    
    Table dropped.
    
    SQL> drop type adt;
    
    Type dropped.
    
    SQL> --
    SQL> create type adt is object
      2  (
      3   c1 number,
      4   c2 varchar2(30)
      5  ) final
      6  /
    
    Type created.
    
    SQL> show errors
    No errors.
    SQL> create table t
      2  (
      3  c adt
      4  )
      5  /
    
    Table created.
    
    SQL> show errors
    No errors.
    SQL> --
    SQL> column table_name format a10
    SQL> column column_name format a10
    SQL> column data_type format a10
    SQL> select
      2  table_name,
      3  column_name,
      4  data_type
      5  from user_tab_columns
      6  where
      7  table_name='T';
    
    TABLE_NAME COLUMN_NAM DATA_TYPE
    ---------- ---------- ----------
    T          C          ADT
    

    Edited by: P. Forstmann on 8 Apr. 2013 20:28

    Edited by: P. Forstmann on 8 Apr. 2013 21:05

  • How to create a table with a column that is the value in another table?

    Hi all,

    It's my first post n I changed my ODI of DATASTAGE platform. Help me friends n I know basic steps in 11 ODI version which I was training in my company. I hope to have your support and can do everything an action ODI related documents.

    My question is...

    Table T1 > > > > > > > > > >

    service id / / / attr.name / / / attr.value

    S1 / / / product_code / / / P1

    S1 / / / provider / / / pro1

    S2 / / / product_code / / / P2

    S3 / / / provider / / / pro3

    Table T2 > > > > > > > > > > > > > > >

    ID / / / product_code / / / provider

    S1 / / / p1 / / / pro1

    S2 / / / p2 / / / nullvalue

    S3 / / / nullvalue / / / pro3


    I have a table T1 since I should show the table T2 is released. Can we say everything on how to write a logic and steps to follow.

    Thanks in advance.

    Published by: 854662 on April 26, 2011 01:59

    Hello

    U go.

    1 the interface:

    "Put a filter in your 1 on attr.name = array ' PRODUCT_CODE.

    In the map target TABLE2
    SERVICE_ID = TABLE1. SERVICE_ID
    PRODUCT_CODE = TABLE1. ATTR_VALUE

    Use SQL IKM append control

    Interface 2:

    "Put a filter in your 1 on attr.name = array ' PROVIDER '.

    In the map target TABLE2
    SERVICE_ID = TABLE1. SERVICE_ID
    PROVIDER = TABLE1. ATTR_VALUE

    Do SERVICE_ID as KEY (when you click the column target in properties, you can see KEY under properties of the target column) and use the incremental update of the IKM Oracle.

    PS: I assume that Oracle as the source and target.

    And you can refer to the documentation,

    https://Apex.Oracle.com/pls/Apex/f?p=44785:24:4413167952886630:no:24:P24_CONTENT_ID, P24_PREV_PAGE:5185, 29

    http://odiexperts.com/

    And of course this OTN.

    Thank you
    Guru

  • my keyboard has the value false, how can I change in the UK please

    I @ sign on shift 2 and pound sign No.

    The game on March 1, 2012 14:54:58 + 0000, griswalds wrote:

    I @ sign on shift 2 and pound sign No.

    You are ready with a U.S. software keyboard, which does not correspond to your
    UK physical keyboard. To change to the software keyboard UK, go to
    Control Panel | Region and language. Click the keyboards and languages
    tab, and then change keyboards. Choose the UK keyboard.

    Ken Blake, Microsoft MVP

  • How can I include link shared drive to form in the submission email?

    I'm an Assistant in an office where we will use Adobe forms to start the beginning of a project. My bosses are to save their form in a corresponding folder, then 'send' the form warns me I continue with the launch of the project.

    My question is: how far, in the body of the email, include a link to where the Adobe form is saved on our shared drive so that I can click on the link and go directly to it, rather than use the attachment is? This, I hope, will prevent the form being registered in two different places.

    Hi CSchoolinLife,

    Yes, you can include a custom content in the body of the email.

    Please save the form on https://workspaces.acrobat.com/?d=0n * uLjnmLGX8VlHRCW5n7A and check different options, you can use a button (for programming and GUI) email.

    Kind regards

    Rous

  • How to choose the value null

    Hi all

    I use oracle 9i.
    I have a Book table and there column: book_id, book_name, book_rating etc.
    Books are rated on a scale of 1 to 10, and the database is associated with a book.
    There are books that are not yet rated and these recordings has a null value in this column to book_rating.

    I want to write a cursor that can browse this book_rating.
    I started with a loop for iteration of 1.10 (because I in 1.10 loop)
    and in this loop, I declare my cursor and where clause wrote:

    where book_rating = i;

    This condition will take care of the sides with a value of 1 to 10, but this custom work for null values.

    How can I write this code so that I can understand the books that are not rated so far (null in the column book_rating)?

    Thank you

    Will be something like this help

    FOR I IN 0..10
    LOOP
         SELECT ..
           FROM ..
          WHERE NVL(BOOK_RATE,0) = i;
    END LOOP;
    
  • How can I save a copy of a form with the ipad?

    I use a pdf form that was created with Acrobat DC on a PC I want to be a "master form.

    I have the mobile ipad acrobat form and send it to me. (Customer1)

    When I view the file, the information is correct.

    I then try to modify the form a second time record and send to myself. (Customer2)

    I discovered the second file and the information is correct, however when I discovered the first file the first information of file is overwritten by the second. I guess it's because that is the that I am editing the same file.

    Is there a way using mobile Acrobat on ipad for "save under" that would change the current file name so the master pdf is not replaced?

    Hi brennang90831446,

    That's right, that information will be overwritten that you work on the same file. There is no save option slot in the mobile application.  all changes automatically get saved in the existing file and the same results seen next time.

    Kind regards

    Nicos

  • How to fill in a programmatic manner, a form in the form designer field?

    Hello experts,

    I have the following problem: I want to fill in a field in the form designer with values that I get after creating a user in a target system. The value I want to use is the user id after the creation in the target system. I was able to get this user id, but the only problem is that I have to make the filling, the designer of the form field in a programmatic way.
    If anyone can give me a help, it would be much appreciated.
    If necessary please ask for more details.

    Best regards!

    Carol

    You should the name of the column as a variable adapter... Open your form of process... Copy the exact spelling of the name of the column at the top of case...
    It is the right way.

Maybe you are looking for

  • HP Pavilion dv6-6108 driver questions

    I have Windows 7 64 bit installed. These are the questions of driver, I have some: -Realtek PCIE card reader driver causes Windows to start in a black screen. I had to disable this device in order to get Windows to boot up again. -Card 'Network contr

  • Acer Aspire 5517 does not recognize the DVD in the drive

    I just bought this new laptop last night. The DVD player does not recognize any DVD or CD placed in the tray. All if the player starts but nothing appears on the monitor. I have the auto-play configured to recognize any software install cd/dvd.

  • WRT160N V2 disabled setting NAT, Internet does not work

    I went across and disable my NAT setting so that I could connect with friends on Xbox Live.  However, when I turn off the setting, my internet works, wireless and ethernet connected devices.  Need help trying to figure out how to solve this problem. 

  • How to scan a document from a from HP PSC 1401 all-in-one printer to my laptop?

    I have the USB cable connected to the portoles correct and when I push the button labelled scan it will not scan to my laptop

  • Commissioning does not end.

    Commissioning of failing to fill out on-screen main has been a problem for a long time market.  However, given that I've upgraded to SP2 (and maybe it's a coincidence), it became almost impossible to finish starting the process, hang up on the screen