If condtion  not working  in blank text field

I want that when the text field is blank it should go to the else if portion of the code below:
JTextField tf1=new JTextField(15);
if (tf1.getText() != null)
JOptionPane.showMessageDialog(tf1, "insert value in the range of a-z,A-Z,0-9");
}                          else if (tf1.getText() == null)
                         System.out.println("fdsafasdfasdfsdf");
System.out.println("1234");
                                                  JOptionPane.showMessageDialog(tf1,"Enter SmartTextID");
but control never goes to ==null,even i have initilaized textField with a text then also when i chk with tf1.getText() == "assigned text", its not working.
plz send me the correct code for this
thanx..

if ( textField.getText().trim().equals("") );

Similar Messages

  • ALV Filter : Not working for a text field - Strange problem

    Dear All,
    I have a Z-program where the ALV filter is not working on a particular text field.
    The output on that text field is as below :
    ABCD
    JKLM
    YYZZ
    ABCD
    JKLM
    ABCD
    JKLM
    YYZZ
    YYZZ
    When we try to filter on YYZZ, it gives blank list. But for other options given abobe it works fine.
    I know it is because of the negative sign , but how can we over come this problem ?
    Thanks in advance,
    Sandip.

    Hi Sandip,
    Use 'LOWERCASE' in the fieldcatalog.
    For the particular text field when you are appending the Fieldcatalog structure to the Fieldcatalog Table
    ( Suppose LS_FIELDCAT)
    Then check the LOWERCASE field.
    (LS_FIELDCAT-LOWERCASE = 'X' )
    This will serve the purpose.
    Regards,
    Sourav

  • Is it possible to NOT have the white text field on the bottom of the mini b

    Is it possible to NOT have the white text field on the bottom of the mini book? I'm trying what I can, and have searched the web including the third-party sites and can't find anything. Would rather design my own thing for it and have the image bleed to the bottom.

    Richard,
    You are a gentleman, AND a scholar! Thanks! Just really want to do something different, though I was almost ready to shoot something against white just to make it work. Much appreciated.

  • Auto populate blank text fields with n.a from a button or on print out.

    This seems straight forward but I cannot find an existing questions on this topic.
    I would like to add a form function that will fill any blank text fields with n.a. I do not want to use the default field value as I think it will cause confusion and cannot be applied for text fields formatted for dates. Is it possible to run a script that can do this? It would be OK if the action was triggered from a button or print activity after the rest of the form has been completed.
    Any thoughts would be appreciated.
    Thanks

    The question is whether your form is used only for filling out on screen (and not as a level 0 form, being printed out and filled out manually).
    If so, why not make the default value of the concerned fields to be "n/a" (or whatever you want to name them). That would relieve you from any validating before printing.
    Otherwise, you could maintain a list of field names which should get the n/a value if empty. This list would be an array.
    Your code in the willPrint event (if you want to have it reliably) would then look like this:
    for (var i = 0 ; i < nafieldarray.length ; i++) {
    if (this.getField(nafieldarray[i]).value == this.getField(nafieldarray[i]).defaultValue) {
    this.getField(nafieldarray[i].value = "n/a") ;
    HTH.
    Max Wyss.

  • Search criteria is not working in Responsible Group field in sap crm could you please help me this how to achieve.

    search criteria is not working in Responsible Group field in sap crm could you please help me this how to achieve.I have writen code on EH_ONSEARCH .as per below...what changess i need to do..and through partner function and adding the selection params please send the sample .
    code. partner funtction - ZRG DATA :
    DATA : lv_partner_fct type .
    types: begin of ty_resp,
           partner    type but000-partner,
           name_last  type but000-name_last,
           name_first type but000-name_first,
           mc_name1   type but000-mc_name1,
           mc_name2   type but000-mc_name2,
           end of ty_resp.
    DATA: lv_resp_bp type STANDARD TABLE OF ty_resp INITIAL SIZE 0,
           lw_resp_bp type ty_resp.
    IF lv_attr_name = 'Rgroup'.
    lr_entity->get_property_as_value( EXPORTING iv_attr_name = if_crm_srqm_uiu_const=>gc_attr_low
                                       IMPORTING ev_result = lv_low ).
    IF lv_low IS INITIAL.
    SELECT partner
           name_last
           name_first
           mc_name1
          mc_name2
    FROM but000 INTO table lv_resp_bp
    WHERE mc_name2 = lv_low and bu_group = '0010'.
    loop at lv_resp_bp into lw_resp_bp.
        lv_low = lw_resp_bp-mc_name2.
      lr_query_service2->add_selection_param( iv_attr_name = 'Rgroup'
                                                iv_sign = lv_sign
                                                iv_option = lv_option
                                                iv_low = lv_low
                                                iv_high = lv_high ).
      ENDLOOP.
    if lv_partner_fct = 'ZRG'.
      lr_entity = lr_iterator->get_next( ).
    CONTINUE.
    ENDIF.
    lv_attr_name = 'BU_PARTNER'.
    ENDIF.

    <b>You can acheive   this .... first by creating the search help exit    ... by  creating the maintaince  view   then   using it in the   Creation of the search help </b> ...
    see the link for attaching the view   to the serach help .
    <a href="http://">http://www.sapdevelopment.co.uk/dictionary/shelp/shelp_elementary.htm</a>
    reward  points if it is usefull...
    Girish

  • MN04 not working for free text PO

    Hi All,
    I have maintained a condition record through MN04 in purchase organisation, company code and vendor combination. This condition record is working fine for regular purchase orders. But it is not working for free text PO's. Could you please guide me why is it so?
    I am maintaining same purchase organisation, company code and vendor combination for free text PO also. Question is why it is working for a purchase order with material inside it and why it is not working for purchase order with out material.
    Thank you all in advance

    Hi,
       Seems you are using a custom print program and form. I would suggest to change the program to SAPFM06P, form routine as "ENTRY_NEU" and the form as "MEDRUCK" in NACE transaction for the output type and check the scenario again. Also cross check the settings with the KBA: 1829682 - Output type is not determined in Purchase order
       If its getting triggered, then check the custom program and the form with the help of technical team.
    Regards,
    AKPT

  • APEX 4.0 - AJAX not working with Popup LOV field

    Hello,
    In the application I have built I have three fields which are 'feeded' by selects via a AJAX construction.
    All three fields are based on three others, which are PopUp LOV fields. Up to version 3.2 I had no problems: the fields were 'refreshed' as expected when in the 'parent' field a specific value was entered or choosen by the Popup Lov selector.
    But since the migration to APEX-4 (lin a test-system) all the three fields are not correctly refreshed anymore: two of them give the value 'undefined', the third, which is a select-list shows values, but at the moment I try to click on the select-list down arrow to pick a value, the list is emptied and stays that way.
    More specific about the third field:
    item 1 is a popup-lov defined item in which a user can type a value, but can also choose a value from a popup-lov. Item 2 is based on item-1: it does a select based on the value of item-1 and refreshes a select-list. Item-2 is defined as a select list.
    I got it all working when making item-1 also a select list, but since the list can become very large, I made a Popup lov of it. Most users do know what code they have to enter and in case somebody is not sure, the lov can be used.
    In this forum I came across a problem with AJAX callback, which was answered by Patrick Wolf, saying that in an htmldb_Get ( ... ,0) the last 0 should be replaced by $v('pFlowStepId'), but this did not fix my problem. I have the feeling that the problem is somewhre else, since on first hand, after entering a value in item-1 I see item-2 refreshed with the correct values, but the moment I try to select one item, the list is emptied.....
    I hope I made it clear what my problem is and that somebody can help me, else APEX-3.2 was the latest version for this application....
    Thanks in advance and best regards,
    Jan.
    Edited by: user13110728 on 9-aug-2010 8:44

    Hi Jan,
    the problem is the
    onBlur="javascript:f_P21_select_kostenposten(this,'P21_KOSTENPOST');"on P21_GBREKNR. This is getting attached to the HTML input text field but as well the the anchor link which opens the popup. So when you leave the text field the cursor will be put onto the icon to open the Popup LOV. When you press tab another time or leave the anchor link by clicking somewhere the above JavaScript function is fired again. But the problem is that "this" this time points to the anchor and not the text item anymore, so it will return an invalid value when you access this.value in your f_P21_select_kostenposten function which results in an empty result of your on-demand call.
    I still have to investigate why the above JavaScript code is now added to the anchor link as well. But as a workaround, just change your code to
    onChange="javascript:f_P21_select_kostenposten(this,'P21_KOSTENPOST');"which is better anyway, because it's just firing when the value really got changed. And because the anchor link can't really be changed, the event will never fire when you leave the anchor. BTW you can use the Application Search feature to search for all your onBlur events. onChange is much better than onBlur because it doesn't fire that often unintended.
    But if you want to use some of the new APEX 4.0 features, you could use the cascading LOV feature of APEX 4 and avoid all this JavaScript and on-demand code which you have written.
    I have changed your application to take use of it.
    1) I changed the LOV query for P21_KOSTENPOST from
    select '('||replace(lpad(gbreknr, 3, chr(1)),chr(1),' ')||') '|| omschrijving d, kostenpost r
    from   kostenposten
    where  vervallen is null
      and  bedrijf = :P21_BEDRIJF
    order by gbreknr, kostenpostto
    select '('||replace(lpad(gbreknr, 3, chr(1)),chr(1),' ')||') '|| omschrijving d, kostenpost r
    from   kostenposten
    where  vervallen is null
      and  bedrijf = :P21_BEDRIJF
      and  (:P21_GBREKNR is null or gbreknr = :P21_GBREKNR)
    order by gbreknr, kostenpostas it was in your on-demand process. The query will return all values if P21_GBREKNR is null but will restrict it if the field is filled out.
    2) Set "Cascading LOV Parent Item(s)" to P21_BEDRIJF,P21_GBREKNR Because based on your LOV query I assume "Kostenpost" should be refreshed if one of the two fields gets changed.
    3) Set "Optimize Refresh" to No because one of your parent items (P21_GBREKNR) can contain a null value.
    4) Removed the onBlur/onChange from P21_GBREKNR
    5) Removed the *%null%* from the "Null Return Value" attribute of P21_BEDRIJF, because that will cause a ORA-1722 if someone picks "-- kies: --"
    That's it.
    Have a look at dynamic actions and the "Set Value" action as well, because I think that could remove your other on-demand calls as well without having to write any JavaScript code.
    I will still investigate what's going on with the anchor link in APEX 4.0
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins

  • Word Mail Merge does not accurately import a Text field in Excel with more than 15 numbers

    Hi, I've looked through some of the discussions regarding importing numbers from excel into word mail merge. I'm having a problem. In Excel I have a column that includes numbers with more than 15 digits. In Excel, I have made this column a text format, so
    now in Excel those long numbers show up correctly. However, when doing a mail merge in Word, again the numbers past 14 digits change to zeros. I've read many help articles about this but am still not finding a solution. I even tried going the DDE route and
    that didn't do it either. I checked out this answer: http://www.techsupportforum.com/forums/f57/mail-merge-data-corruption-429351.html which was the most helpful, but again, DDE seemed to work for this person but not for me. I hope someone can offer a solution.
    I was hoping that I could do a picture switch, but that does not seem to be an option for this particular problem. I don't know why importing it in DDE format did not solve the problem. Thanks for any help!

    Wow! After all my searching and just after posting this I figured out the solution! I originally had { MERGEFIELD Field_Name \# # } But then I just removed everything after the field name, as is normal for any other text field, so not indicating it was
    a number, and now it shows up correctly even if the number (from a Text formatted field in Excel) is longer than 15 digits. Hope this helps anyone else who has a problem. I did not use DDE to solve this problem.

  • Font not embedded in static text fields...

    I think the title says it all. I'm building website and I've come half way now just to notice that my clients cant see my font that supposed to be there. What I've learned so far is that in static text fields, flash should embed it itself since I can't reference to it + embedFonts property not working, how can I fix this problem? Anyone had anything similar? What are common mistakes? I'm pretty new at all of this...
    Thanks

    thx for answers...
    Font Name                 Bytes        Characters   
    Klavika-Regular                4555     ,-./0123789:@BCKNPVZabdefghijklmnoprstuvy
    NeoTech                        6738     ,.ACDEFIKLMNOPRSTUVZabcdefghijlmnopqrstuv
    there they are...
    FLASH CS4
    font: NeoTech
    url: http://www.centar-bundek.hr/test/

  • Sorting not working correctly for date field in alv report

    Hi All,
    My report displays many rows also containing date type fields of bldat,budat .
    When I sort the report selecting field of type bldat budat the sorting is not correct for the year.
    Ex:
    Invoice doc dat
    01-25-2011
    01-21-2011
    02-02-2011
    10-25-2010
    11-20-2010
    If I use ascending then it is sorted as :
    Invoice doc dat
    01-21-2011
    01-25-2011
    02-02-2011
    10-20-2010
    10-25-2010
    Why the sorting is not working correct for year.(2010 records should have been first).
    The field wa_tab-bldat is of type char10.
    It is populated as wa_tab-bldat = bsak-bldat.
    Kindly suggest what can be done.

    The field wa_tab-bldat is of type char10
    Then what it does is correct.
    Refer to type datum...it will work

  • The payment request do not transfer the Item Text field to FI doc

    The payment request do not transfer the Item Text (SGTXT) field to FI documents (accounting document) when they are paid by F111 and the payment request is created from repetitive codes (Trx FRFT_B). Therefore is not able to display a text description in the FI line items accounts, even the payment request document number is not available in the accounting document.
    Even the program SAPLKKBL (F8BT) does not contain available the Accounting document.
    So, there is not easy trace.
    Does anybody know how can I match this?

    This is the SAP Response:
    Dear customer,
    The standard FRFT_B transaction does not directly or indirectly pass
    the text to the F111 payment document since the initial program design.
    In other words, you will not able to experience the reported issue
    in the system with standard SAP coding.
    However, the text value can be passed via business transaction event
    (BTE) for example or other modifications as a substitution.
    I hope this confirmation of the standard system behaviour is
    useful to you.
    I regret not to be able to give you a positive answer.

  • Cursor not focusing in the text field after Object tag load in IE

    Hi,
    We have an applets class "ABC.class" in our application. To include this class in a jsp page we are using OBJECT tag. This tag is written inside a if block in the jsp page. Based on the if condition this OBJECT tag has to be loaded. Below is the code we are using:
    <%
    if(testCondition)
    %>
    <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" NAME="applet" width="0" height="0">
    <PARAM NAME="CODE" VALUE="ABC.class" >
    <input type="hidden" id='myText' value="Please configure the jinitiator version to Oracle applicaitons Jinitiator version." >
    No JDK 1.3 support for APPLET!!
    </OBJECT>
    <%
    %>
    In the above code if the "if condition" is satisfying, then cursor is not focusing on the required field. The code to focus on the field is written in the javascript function which is called onLoading the page.
    we are using IE 7 and IE8. In IE 7 sometimes working fine but in IE 8 we are getting this issue.
    Can anyone please help us how to focus the cursor on the required field even in the case of the Object tag loading.
    Thanks,
    Eswari

    Hi Nicky,
    Thanks for your reply.
    We are not using JQuery.
    Actually the code to focus is written in the function which is called onLoad of the page that will be executed after the page loading. If we keep alerts in the onLoad function then the cursor is focusing to the required field.
    Thanks,
    Eshwari

  • Button onclick not working in the calculated field

    Hi Everyone,
    I have to add the button in the calculated field through list definition. On click of button it should call the java script function. I can add the button but on click event is not working.
    this is my code:
    <Field Name="Accept" ID="{1F7328C7-D7F0-4B94-BB15-01859CD28CF2}" DisplayName="AcceptorDecline" Type="Calculated" ResultType="Number" ReadOnly="TRUE" JSLink="/_layouts/15/CCAR.SP.Common.Lists/UserRecertification/UserRecertificationScripts.js">
            <Formula>
              ="&lt;div id='divAccept'&gt; &lt;input type='button' name='btnAccept' id='btnAccept' value='Approve'
    onclick=""UpdateAcceptorDecline('"&amp;[URID]&amp;"','Approve')""/&gt;
              &lt;/div&gt;"
            </Formula>
            <FieldRefs>
              <FieldRef Name="URID" />
            </FieldRefs>
          </Field>
    Please help me on this issue. Thanks in advance.

    Hi,
    According to your description, my understanding is that you want to add button in a calculated field to call custom JavaScript function.
    I suggest you can use concatenate formula function to achieve it.
    You can add button use concatenate function like below:
    =CONCATENATE("<input type='button' name='btnAddToBasket' id='btnAddToBasket' value='Add to basket' onclick=","addToBasket('",[Document Name],"','",[Original],"')"," />")
    More information:
    How can I get a button in SharePoint to display info about a record?
    CONCATENATE function
    Thanks
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Using IF's with a blank text field

    Is there a way of making this IF carry out its function if txtExchange is blank? Sorry if this seems a really simple question but am still trying to get my head around java. Thanks
    if(Integer.parseInt(txtExchange.getText()) <= 0.00)
    txtOutput.setText(Double.toString( x * y ));
    else
    txtOutput.setText(Double.toString( x * z ));

    Basically what am trying to is that when the text field txtExchange is blank then another default value is used (y).
    if(optDollarToEuro == optDollarToEuro) {
    double x;
    double y;
    double z;
    x = Integer.parseInt(txtInput.getText());
    y = 0.748279;
    z = Integer.parseInt(txtExchange.getText());
    if((txtExchange.getText()) <=0)
    txtOutput.setText(Double.toString( x * y ));
    else
    txtOutput.setText('?' + Double.toString( x * z ));
    }

  • My DW CC latest version does not show me the text field option when trying to make a form!!! P

    So when I youtube the same version as mine it still show to other users the text field option but on my insert panel under forms it does not give me the option
    PLEASE HELP

    Hi Taatueeyy,
    As this sound weird issue, I'll suggest you to clear preferences and then try launching.
    How to clean preferences, please check the below link
    http://forums.adobe.com/thread/494811
    If this doesn't resolve your problem. please reveret.

Maybe you are looking for

  • When I copy text, where does it go and how can I retrieve it?

    New to apple. When I copy text, where does it go and how can I retrieve it?

  • Printer hooked up to Airport

    I've had this problem ever since I loaded Leopard, but not sure it's related. I have a Canon MP800 printer hooked up to Airport and never have had a problem, but all of a sudden, I can't print to the printer unless I unhook it from the base station a

  • I deleted my Itunes on accident.

      I have OS 10.5.8 on my Imac and cant download the new itunes because it needs 10.6.8 or better.  PLEASE HELP IM LOST WITHOUT MY TUNES

  • Integration Methods - Oracle Projects with Primavera using API

    Hi, We are trying to do manual integration in between Oracle Projects with Primavera using API, if some one can able to help us on the process and procedure that would be really helpful.... Thanks Rgds, Vijay [email protected]

  • Changing IPS from promiscous mode to Inline mode

    Hi Experts, We are changing our IPS (aip-ssm10) mode of operation from promiscous to Inline mode. Is there any caveats or anything i need to take into consideration before doing the switch? Is there a possibility to roll back incase something doesn't