How to restrict the user input textfield to an Integer?

Hello there;
Here is my problem, and i need your help.
I have a mssql 2005 server as my back end database;
I have designed a web application from which i can load a specific table in my database.
One of my table column is of integer type and i want to restrict the user to only entered an integer in the textfield.
I have try the integer converter from the "converters" section of the pallete. The result is that its actually restrict the user input to be an integer, but i can't load the database, obtaining a java.lang.Int error message.
Next i have tried using int theid=int.parseInt........ but i am receiving a syntax error of the type cannot find symbol parseInt.
I can't just work this out!
Could anybody help please.

As has been stated in previous replies you can check that the value in the TextField is parseable as an Integer by using Integer.parseInt(fieldVariable.getText()). However, you can also restrict what characters can be entered into the text field, like so:
Assume your field variable is textField1 then the KeyTyped event for the text field:
private void textField1KeyTyped(java.awt.event.KeyEvent evt) {
     if (evt.getKeyChar() < '0' || evt.getKeyChar() > '9') {
          evt.consume();
}will only allow the numeric characters (i.e., 0-9) to be typed into the field. Keep in mind that in this case the backspace, delete, home, arrow, etc, keys will not delete characters, move the cursor, etc, so if you want those you have to test for them as well.

Similar Messages

  • How to restrict the user to enter only numeric values in a input field

    How to restrict the user to enter only numeric values in a input field.
    For example,
    i have an input field in that i would like to enter
    only numeric values. no special characters,alphabets .
    reply ASAP

    Hi Venuthurupalli,
    As valery has said once you select the value to be of type integer,once you perform an action it will be validated and error message that non numeric characters are there will be shown. If you want to set additional constraints like max value, min value etc you can use simple types for it.
    On the project structure on left hand side under local dictionary ->datatypes->simple types create a simple type of type integer
    The attribute which you are binding to value property ;make its type as simple type which you made
    Hope this helps you
    Regards
    Rohit

  • How to restrict the user in MIRO for not modifying  price

    Hi All 
    My requirement is How to restrict the users in MIRO screen for not modifying Material Prices  of only the for specific  ROH types .
    For example :
    Valuation class             RM description
      3021                             RM - A
      3022                             RM - B
      3024                             RM - C
    when ever we procure  the above Raw materials A,B and C and
    the Quantity of each Raw material @ 10 units  and value @ 1 INR  for each unit
    RM - A procured qty 10 @1 total price is INR  10
    RM - B procured qty 10 @1 total  price is INR 10
    RM - C procured qty 10 @1 total  price is INR 10
    total price of PO is INR 30
    when we received invoice material prices are  assume it INR 1 is excess for each material.Now the invoice price for each RM has become INR 11.
    in MIRO we want restrict the user to change the price from INR 10 to 11.
    suggest the best possible ways to restrict in MIRO screen
    Thanks & Regards
    Mala

    Dear:   
                      Take help of ABABPER fo implement exit using INVOICE_UPDATE or MRMH0003 Logistics Invoice Verification: Revaluation/RAP exit. If this does not help then seek help of MM functional who will help you to find exit for the required task.
    rEGARDS

  • How to restrict the user from making any changes in Sales order- item level

    Hi to all
    How to restrict the users from making any changes in sales order at item level if the same sales order is released by senior user through status profile.
    Regards
    Anish Parikh
    Edited by: anish parikh on Jan 24, 2008 5:16 AM

    Hi Anish,
    This can be achieved through the roles and authorization.
    This can be done through the basis team. they can create user profiles and roles.
    For the roles they assign some transaction codes so that they can view the only assigned tr. codes.
    Like that ur requirement can be done.
    Also u can prevent the user to change any fields in the sales order screen (VA02). for that please modify the authorisations.
    Hope i answers.
    Reward points if useful.
    Edited by: kaleeswaran bhoopathy on Jan 24, 2008 9:57 AM

  • How to retrieve the user input in One Step Screenflow

    Hello all,
    I am new in KM. I would like to ask in One Step Screenflow, I have add a inputfield into the ConfirmComponent. How can I retrieve the user input?
    public IRenderingEvent execute(IScreenflowData sfd) throws WcmException
              inp.setLabel(new Label("Delegation:"));
              ConfirmComponent cc = new  ConfirmComponent(ConfirmComponent.OK_CANCEL,this.context.getLocale(),inp);
              String sRid = (String)this.values.get(0);
              RID rid = RID.getRID(sRid, null);
              OneStepScreenflow oscf = new OneStepScreenflow(sfd,this.getAlias(),rid,cc);
              return oscf.execute();
    In the IRenderingEvent , How to retrieve the user input?
    public IRenderingEvent execute(IResource res, Event event ) throws WcmException
              if (event instanceof ConfirmEvent)
                        ConfirmEvent cce = (ConfirmEvent)event;
                        if (ConfirmEvent.CHOICE_YES.equals(cce.getChoice()))
                                  return new InfoEvent(Status.OK, "Done !");
                        else if (ConfirmEvent.CHOICE_NO.equals(cce.getChoice()))
                                  return ConfirmComponent.onNo(event, res.getContext().getLocale());
                        else if (ConfirmEvent.CHOICE_CANCEL.equals(cce.getChoice()))
                                  return ConfirmComponent.onCancel(event, res.getContext().getLocale());
              return new InfoEvent(Status.ABORT, "Aborted.");
    Many Thanks,
    Sunny

    Hello yoga,
    Many Many thanks for your reply again.
    I have just try the class in the thread link.
    There is a error
    "The project was not built since its classpath is incomplete. Cannot find the class file for javax.servlet.http.HttpServletRequest. Fix the classpath then try rebuilding this project."
    The errors occurs because of "extends OneStepComponent"
    public final class NewConfirmInputComponent extends OneStepComponent
    Where can find javax.servlet.http.HttpServletRequest to include it in my classpath?
    Thanks
    Sunny

  • How to restrict the user from accessing other screens before submittingdata

    Hi All,
      I have some screens developed in Webdynpro ABAP and all these have been linked to Portal as pages. In Portal If i click on the link in detailed navigation i can see the corresponding screen on the right side. Now in one screen i have to input some data and submit the data, Now my problem is if i enter some data and before submitting the data if i click on any other link in the detailed navigation, that corresponding screen is opening and all the data of the previous screen is lost.
    Can any one suggest me, how can i restrict the user from accessing other screens before submitting the data of that screen from portal perspective.

    Hi Prasanna,
    The pages can be restricted from the user access by using the ACL permission or you can restrict the page by making invisible in navigation area which you do not want to show to the user . Open the page properties and select navigation category in the drop down and select the Invisible in navigation area property to yes.By default this property is No.Change the property for all pcd pages which want to hide from user access.
    Hope this helps you...
    Regards,
    Rudradev Devulapalli
    Reward the points if helpful....

  • How to restrict the user(Schema) from deleting the data from a table

    Hi All,
    I have scenario here.
    I want to know how to restrict a user(Schema) from deleting the values from a table created in the same schema.
    Below is the example.
    I have created a table employee in abc schema which has two values.
    EMPLOYEE
    ABC
    XYZ
    In the above scenario the abc user can only fire select query on the EMPLOYEE table.
    SELECT * FROM EMPLOYEE;
    He should not be able to use any other DML commands on that table.
    If he uses then Insufficient privileges error should be thrown.
    Can anyone please help me out on this.

    Hi,
    kumar0828 wrote:
    Hi Frank,
    Thanks for the reply.
    Can you please elaborate on how to add policies for a table for just firing a select DML statement on table.See the SQL Packages and Types manual first. It has examples. You can also search the web for examples. This is sometimes called "Virtual Private Database" or VPD.
    If you have problems, post a specific question here. Include CREATE TABLE and INSERT statements to create a table as it exists before the policies go into effect, the PL/SQL code to create the policies, and additonal DML statements that will be affected by the policies. Show what the table should contain after each of those DML statements.
    Always say which version of Oracle you're using. Confirm that you have Enterprise Edition.
    See the forum FAQ {message:id=9360002}
    The basic idea behind row-level security is that it generates a string that is automatically added to SELECT and/or DML statement WHERE clauses. For example, if user ABC is only allowed to query a table on Sunday, then you might write a function that returns the string
    USER  != 'ABC'
    OR      TO_CHAR (SYSDATE, 'DY', 'NLS_DATE_LANGUAGE=ENGLISH') = 'SUN'So whenever any user says
    SELECT  *
    FROM    table_x
    ;what actually runs is:
    SELECT  *
    FROM    table_x
    WHERE   USER  != 'ABC'
    OR      TO_CHAR (SYSDATE, 'DY', 'NLS_DATE_LANGUAGE=ENGLISH') = 'SUN'
    ;If you want to prevent any user from deleting rows, then the policy function can return just this string
    0 = 1Then, if somone says
    DELETE  employee
    ;what actually gets run is
    DELETE  employee
    WHERE   0 = 1
    ;No error will be raised, but no rows will be deleted.
    Once again, it would be simpler, more efficient, more robust and easier to maintain if you just created the table in a different schema, and not give DELETE privileges.
    Edited by: Frank Kulash on Nov 2, 2012 10:26 AM
    I just saw the previous response, which makes some additional good points (e.g., a user can always TRUNCATE his own tables). ALso, if user ABC applies a security policy to the table, then user ABC can also remove the policy, so if you really want to prevent user ABC from deleting rows, no matter how hard the user tries, then you need to create the policies in a different schema. If you're creating things in a different schema, then you might as well create the table in a different schema.

  • How to Restrict the users in oracle applications

    Hi,
    I want to Restrict the users in oracle applications without using database
    can any one please expalin me how to resttrict the users using middletier
    Thanks
    Gita

    HI srini ,
    my application version 12.0.4 and database is 10.2.0.4
    and i want to restrict the No of users
    exp i have have 500 users and i want restrict to 100 only
    how can i do that please explain
    Thanks,
    Sudheer

  • How to capture the User input value to user exist function module.

    Hi,
    How can i capture user input value.Here i am using User exist in BPS variable.
    Calculating days using user exist functin module and my input is another variable i.e user defined value.
    How can i capture user defined vaule into my function module.
    This is very urgent can you help me..
    Thanks....

    Hi!
    You can get the instance using the method get_instance of the class cl_sem_variable, and call the method get_value with the return. Check the example:
          CALL METHOD cl_sem_variable=>get_instance
            EXPORTING
              i_area       = (planning area)
              i_variable   = (variable name)
            RECEIVING
              rr_variable  = lr_var
            EXCEPTIONS
              not_existing = 1
              OTHERS       = 2.
          CHECK sy-subrc IS INITIAL.
          CALL METHOD lr_var->get_value
            RECEIVING
              rto_value = et_value
            EXCEPTIONS
              error     = 1.
    After this, read the first line of the table et_value (it should be the value that the user choose on the screen).
    seeya!
    Robson

  • How to get the User input of Dynamic Action confirmation message ?

    Hi Guys,
    I'm using apex 4.1,
    I have added a confirmation message box as page Dynamic Action. How can i get the user input of that confirmation pop up ?
    Thanks

    Hi,
    you don't directly get the user input. But you should still be able to get what you want. Let's assume you have a dynamic action which fires for a "Change" (or any other) event and which has two or more actions
    1) Confirm
    2) Execute PL/SQL Code
    If the user clicks Cancel/No in the confirm dialog, APEX will stop the execution of this dynamic action and not run "Execute PL/SQL Code".
    Hope that helps
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • How to restrict the user for re-submitting the same form

    Hi All,
    I would like to know, How to restrict a user for re-submitting the same page.
    I have a jsp page with submit button... and should not allow the user to save the same data again ..
    Anil

    Try the followings. If user disable cookies, this will not work. You need to modify to detect such situation!
    String processed = "mycooke";
    Cookie[] cookies = request.getCookies();
    Cookie c = null;
    if (cookies!=null) {
       for (int i=0; i < cookies.length; i++) {
           if (cookies.getName.equals(processed)) {
    c = cookies[i];
    break;
    if (c!=null) {
    // already processed.
    // send error message and exit.
    // set cookie;
    c = new Cookie(processed , "yourdata");
    c.setMaxAge(-1);
    response.addCookie(c);
    // process as it is the first;

  • How to generate the User-Input XML Body for executing workflows via REST APIs: The Solution

    I see that executing a workflow via REST APIs requires lot of work to be done just to prepare the right User-input XML body. Any mistake and you have some major debugging to do. Larger the number of User-Inputs, the bigger is the problem.Life is so much easier at the WFA GUI with Display names and tooltip help for User Inputs which are very easy for reading and providing the right values. I don't have any such privileges when manually preparing the User-Input XML body.It’s been asked numerous times how to provide User-Input values for type table, or Query (Multi-Select) etc. These are complex User-Input types and has lots of scope for user mistakes.I can have User-input dependency at WFA GUI which allows me to make the right selection, but while preparing my XML body I need to take care of it myself.An operator is allowed to execute workflows, but the same Display names which help him make the right user-inputs, makes it impossible for him to prepare the user-input body xml. Display names can't be used in in XML body and he can't know the exact parameter names by looking at the Display names. So he need to always contact the Admins/Architects for this. And Architects/Admins can't be expected to keep providing User-Input XML body to operators every operator. How about if I could enter all the User-Input values in my workflow execution at WFA GUI, I can do a preview which passed to my satisfaction and then I can magically get the XML body for it which I can use to execute my workflow from REST APIs from any client. It could be so very much easy for me than building my User-Input XML body manually. This is exactly what I'm going to give you right now. You open the WFA in browser, Go to your workflow, Start execution, you input values from GUI reading carefully the display names, preview it to your satisfaction and then get the XML body. Assume your workflow is called “Workflow to Print a given Message”. It’s a simple workflow with only 1 user-input Displayed as "Message to Print" Prerequisites:  The following are the one-time prerequisites. You need PowerShell 3.0 on your WFA server.Import the attached Generate_Workflow_User_Input_Body_in_XML.dar in your WFA. It’s our magical command called "Generate Workflow User Input Body in XML"Add credentials of a WFA Admin/Architect in you WFA itself with Name/IP: localhostMatch: ExactType: OtherName/IP: localhostUsername: <WFA Admin/Architect Username>Password: <User Password>   Steps: Suppose you have a workflow called "Workflow to Print a given Message". You want to execute it from REST apis and need to prepare the user input XML body.  Select this workflow and clone it. The workflow clone is the exact copy of your original workflow word by word, input-by-input. It will open in Edit mode with name "Workflow to Print a given Message - copy".Add the command "Generate Workflow User Input Body in XML" at the beginning of your workflow. This is a must. This command need to be the first command in your cloned workflow.This command requires no input. So for its Parameters just press okay and save the workflow.You are done.Now Execute the clone workflow. You'll see all the user-inputs available to you. Make your choices as you wish. Preview it to confirm that planning is passed and u have no errors.Execute it now.You'll see that the our magical command "Generate Workflow User Input Body in XML" has failed in our clone workflow execution. Don't worry, its fate was decided to be so. But it didn't fail before giving me what I really wanted. i.e. my XML body for my real workflow. It displayed it in the GUI as well as saved it in your WFA server @ C:\temp\<workflow_name_dd_MM_yyyy_hh_mm_ss_.xmlIt also deleted all the reservations of this particular failed job. So NO major residue left to be cleaned.To summarize: Clone Your workflow and Add the command "Generate Workflow User Input Body in XML" as your first command.    Start Execution, provide your User-inputs and preview it. Be satisfied and Press Okay.   Now Execute it.  After a few scconds this cloned workflow will fail with Error "All done. The Workflow will fail now."     See the command execution logs for this command. You'll see the User-Input XML body. It has also saved the XML file at C:\temp in your WFA server.   Have fun. sinhaa  

    Providing a new version 1.1.0 of the command "WFA Schedular" Changes made: Added conditional String Representation based on the Scheduling parameter provided. Provided check for the right number of parameters passed into the command.Added a new parameter "Expiry Date" to automatically stop the recurring execution upon expiry.Check for Posh3.0 version in code.Have Fun!! sinhaa Below example for:Schedule a workflow for recurring execution every alternate day i.e. once in 2 days at 10:30 PM starting 06-Jul-2015 (Today's date is 02-Jul-2015) . The recurring workflow execution  should expire on 31-Dec-2015 and stop.  

  • How to Restrict the users from changing the Default variant of report.

    Hello everybody,
    The requirement is to restrict the users to save and overwrite  the default layout variant (Layout for higher managenet)set for the report, but at the same time they should be able to change and save the other layouts for which they are having access.
    I have written the logic in the program which is working fine for all the scenario when we execute the report. But the logic doesnt work if the user is selecting the layout on the output screen of the report.
    for e.g if the user runs the report using the layout varaint for which he is having the authorization then he gets the all 4 options so he then he can select the layout for which he is not authorized and he can overwrite.
    i have debugged and check as i have found that after the report output is shown all the layout paramater is controllled by the statndard SAP objects.
    Can anyone help me out in this issue.
    Thankyou in advance.
    *to get the default layout variant.
      w_save = 'A'.
      if p_vari is initial.
        clear disvariant.
        disvariant-report = sy-repid.
        w_variant = disvariant.
        call function 'REUSE_ALV_VARIANT_DEFAULT_GET'
          exporting
            i_save     = w_save
          changing
            cs_variant = w_variant
          exceptions
            not_found  = 2.
        if sy-subrc = 0.
          p_vari = w_variant-variant.
        endif.
      endif.
    *logic to check user authorization to change the layout setting.
      if p_vari = c_layout.
        if not sy-uname is initial.
          select single * from agr_users
                  where agr_name = c_role
                  and   uname    = sy-uname.
          if sy-subrc = 0.
            w_save = 'A'.
          else.
            w_save = ' '.
          endif.
        endif.
      endif.
    Regards,
    Satish.

    Hi Maine,
    Thanks for your reply.
    As you mentioned for your own program, you can control the parameter "I_SAVE", when calling "REUSE_ALV_GRID_DISPLAY".
    so already i have use the same logic and control the parameter through I_SAVE and here i am calling method ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY instead of "REUSE_ALV_GRID_DISPLAY".
    and it works fine when we execute the report but the logic doesnt work when the user tries to change and save the layout variant on the output screen of the report.
    Regards,
    Satish

  • How to restrict the users not to change receiving batch no. in 305 mov.type

    Dear MM Guru,
    We are using mov.type 303 & 305 for transferring the materials from one plant to another plant. t.code is MB1B (Non split valued item)
    While receive the goods through 305 mov.type the user having the chance to change the receiving batch number. To control this changes, is there a way where we can restrict the users not to do the changes in receiving batch no. or can we do the GR with reference to the material document 303 mov.type.     
    Regards,
    Sivanandan

    Hi,
    Generally there is a possibility to change the batch no. If you want to restrict it means go for enhancement. Use BADI to acheive this.In  MB_MIGO_BADI you can set not to change the batch no. Hope it works. Thanking you.

  • How to restrict the user to change the project structure but not the documents?

    Hi,
    I have created one project assigning different users in Solution manger. I want to risitrict some of the users to change the project structure but simultaneously allwoing the project documents to be created, edited or deleted using solar01 under Project documentation tab. For that I have followed the steps provided in the follwoing link.
    http://wiki.scn.sap.com/wiki/display/SM/Howto+Restrict+Changes+to+Project+Nodes+to+Assigned+Team+Members
    I am able to restrict the users to change the project structure, but I am not able to allow access to the project documents. It gives me the message "You are not authorised to change the project". This fulfills my one of the requirements. But, Is there any way  to restrict the user to change the project structure but not the documents?. Any help will be apperitiated.
    Thanks,
    Rutvik Uapdhyay. 

    Hi Rutvik,
    Basically there are 2 different authorization role ...you should look for and customize as per requirement in Z* namespace.
    role  - SAP_SOLAR01_ALL
    this take care of objects in Solar01 like tab access etc
    role -SAP_SOL_KW_ALL
    this takes care of entire documentation within solman
    hope this helps
    Regards
    Prakhar

Maybe you are looking for

  • Resolve DataControl Name Programmatically

    Hi, In my application I have more than one Application Module, each containing its VOs & EOs. Is it possible to retrieve programmatically the name/s of the DataControl/s referenced in a pageDefinition (through the iterators or even the actions), if I

  • J2ee Start problem

    I am running win98 I have problem starting the j2ee server whenever i give the command c:\j2ee -verbose i get messages like - Syntax erro, out of environmental space, syntax error and likewise, i set my Paths in autoexec.bat as JAVA_HOME = C:\JDK1.3

  • Premier Pro CC 2014 Crashing on OSX 10.8.5

    Hey there, Im having the issue of Premier crashing constantly. I cant seem to figure out why. Is anyone else having this issue? Lach

  • Schedule Soft Reset/Reboot WRT350N v2

    Hi all, Every afternnon when I get home from work I need to reboot my router as it starts running really slow. The net connection, lan, access to the web page config etc all run extreamly slow. After a power cycle it all runs up normal again. I was a

  • Contributor UI error: NoSuchMethodError fatwire/ui/controller/controller

    Hi All, I performed a full installation of 11g today, with Oracle DB and WebLogic (all on Windows Server x64). All has seemed to go well, excepting that the new Contributor UI does not render - the new contributor area is blank. I've tried IE and Fir