Spaces in the inputText field

Hi,
Iam not sure of how best I can explain the problem I experience on my JSF pages.
When i try to select a value from the drop down list..it is populating other fields on the page perfectly.
One of the fields is Zipcode which has a validator on it
Zip Code:
<h:inputText id="text5" maxlength="5" size="5" immediate="true"
    value="#{processApplication.ownerZipcode}">
<f:validator validatorId="zipcodeValidator"/></h:inputText>
<font color="#FF0000"><h:message for="text5" /></font> When i make any changes and hit save button on the page...(Most of the times) I get a red color msg beside the zipcode field "Zipcode not valid" eventhough that field is blank.
But, the cursor on that field is in the middle of the field which makes zipcodeValidator trigger becoz it cannot take any spaces.
when i place the cursor to the front of the field and hit save...everythiing is fine.
Why does the zipcode inputText field adds those spaces all by itself?
Any clue?
Any help is really really appreciated.

Thanks BalusC!!
Let me be more clear with this issue.
I have four inputText fields with required = "#{param['form1:button3'] == 'Issue License'}"When I click on a link...
These 4 text fields get the data(if any) from the database.
Now, when I click on the "Issue License" command button , I should check if these 4 fields are not null.
If any one of them is null, then I get the message "required field is missing" and I fill that field accordingly.
Now, the problem is....
When I click on a link...I noticed that the first field added few spaces by itself since the cursor is in the middle of the inputText box. Other 3 fields are normal and blank too i.e., all 4 fields did'nt get any data from DB.
When I click "Issue License" command button, I get "required field is missing" msg, only for 3 inputText fields but not for the first one since the first one has already few spaces in it and the required attribute thinks it has some value in it.
Now, how should I handle this situation?
Do you think
creating a converter for java.lang.String which converts empty/spacy strings to null would solve the problem?
This happens in few other pages too.
Please suggest me the solution.
Thanks

Similar Messages

  • How to transfer trailing spaces in the source field type c

    Hello,
    I have to splitt a string key of 120 characters into two InfoObjects (CHAR). The problem is, that the trailing spaces are lost in the character Field.
    Has anybody an idea to avoid the lost?
    Thank you.
    Conversion Table for Source Field Type c
    The characters in the source field are inserted in the target field, left-aligned. Trailing spaces in the source field are not transferred. If the target field is longer than the number of characters transferred, it is filled with blank characters to the right. If the target field is shorter, the number is truncated from the right.

    Hi ,
    Create two Characteristic InfoObjects in BW With length 60 Char  and then in the Transfer Rules of this two InfoObjects write the Formula using Left() and right() function present in the Formula Builder .
    That is First infoObject Contains the Left 60 Char and next one Contains the right 60 Char.
    Regards,
    Vijay.

  • Why do I get spaces between the printed fields? (Oracle 10G)

    Hi!
    I use Oracle 10G and I have a program that doesn't work the way it does on previous versions of Oracle. Or maybe it's a wrong options?!?
    Well i need to print the fields from a table with no spaces between them. Instead I get spaces between the fields. As if the dimension of the printed field is three times the real dimension of the field (even if I use SUBST, RTRIM, LPAD).
    For example I have
    SELECT '1', '2' FROM dual;
    I get "1 2 " instead of "12"
    The program is something like this:
    SET SCAN ON
    SET SPACE 0
    SET PAGESIZE 0
    SET PAUSE OFF
    SET FEEDBACK OFF
    SET HEADING OFF
    SET EMBEDDED ON
    SET VERIFY OFF
    SET TERMOUT OFF
    SET LINESIZE 4750
    spool &&4
    Select campo1, campo2 from tabella;
    Oh! It's not possible to concatenate the fields. campo1 || campo1. I get error, I presume, because of the dimension of the line (4750).
    Thanks,
    Miky

    SET COLSEP doesn't work! SPACE 0 should do the same, but doesn't work either When you complains that solution doesn't work, you should provide us the output you got. Because as I showed, and as shoblovk show it worked fine on our side.
    Anyway, what's the version of your Oracle client (SQL*Plus), OS... ?
    Nicolas.
    PS : and use tags as well &#091;pre&#093;paste your code here&#091;/pre&#093;
    Message was edited by:
    N. Gasparotto

  • How to keep the focus on the inputtext field.

    Hi,
    I'm using jdev 11.1.2.0
    I have two inputtext fields.
    when i tabout from firstinputtextfield , i'm calling a javascript to set focus on to the second textinput field.
    this is working fine.
    Second textfield has one server listner onblur event.
    When i add value change listener on the firstinputext field, after tabout from the first field , focus is going to set to next field and calling the serverlistener of the second field.
    how to make the not to call the serverlistner function of the second field when i tabout from the first field?(serverlistener is called only when i tabout from the second field on onblur event)(Thi is happening in ie8)
    Any suggestion would be appreciated.
    Thank you.

    If you have a value change listener it will send up ajax call when you tab out which may be have a bad interaction with your client listener. Instead of using a client listener you could try adding the javascript call to response from the value change listener. In your value change listener add a call to the javascript method that sets the focus
    public void addScriptToResponse(String script){
    ExtendedRenderKitService erkService = Service.getService(getFacesContext().getRenderKit(), ExtendedRenderKitService.class);
    erkService.addScript(getFacesContext(),script);
    }

  • Dynamic inputText fields values.

    Dear all,
    Please suggest solution on following:
    In my ADF/Trinidad project I have one view which is build dynamically by <tr:iteratior/> tag depending on amount of binding elements. Purpose of the page is to read parameter names from database and ask user to provide values for those parameters. Sample code:
    <tr:iterator var="items" first="0" value="#{bindings.parameters.collectionModel}" varStatus="status" id="ip">
         <tr:inputText Label="#{items.bindings.label.inputValue}" binding="#{backing_parameters.it}" id="it"/>
    </iterator>Once user resubmits page I need create pairs of parameter/value in backing bean and use it further in business logic. My challenge is to how actually obtain these values, provided by user if amount of fields (inputText) is only determined during runtime?
    Sorry if solution is too obvious. Please guide me to the correct way.

    I think I succeeded to resolve it:
    Solution:
    1. Create ValueChangeEvent on backing bean and map it to the inputText field
    2. Add <f:attribute/> tag to map inputText field to desirable value
    3. Handle event in backing bean and obtain new values and mapping to the field from ValueChangeEvent object.
    The only issue is if user does not change value of the field, then no event created and backing bean still does not know on existence of inputText field and its value
    <tr:iterator var="items" first="0" value="#{bindings.parameters.collectionModel}" varStatus="status" id="ip" >
         <tr:inputText valueChangeListener="#{backing_parameters.event}" label="#{items.bindings.label.inputValue}" binding="#{backing_parameters.it}" id="it">
              <f:attribute name="paramName" value="#{items.bindings.name.inputValue}"/>
         </inputText>
    </iterator>
    public void event(ValueChangeEvent actionEvent) {
        actionEvent.getComponent().getAttributes().get("paramName");
        actionEvent.getNewValue();
    }Thank you.

  • How to add a SPACE as suffix to the last field in the downloaded text file?

    Hi Experts,
    By using GUI_DOWNLOAD am saving the data(only 3 fields) in a text file on my desk top.
    fine.
    example current record1 : 010001                      354.999            26.000
    here, after 3rd field 26.000, immediately the cursor is jumping to next line in text file.
    but, wanna a SINGLE SPACE after 26.000, say 26.000+space.
    tried with CONCATENATE, OFFSETTING, but no use(may b am using incorrectly)
    so, pls. suggect me, How to add a SPACE as suffix to the last field in the downloaded text file?
    thanq

    Sorry...Typo error...Too many in the last few days -:(
    Wanted to say AFTER -:)
    Do it like this...
    FIELD1 TYPE XXX,
    FIELD2 TYPE XXX,
    FIELD3 TYPE XXX,
    SPACE(1) TYPE C,
    That way you should end with...
    26.000+SPACE
    Greetings,
    Blag.

  • Blank spaces at the end of an IDoc text field get lost when posted to R/3

    Hi Guys,
    I am facing the following issue:
    In an XML file-to-Idoc scenario, there are spaces at the end of a text field in the inbound XML file, which I can see when I open the inbound file with a text editor like notepad, and they are kept after XI mapping is executed (I can see them in message mapping simulator). However, it seems that these spaces get lost once the IDoc is posted to SAP R/3 and they are not visible on SAP R/3 side.
    Do you have any idea ? Thanks.
    Best Regards,
    Evaggelos Gkatzios

    That means SAP is removing the spaces from IDoc fields, where you spaces are not allowed. Does it create any problem?
    Thanks,
    Nabendu.

  • How to set white spaces between the fields in dataset??

    Hi all,
    I am writing a set on information to from infotypes to a text file. Its a fixed width file. How do set white spaces in the fields for dataset?
    Example:
    TYPES: begin of header,
                    filler(40)  type c,
                    id(3)        type c,
                    filler2(7) type  c,
                    delimiter  type  c,
                 end of header.
    DATA header type header.
    header-filler1 = ' '.
    header-id       = '100'.
    header-filler2 = ' '.
    header-delimiter = cl_abap_char_utilities=>newline.   ( do it to get a new line)
    my_table = header.
    append my_table.
    DATA: out_file(256) type C,
          codepage_ref type ref to CX_SY_CONVERSION_CODEPAGE,
          out_char type c,
          size type i,
          insert_string type string,
          insert_size type i.
      out_file = filename.
      open dataset out_file for output in text mode ENCODING NON-UNICODE.
      LOOP AT my_table.
        size = strlen( my_table ).
        insert_string = ''.
        DO size TIMES.
          offset = sy-index - 1.
          try.
              out_char = my_table+offset(1).
              IF out_char = SPACE.
                CONCATENATE insert_string '' INTO insert_string SEPARATED BY SPACE.
              ELSE.
                CONCATENATE insert_string out_char INTO insert_string.
                transfer insert_string to out_file NO END OF LINE .
                insert_string = ''.
              ENDIF.
            catch CX_SY_CONVERSION_CODEPAGE.
              insert_size = strlen( insert_string ) - 1.
              insert_string = insert_string(insert_size).
          endtry.
        ENDDO.
       transfer CL_ABAP_CHAR_UTILITIES=>NEWLINE TO out_file NO END OF LINE.
      ENDLOOP.
      close dataset out_file.
    How do I get to insert the space for filler1 and filler2?
    Edited by: Siong Chao on Oct 4, 2011 4:56 AM
    Edited by: Siong Chao on Oct 4, 2011 8:27 AM
    Edited by: Siong Chao on Oct 4, 2011 8:29 AM

    problem lies in the open dataset codes
    Used:
    open dataset out_file for output in text mode encoding non-unicode message msg.
    if sy-subrc= 0.
    loop at my_table.
    transfer my_table to out_file
    transfer cl_abap_char_utilities=>newline to out_file no end of line.
    endloop.

  • How to fix problem of bypassing the submit button validation by pressing the space bar in the required fields. this occurrs in the internet explorer and chrome browser, but in foxfire.

    How to fix problem of bypassing the submit button validation by pressing the space bar in the required fields. This occurs in the internet explorer and chrome browse but not in foxfire

    How to fix problem of bypassing the submit button validation by pressing the space bar in the required fields. This occurs in the internet explorer and chrome browse but not in foxfire

  • How to show exact value in ALV output field (including space at the start)

    Hi,
    This is my Scenerio:
    In the output the field value (char type) shows "6-10-3", the actual field value has a space before the 6 " 6-10-3".
    How to incorporate this, any suggestions?
    Thanks in advance,
    Dileep.

    Hi Dileep,
    While filling the internal table of that field, conactinate with the space and fill.
    like
    concatenate space
               wa-fileld " your fild
               into wa-filed.
    appned wa to itab
    clear wa.
    hope it works.
    Regards!

  • Defaulting the mandatory field to space in a flex field - Urgent...

    Hi ,
    I have a flex field which is used to render address based on the country selected ( Country is an LOV..)
    The flex field details are.
    Appl Short Name: AR
    Name: Remit Address HZ
    Type: descriptive
    Address Line 1 is mandatory in the flex field configuration.
    My requirement is to default the Address Line 1 with space which I am doing by setting the vo.setAddressLine1(" ")
    once the VO is initialized and in the screen Address Line 1 is getting defaulted to space.
    But if the user removes the space in it and tabs out, even then I have to default the Address Line 1 with space.
    (i.e. if Address Line 1 is null then I have to default it to space)
    But as it is a flex field it does not have any Action Type. How can I default it if the user makes the field null..
    I tried in the VORowImpl to set the value to space if it is null but it is not working...
    public String getAddress1() {
    String value = (String) getAttributeInternal(ADDRESS1);
    if ( value == null || "".equals(value ) )
    return " ";
    return (String) getAttributeInternal(ADDRESS1);
    When the user makes this field as null and clicks on Apply button, the form validation appears saying the field
    is mandatory.( I cannot set the Disable Client Side validation to True for the Apply Button..)
    Is there a way
    1. To set the value of the VO attribute to space if it is made null
    or
    To set the VO attribute to a space before the form validation error appears?

    Hi Friends,
    I got the answer. The following link gives the details.
    http://www.oraclearea51.com/oracle-technical-articles/oa-framework-articles/184-set-dff-segment-required-in-oaf.html

  • Remove the trailing spaces of a quantity field in smartform

    Hi,
    I am printing a quantity field in a smartform as follows:
    &G_S_DATA-SAL(C)&.
    It is compressing the leading spaces but there is a space between the field and full stop.
    Eg: if G_S_DATA-SAL = 144.00   the ouptut is displayed as 144.00 . (space between the amount and full stop).
    How can I remove this space?
    Regards,
    Soumya.

    Hi
    Use this.
    &G_S_DATA-SAL(CS)&.

  • Want to include spaces in the Results in the Text field.

    Hi All,
    Please help with the possible ways.
    I want to ge the output of a test filed in the results as such.
    I need to get a <Space> then the names.
    for e.g. I want <Space><Space> and then the test field in my answers report.
    Currently when I give ' ' and concat it with the column name it doesnt provide two spaces at the begining.
    Any other ways to do it.
    regards,
    Bhavik

    Hi Bhavik,
    try this, go to column properties -> Dataformat -> Change treat text as drop down -> plain text (don't break spaces).
    this will allow spaces.
    Thanks,
    Vino

  • How  can i check the space in the field.

    hi:
    how  can i check the space in the field.!
    for example:
    data: string(30) type c value 'sent ence'.
    search  string for space.
    if sy-subrc = 0.
    write: 'i am right'.
    endif.
    but the result is that it cann't check the space.
    so how can check the space in the field!!
    thank you very much!

    Hi,
    data: v_string(30) type c value 'sent ence'.
    DATA : v_cnt TYPE I,
                v_num TYPE I  VALUE 1,
                v_num1 TYPE I.
    v_cnt =  strlrn( v_string ).
    DO v_cnt TIMES.
      IF v_string+v_num1(v_num)  EQ SPACE.
        write: 'i am right'.    
    ELSE.
       write: 'i am WRONG'.
      ENDIF.
      v_num1  =  v_num1 + 1. 
    ENDDO.

  • How to Validate the Text Field in JSF

    Hi,
    I am facing a issue to validate the text field where the below code accepts (space' ',underscore'_',pipe'|') symbol as a first character and last character.Where by it can accept in the middle.
    It should not accept special characters also. Below code is working properly for special characters.
    <tr>
    <td width="30%" align="right"><b><h:outputText id="aAccrualType" value="Accrual Type" /> </b> <span style="color:red">*</span></td>
    <td width="50%">: <h:inputText id="accrualType" value="#{accrualTypeMast.accrualType}" required="true" >          
    <t:validateRegExpr pattern="^[(a-z)||(A-Z)||(0-9)||(_)||(\s)||(/)]+$" />     
    <f:validateLength minimum="1" maximum="50"/>     
    </h:inputText>
    <h:message for="accrualType" showDetail="true" style="color:red" />
    </td>
    </tr>
    The thing is i dont have much knowledge in regular expression.
    Is there any other way to do this.
    Could anyone help me in this.
    Thanks,
    Ambika&#9786;

    This has nothing to do with JSF.
    I suggest you to read the Pattern API documentation [1]. You can easily create a small Java Application and test the regexp using String#matches() as it uses the same regexp guidelines.
    public static void main(String[] args) {
        String regexp = "^[a-z]+$";
        String value = "foo";
        boolean match = value.matches(regexp);
        System.out.println(value + " matches " + regexp + ": " + match);
    }[1] http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html

Maybe you are looking for

  • Mac Help transferring Bridge to pse9

    I am a Mac user.  Just purchased photoshop elements and adobe premier  elements 9.  I have been using photoshop elements 6 and all photo albums were housed in bridge,which doesn't seem to working so well for me.  There is no bridge update in 9.  Wher

  • RSBBS Jump Query -- Assignment Details

    Hi , I went RSBBS Jump Query --> Assignment Details --> InfoObject is Company Code so I (select type "Variable") --> Field Name I tried both Info Object Name("0comp_code")and Variable of Infoobject "0comp_code" is "ZS_CC" Manual entry variable for ch

  • Problems in running opera mini in nokia 6233

    my nokia web browser is running properly.but when i try to connect to internet through opera mini 3.1,there appears error in establishing the internet connection. so pls help me out as quickly as possible

  • Xdo Lobs Api

    EBS 12.1.1 We have a number of templates installed in a variety of language setting From XDO_LOBS en     00 en     GB en     US We have implented as custom install tool which uses XDOloader to load this templates we made an assumption that the langua

  • How to Scale to Fit automatically?

    Hi, I'd like Safari to Scale to Fit automatically every time I open or go to another web page so that I don't have to click the "+" button. Is there a way to do this? Thanks Leonardo Macbook 2.16GHz 2GB   Mac OS X (10.4.10)   MB062LL/A