How to allow only Number(0-9) in jsff ADF

Hello

InputText expected than numbers. I tried to implement using ClientListener and bottom of javascript but I am able to enter special characters! @# $% ^ & * ().

How to get there?

< af:inputText label = "" days after project actual start: ""

ID = "it10.

value = "#{ReviewDeadlineRuleEvents.daysAfterActProjectStart} '"

maximumLength = "#{bindings." DaysAfterActProjStart.hints.precision} ">"

< f: validateLongRange minimum = "0" / >

< af:convertNumber groupingUsed = "false".

model = ' #{bindings. " DaysAfterActProjStart.hints.format}"/ >

< af:clientListener method = "filterForNumbers".

Type = "keyDown" / >

< / af:inputText >

JavaScript:

< af:resource type = "javascript" >
function filterForNumbers (evt) {}
get the source of the event, ADF Faces, InputText.js
var inputField = evt.getSource ();

oldValue var = inputField.getValue ();

var ignoredControlKeys = new Array (AdfKeyStroke.BACKSPACE_KEY, AdfKeyStroke.DELETE_KEY);

set the range to exclude in the entry field
var minNumberKeyCode = 48;
var maxNumberKeyCode = 57;
var minNumberPadKeyCode = 96;
var maxNumberPadKeyCode = 105;
key pressed by the user
var keyCodePressed = evt.getKeyCode ();
If it is a control key, do not delete
var ignoreKey = false;

for {(keyPos to ignoredControlKeys)

If (keyCodePressed is {ignoredControlKeys [keyPos])}
ignoreKey = true;
break;
}

}

return if the key should be ignored
If (ignoreKey == true) {}
Returns true;
}
filter entry keyboard
If (keyCodePressed & lt; minNumberKeyCode: keyCodePressed & gt; maxNumberPadKeyCode) {}
value set by the previous value
inputField.setValue (oldValue);
no need for the event to be propagated to the server, so don't cancel
He
evt. Cancel();
Returns true;
}
If (keyCodePressed & gt; maxNumberKeyCode & amp; keyCodePressed & lt; minNumberPadKeyCode) {}
value set by the previous value
inputField.setValue (oldValue);
evt. Cancel();
Returns true;
}

}

< / af:resource >

Thanks in advance.

Always mention your jdev version.

In this input text example box allows you to enter all the characters with the error message but my requirement is that is should not allow anything to enter outside numbers.

You must use the javascript solution.

For example:

function filterForNumbers(event) {
    var ignoredKeys = new Array(AdfKeyStroke.BACKSPACE_KEY, AdfKeyStroke.DELETE_KEY);
    var keyCode = event.getKeyCode();

    if(ignoredKeys.indexOf(keyCode) > -1){
        return;
    }

    if(keyCode < 48 || keyCode > 57){
        event.cancel();
    }
}

You will probably have to trigger this function on keyPress and not on the keyDown event.

And if concern is security, and then you combine it with check(af:validateRegExp) on the server side.

Dario

Tags: Java

Similar Questions

  • How to allow only .gov Web sites on Windows XP using the installation of the broad-band

    How to allow websites .gov only on Windows XP. Use BSNL broadband. Made of internet sharing in LAN.

    Concerning

    Maton

    Hi Matt,

    This forum is for MSE who cannot restrict access of Web site you want.

    One of the possible methods that comes to mind uses the Parental http://www.windows-help-central.com/parental-controls-in-windows-xp.html may control with Windows Live Family Safety http://explore.live.com/windows-live-family-safety?os=other (according to the version of XP and whether or not you have a workgroup or domain LAN).  When you set up, allow *.gov, but reject all other types you can imagine (I don't think there is a way to allow only .gov, but you can exclude most if not all of the other busiest - check domain name registrars to get a list of options).  If you use a domain, way to go would be with a custom domain group policy to restrict access on all of the network (except perhaps the server or individuals of special category in Active Directory if you want).

    If that is not the case, and I think it might, please repost your question in the following forum to get the expert assistance you need: http://answers.microsoft.com/en-us/windows/forum/windows_xp-networking?page=1&tab=all.

    I hope this helps.

    Good luck!

  • How to allow only a WinXPPro laptop computer connection access in a field?

    I need to set up a number of books that I can maintain the regulated access. We only want books to be able to log on to a domain while being able to obtain reasons for AV, WSUS updates files, etc. of our "main" area So, how to restrict a user group, access to logon only in a field? Or how only have a domain listed to open a session to a group of computers?

    I also need to maintain a directory with spreadsheets to be read-only. How I keep them attached to the email, copied, etc.. ?

    I would use a policy of Trendmicro Officescan lockdown access readers optical and USB.

    We would work with Server 2003 Ent. and XP Pro w/SP3 and, of course, no matter who in the enterprise administrator group would still need full access.

    You should post these questions in the TechNet forum here in MS Answers instead. This forum is more for consumers/users.

    TechNet forums -http://social.technet.microsoft.com/Forums/en/categories/

    MS - MVP - Elephant Boy computers - don't panic!

  • Allow only specific APEX App via Oracle Http Server

    Hello

    I have some difficulty to fix my Oracle APEX + Oracle HTTP Server environment.

    There are currently about 20 Applications that run on the server of the APEX, and I want to publish 2 of them outdoors for the users.

    I added a certificate in Oracle Wallet Manager to ensure the OHS, but I can access all Applications on the server of the APEX by changing just the suffix of the ID of the Application.

    How can allow only two applications accessible via internet?

    Concerning

    Hello

    Well, need us so much more information.

    You can edit a zip file of all the relevant configuration file, or you could send them to me at [email protected].

    Then I take a look and we can post the result here.

    It should also be completely specified URL that you use since you seem so use the virtual hosting.

    See you soon,.
    Dietmar.

  • mx459 won't let me enter the WEP key number, allows only symbols and letters. How to enter numbers?

    mx459 won't let me enter the WEP key number, allows only symbols or letters. How to enter numbers?

    John

    This might help

    Press the SETUP button on the control panel of your printer.
    Using the arrows, select DEVICE SETTINGS, press OK.
    Select local network SETTINGS, then press OK.
    Select Configuration LAN wireless, and then press OK.
    If a message appears, press the WPS button, press STOP to cancel.
    Select STANDARD INSTALLATION in the next screen that appears, and then press OK.
    Select your access point or router, and then press OK.
    Press OK to confirm the access point name.
    Enter your password using the numeric keypad on the right.
    On the screen where you enter your password at the top right of the LCD screen, you should see a: 1. This indicates you are in digital input mode. If you press the asterisk (*) will be fixed: has or uppercase mode, pressing asterisk with tiny switch. To enter a letter in letter mode, you press the digital key to scroll through the available letters. For example: to enter a letter 'c', you press the '2' three times.
    Press OK when finished.
    The LCD will say "Connected", if the password is correct.

  • My version of Firefox is 7.0.1. My bank allows only version 3.6. How do I adapt so I can do my banking online?

    My version of Firefox is 7.0.1. My bank allows only version 3.6. How do I adapt so I can do my banking online? I use a Mac.

    You could install version 3.6 next to your current version. Just download the current language of http://www.mozilla.org/en-US/firefox/all-older.html and then in the Setup program, change the installation location. You can just change the last part of the installation location (where it says Mozilla Firefox) for Mozilla Firefox2

  • How can I allow only a specific list of employees to receive marketing emails, but exclude all others in the same company?

    We have an important customer who said they don't want their employees who receive emails from marketing except a specific list of their management team. Also, we do not want the employees of our customers who decide to opt-in to receive emails from our registration page if they use their work email address.

    How can I allow only a specific list of employees (management team) to receive marketing emails, but exclude all others in the same company?

    One way is to create a list of sharing, "company A does not include." Build a program in the program generator with a charger that looks for the domain "company A". Place a filter in the program on a decision rule with the emails to management teams; If they are in the filter (that is, they are on the management team), remove them program, if they are not (that is, they are not the management team), add them to the list of sharing "excludes company A. Then you can add the list of sharing "Company A excludes" as an exclusion on your segments or implement a model that they will automatically as an exclusion.

    They oppose all non management team emails? If they are, as an extra precaution, you could add the "exclude company A" to master exclusion list.

  • Writing javascript code to a box that when activated, it removes the read-only attribute in another area and allows a number against the default calculation that occur.

    I have an order entry form that calculates a sum of $ calculate markup by a formula in the section rating field simplified in the field on the tab properties.  The field of markup is set to read-only.  I also have a configuration like a checkbox.  If the user selects the check box, I need this field of markup to become editable (remove the read-only attribute) to allow a number to be entered in the field.  I guess I'd also need programmatically delete the calculation in the simplified field notation when the box has been activated.  I think I need a custom java script to trigger on mouse enter?  I could also use some help setting java script.  Someone has it all done something similar?

    Thanks in advance.

    You can no longer use the method of the "simple field notation" If you change the field in certain situations. The following script assumes that you just want to add two fields and use 25% of this amount as your markup, unless the box named "CheckBox" is checked, then the field will become editable and you can enter what you want:

    // get the state of the "CheckBox" - modify the field name to match your form
    var cb = this.getField("CheckBox");
    
    if (cb.value == "Off") {
        // Checkbox is unchecked, so perform the calculation and make sure the field is read-only
        event.target.readonly = true;
         // simple calculation - you need to modify this
        var result = (Number(this.getField("Field1").value) + Number(this.getField("Field2").value)) * 0.25;
        event.value = result;
    }
    else {
        // Checkbox is checked, so do not modify the value, set the field to read/write and let the user enter anything they want.
        event.target.readonly = false;
    }
    
  • How to allow connect to user only from specified ip addresses?

    Hello.
    How to allow connect to user only from specified ip addresses?
    For example,.
    User1 can connect only from 192.168.1.10
    User2 can only connect from 192.168.1.11
    and etc...
    Thank you.

    Web says:

    CREATE OR REPLACE TRIGGER "A1_AFTER_LOGON" AFTER LOGON ON DATABASE BEGIN
    IF UPPER(SYS_CONTEXT('USERENV','IP_ADDRESS')) <> '192.168.1.10' THEN
    
    HOW TO FORBID ACCESS ????
    
    END IF;
    END;
    ALTER TRIGGER "A1_AFTER_LOGON" ENABLE
    

    How to deny access?

    Check the blog post that I've provided above

    RAISE_APPLICATION_ERROR(-20000, 'You don't have permission to login!');
    
  • Responsibility to allow only for user password resets (for personal help from the front desk)

    Hi all

    Someone managed to create a responsibility to allow only the password resets? The idea is to assign this responsibility to our office staff help password reset requests. They will not have the opportunity to do anything outside of search for users, and then reset the password. This would allow a large number of the number of tickets to be processed directly by our help desk staff.

    Any information would be greatly appreciated.

    Hello

    Create a custom liability (similar to the system administrator), which only has the (security > user > set) screen.

    Why don't you use reset them password 'features' "that comes with the application? See (Note: 399766,1 - FAQ of the Reset password feature) and (Note: 763352.1 - how to set "password forgotten"to work without treatment in 11i?) For more details.

    Kind regards
    Hussein

  • Hi, how can I find number emei of stolen iPad that I erased remotely

    Hi, how can I find number EMEI of my stolen iPad that I erased remotely

    Conny, check down here. It's the only way.

    Find the serial number or IMEI on your iPhone, iPad or iPod touch - Apple Support

  • I got a phone call from a person claiming to be from the care team of the windows service how they got my number

    I got a phone call from a person claiming to be from the care team of the windows service how they got my number and I took his number, I think it's fake

    Hello

    There are telephone directories, etc., etc.

    It's a SCAM

    they want or money on your part for programs without value or make an identity theft on you to get even more money and get your internet banking passwords and credit card information, you get allows you to download the software to 'fix' or 'test' for your computer

    read this:

    http://www.Microsoft.com/security/online-privacy/msName.aspx

    Microsoft has none of the unsolicited telephone calls to help you fix your computer

    In this type of scam cybercriminals are calling you and claim to be of Support technique Microsoft. They offer help with your computer problems. Once scammers have earned your trust, they try to steal and damage your computer with malicious software, including viruses and spyware.

    Although the law enforcement can trace phone numbers, often authors use pay telephones, disposable cell phones or stolen cellular phone numbers. Better avoid fooling themselves rather than try to repair the damage afterwards.

    Treat all unsolicited sceptically telephone calls. Don't provide personal information.

    If you receive an unsolicited call from someone who claims to be from Technical Support Microsoft, hang up. We do not have such calls.

    If you think you might be a victim of fraud, you can report it. For more information, see: what to do if you think you have been scammed.

  • How to get serial number in Dell monitor?

    Hello

    How to get serial number in Dell Monitor (model No.: S2240Lc).

    I have only 20-digit S/n.

    Thank you

    Riou...

    As I said, you can't get a service tag. By the article.

    Monitors without a number of service purchased from resellers (Amazon, Best Buy, Buy.com, cost Co, Wal-Mart, Sams, other boutique online, etc.)
    * Based on the start date of date code monitor 20-digit serial number, Dell PPID you monitor for 3 years warranty
    You need to contact Support for your country. Tell them to open the Dell internal only Oracle knowledge Information center
    * In the search space, they should enter PNP13081, and then click search. This opens the article =
    Replacement for Dell monitor and procedure - Dell international policy policy

    The customer is unable to provide a Dell order number or serial number system because the customer bought the monitor from a retailer. The only information that the client has are the PPID number for the monitor. For monitors when there is not an available Dell order number, agents will use the date code embedded in the PPID monitor serial number to determine the beginning of the start of coverage.

    Discussion = the warranty is 3 years from the date of early series PPID embarked on the label.
    Solution = Set up screen replacement against the fake tag.
    * You would provide the following representative data if you need a replacement monitor in this 3-year period:
    Brick or shop online:
    Monitor model:
    Monitor 20 digits alphanumeric serial number PPID:
    [Your]
    E-mail address:
    Name:
    Shipping address:
    Phone number:
    Operating system:
    Video card:
    Video card ports tested:
    Question:
    Performed troubleshooting:
    Monitor the done Factory Reset
    Watch chess self-test Diagnostics and integrated
    * Post more troubleshooting

  • Unable to create the new folder, allows only new Briefcase

    my request to create a new folder allows only a Briefcase.  I want to create a standard folder.

    How to remove and restore the default context Menu items 'New' in Windows 7 and Windows 8
    http://www.SevenForums.com/tutorials/28677-new-context-menu-remove-restore-default-menu-items.html
     
     

    Tip: When you save the text in Notepad, the default file format is .txt. Replace all files.
     
     
  • Allow only smartphones via anyconnect

    Is this possible? The goal is to allow only smartphones/tablets; No full blown laptop os'.

    If you have the anyconnect essentials and the mobile anyconnect license would it as simple as ordering "no anyconnect essentials". According to the docs this only disables anyconnect essentials, but leaves the license intact. I hope that this would mean that the anyconnect for mobile would continue to operate. Or maybe there's another way to do this?

    Unfortunately I do not have the freedom to test and cannot find it in the documentation.

    ~ Thank you

    "no anyconnect essentials" disables this feature of license for the AnyConnect Premium license.

    AnyConnect for Mobile requires one or the other license to operate.

    To apply a restriction of device type, you would normally use Dynamic Access Policy (with AnyConnect Premium) and the Cisco Secure Desktop feature. However, CSD is only supported on Windows / OS X / Linux. (Example)

    Another way, you could do it would be with the device certificates. Check endpoints for the presence of a certificate (which you would need to deploy) and only allow valid wallet certificate devices to be authenticated. That's how it is (among other things) with Cisco ISE. ISE relieves the pain somewhat by deploying the certificate under the device / user integration. Do it with only ASA, should allows you to use a deployment of certificate 3rd party (or possibly PEIE, but I don't think that you could argue the mobile device in the CEP inscription).

Maybe you are looking for