Norwegian Currency Validation using NumberFormat

Hi,
I have to validate a value which will be in a Norwegian Currency.
So, I use the NumberFormat class like this:
String noValue = "300,50";
NumberFormat formatter = NumberFormat.getCurrencyInstance(new Locale("no", "NO"));
After this one, I have to convert noValue from String to Double whether it contains only numbers. So, I give like this:
double american = new Double(noValue).doubleValue();
But it is throwing NumberFormatException.
Can anyone help me how to validate Norwegian/Swedish currencies.
Thanks & Regards,
Bh

hi,
This is my code chunk:
String noValue = "300,50";
NumberFormat formatter = NumberFormat.getCurrencyInstance(new Locale("no", "NO"));
System.out.println("noValue " + noValue);
String formatted = formatter.format(noValue);
double value = new Double(formatted).doubleValue();
And this println prints:
noValue 300,50
After that it throws the IllegalArgumentException in formatter.format.
Whereas, I tried like this also:
String noValue = "300,50";
NumberFormat formatter = NumberFormat.getCurrencyInstance(new Locale("no", "NO"));
System.out.println("noValue " + noValue);
double number1 = formatter.parse(noValue).doubleValue();
But this is giving parse exception..Please help me..
Thanks
Bh.

Similar Messages

  • Adding currency validation in OY03 transaction

    Hi Experts,
    I want to add a currency validation in the transaction OY03, since OY03 is transaction for table maintenace I have to add an event to vaidate the data entered in the sm30 screen. Since it is a standard table SAP is not allowing me to add an event. Please let me know how to overcome this problem, is there any way to add events to a standard SAP table maintenace?
    Your suggestions are really appreciated.
    Thanking you in advance,
    Faar.
    Moderator message - Cross post locked
    Edited by: Rob Burbank on Sep 8, 2009 4:33 PM

    Hi Rob,
    Thank you very much  for your reply.
    I tried to add an event in the maintenace using SE54 transaction, I am able create an entry for the event. but it is neither allowing me to include that particular part of code in any of the  available includes nor creating a  new include.
    This is the issue I am facing.
    Faar.

  • Sweden Currency validation

    Hello ,
    Can any one tell me why the following is not retuning (0)
    as indication that S and S2 Strings are equal?
    java.text.NumberFormat currency = java.text.NumberFormat.getCurrencyInstance(new java.util.Locale("sv", "SE" )  );
    String S = "1 234,56";
    String S2= (String)currency.format( 1234.56 );
    System.out.println(�  S is >>  �+ S);
    System.out.println(�  S2 is >>  �+ S2);
    return  (S.compareTo(S2));
    Knowing that formatting 1234.45 in Sweden locale should be 1 234,45

    Check out the below code I hope that you will get what you want now.
    java.text.DecimalFormat currency = (DecimalFormat)java.text.NumberFormat.getCurrencyInstance(new java.util.Locale("sv", "SE" )  );
    DecimalFormatSymbols symbols = new DecimalFormatSymbols(new java.util.Locale("sv", "SE" )  );
    symbols.setGroupingSeparator((char)32);
    currency.setDecimalFormatSymbols(symbols);
    System.out.println((int)symbols.getGroupingSeparator());
    System.out.println((int)' ');
    String S = "1 234,56 kr";
    String S2= (String)currency.format( 1234.56 );
    System.out.println(�  S is >>  �+ S);
    System.out.println(�  S2 is >>  �+ S2);
    return  (S.compareTo(S2));I would suggest you that it is a good practise to read and understand the use of API carefully, which will save a lot of time.
    ~Mitul

  • Questions regarding currency conversion using SPRUNCONVERSION.

    Hi all,
    I have implemented currency conversion using SPRUNCONVERSION stored procedure. I have following questions regarding how does it work.
    1. Is it mandatory to create FxTrans Business Rules with SPRUNCONVERSION?
    2. How does it work internally? How does it look up rate from the rate application?
    Any help will be greatly appreciated. Any reference to any documents will help.
    Thanks&Regards,
    Diksha.
    (PS: How to document does not explain about how it works).

    Hi Diksha,
    1. Yes since it will base it's translation rules based on what is defined on the currency conversion business rules.
    2. The stored procedure SPRUNCONVERSION scans all records found in the selected region of data and translates them according to the RATETYPE property assigned to the ACCOUNT specified in each record, based on the following mechanism:
    Note:
    All ACCOUNTS with no RATETYPE (ratetype = blank) will be translated with a factor of 1
    All ACCOUNTS with the reserved RATETYPE = NOTRANS will not be translated
    All other ACCOUNTS will be translated according to the definitions contained in the table of parameters called clcFXTRANS.
    How the RATE table is selected
    While most customers require a single table of rates, there are situations when more than one set of rates is required. In this situation, the translation procedure uses the RateEntity dimension to select the correct table of rates to use.
    Whenever a destination currency is selected, the procedure searches for a RateEntity member flagged with this currency in the Currency property. For example, if translating into USD, the system uses the RateEntity member that has the Currency property set to USD.
    If there is no RateEntity flagged as the destination currency, the system will use the RateEntity with Currency = 'u2019 (blank).
    In addition to this, some exceptions by ENTITY can be applied. For example, some entities just entering in the consolidation perimeter may need to be converted at their own specific set of rates. These entities may have a corresponding RateEntity member in the RATE cube. All ENTITIES having a corresponding RateEntity member in the RATE cube will use that member as rate table. For example, if there is a RateEntity member named like the ENTITY USOps, the RateEntity member USOps will be used to translate the values of entity ENTITY USOps.
    The RateEntity member, when representing an ENTITY, may be any of the following:
    A valid base level or parent member ID from the ENTITY dimension of the main cube
    A list of members of the ENTITY dimension, as defined filtering the members using a value of the DIMLIST property (or any property whose name begins with "DIMLISTu201D) of such dimension.
    For more info, you could refer to the Administration Help found on the Admin console.
    Hope this helps,
    Marvin

  • Not able to run validation using validation.xml & validator-rules.xml

    Hello Friends,
    I am not able to run validation using validation.xml & validator-rules.xml.
    Entire code in running prefectly but no error messages are prompted.
    Following is my code:
    File Name : struts-config.xml
    <struts-config>
    <!-- Form Beans Configuration -->
    <form-beans>
    <form-bean name="searchForm"
    type="com.solversa.SearchForm"/>
    </form-beans>
    <!-- Global Forwards Configuration -->
    <global-forwards>
    <forward name="search" path="/search.jsp"/>
    </global-forwards>
    <!-- Action Mappings Configuration -->
    <action-mappings>
    <action path="/search"
    type="com.solversa.SearchAction"
    name="searchForm"
    scope="request"
    validate="true"
    input="/search.jsp">
    </action>
    </action-mappings>
    <!-- Message Resources Configuration -->
    <message-resources
    parameter="ApplicationResources"/>
    <!-- Validator Configuration -->
    <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames"
    value="/WEB-INF/validator-rules.xml,
    /WEB-INF/validation.xml"/>
    </plug-in>
    </struts-config>
    <br> File Name : <b> validation.xml </b>
    <form-validation>
    <formset>
    <form name="searchForm">
    <field property="name" depends="minlength">
    <arg key="label.search.name" position = "0"/>
    <arg1 name="minlength" key="${var:minlength}" resource="false"/>
    <var>
    <var-name>minlength</var-name>
    <var-value>5</var-value>
    </var>
    </field>
    <field property="ssNum" depends="mask">
    <arg0 key="label.search.ssNum"/>
    <var>
    <var-name>mask</var-name>
    <var-value>^\d{3}-\d{2}-\d{4}$</var-value>
    </var>
    </field>
    </form>
    </formset>
    </form-validation>
    <br> File Name : <b> SearchForm.java </b>
    package com.jamesholmes.minihr;
    import java.util.List;
    import org.apache.struts.validator.ValidatorForm;
    public class SearchForm extends ValidatorForm
    private String name = null;
    private String ssNum = null;
    private List results = null;
    public void setName(String name) {
    this.name = name;
    public String getName() {
    return name;
    public void setSsNum(String ssNum) {
    this.ssNum = ssNum;
    public String getSsNum() {
    return ssNum;
    public void setResults(List results) {
    this.results = results;
    public List getResults() {
    return results;
    <br> File Name : <b> SearchAction.java </b>
    package com.jamesholmes.minihr;
    import java.util.ArrayList;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    public final class SearchAction extends Action
    public ActionForward execute(ActionMapping mapping,
    ActionForm form,
    HttpServletRequest request,
    HttpServletResponse response)
    throws Exception
    EmployeeSearchService service = new EmployeeSearchService();
    ArrayList results;
    SearchForm searchForm = (SearchForm) form;
    // Perform employee search based on what criteria was entered.
    String name = searchForm.getName();
    if (name != null && name.trim().length() > 0) {
    results = service.searchByName(name);
    } else {
    results = service.searchBySsNum(searchForm.getSsNum().trim());
    // Place search results in SearchForm for access by JSP.
    searchForm.setResults(results);
    // Forward control to this Action's input page.
    return mapping.getInputForward();
    <br> File Name : <b> EmployeeSearchService.java </b>
    package com.jamesholmes.minihr;
    import java.util.ArrayList;
    public class EmployeeSearchService
    /* Hard-coded sample data. Normally this would come from a real data
    source such as a database. */
    private static Employee[] employees =
    new Employee("Bob Davidson", "123-45-6789"),
    new Employee("Mary Williams", "987-65-4321"),
    new Employee("Jim Smith", "111-11-1111"),
    new Employee("Beverly Harris", "222-22-2222"),
    new Employee("Thomas Frank", "333-33-3333"),
    new Employee("Jim Davidson", "444-44-4444")
    // Search for employees by name.
    public ArrayList searchByName(String name) {
    ArrayList resultList = new ArrayList();
    for (int i = 0; i < employees.length; i++) {
    if (employees.getName().toUpperCase().indexOf(name.toUpperCase()) != -1) {
    resultList.add(employees[i]);
    return resultList;
    // Search for employee by social security number.
    public ArrayList searchBySsNum(String ssNum) {
    ArrayList resultList = new ArrayList();
    for (int i = 0; i < employees.length; i++) {
    if (employees[i].getSsNum().equals(ssNum)) {
    resultList.add(employees[i]);
    return resultList;
    <br> File Name : <b> Employee.java </b>
    package com.solversa;
    public class Employee
         private String name;
         private String ssNum;
         public Employee(String name, String ssNum) {
         this.name = name;
         this.ssNum = ssNum;
         public void setName(String name) {
         this.name = name;
         public String getName() {
         return name;
         public void setSsNum(String ssNum) {
         this.ssNum = ssNum;
         public String getSsNum() {
         return ssNum;
    Pls help me out.
    Not able to prompt errors.

    Hello Friends,
    I am not able to run validation using
    validation.xml & validator-rules.xml.
    Entire code in running prefectly but no error
    messages are prompted.
    Following is my code:
    File Name : struts-config.xml
    <struts-config>
    <!-- Form Beans Configuration -->
    <form-beans>
    <form-bean name="searchForm"
    type="com.solversa.SearchForm"/>
    ans>
    <!-- Global Forwards Configuration -->
    <global-forwards>
    <forward name="search" path="/search.jsp"/>
    global-forwards>
    <!-- Action Mappings Configuration -->
    <action-mappings>
    <action path="/search"
    type="com.solversa.SearchAction"
    name="searchForm"
    scope="request"
    validate="true"
    input="/search.jsp">
    tion>
    </action-mappings>
    <!-- Message Resources Configuration -->
    <message-resources
    parameter="ApplicationResources"/>
    <!-- Validator Configuration -->
    <plug-in
    className="org.apache.struts.validator.ValidatorPlugI
    ">
    <set-property property="pathnames"
    value="/WEB-INF/validator-rules.xml,
    /WEB-INF/validation.xml"/>
    >
    </struts-config>
    <br> File Name : <b> validation.xml </b>
    <form-validation>
    <formset>
    <form name="searchForm">
    <field property="name" depends="minlength">
    <arg key="label.search.name" position = "0"/>
    <arg1 name="minlength" key="${var:minlength}"
    resource="false"/>
    <var>
    <var-name>minlength</var-name>
    <var-value>5</var-value>
    </var>
    </field>
    <field property="ssNum" depends="mask">
    <arg0 key="label.search.ssNum"/>
    <var>
    <var-name>mask</var-name>
    <var-value>^\d{3}-\d{2}-\d{4}$</var-value>
    </var>
    </field>
    /form>
    </formset>
    form-validation>
    <br> File Name : <b> SearchForm.java </b>
    package com.jamesholmes.minihr;
    import java.util.List;
    import org.apache.struts.validator.ValidatorForm;
    public class SearchForm extends ValidatorForm
    private String name = null;
    private String ssNum = null;
    private List results = null;
    public void setName(String name) {
    this.name = name;
    public String getName() {
    return name;
    public void setSsNum(String ssNum) {
    this.ssNum = ssNum;
    public String getSsNum() {
    return ssNum;
    public void setResults(List results) {
    this.results = results;
    public List getResults() {
    return results;
    <br> File Name : <b> SearchAction.java </b>
    package com.jamesholmes.minihr;
    import java.util.ArrayList;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    public final class SearchAction extends Action
    public ActionForward execute(ActionMapping
    mapping,
    ActionForm form,
    HttpServletRequest request,
    HttpServletResponse response)
    throws Exception
    EmployeeSearchService service = new
    EmployeeSearchService();
    ArrayList results;
    SearchForm searchForm = (SearchForm) form;
    // Perform employee search based on what criteria
    was entered.
    String name = searchForm.getName();
    if (name != null && name.trim().length() > 0) {
    results = service.searchByName(name);
    else {
    results =
    service.searchBySsNum(searchForm.getSsNum().trim());
    // Place search results in SearchForm for access
    by JSP.
    searchForm.setResults(results);
    // Forward control to this Action's input page.
    return mapping.getInputForward();
    <br> File Name : <b> EmployeeSearchService.java </b>
    package com.jamesholmes.minihr;
    import java.util.ArrayList;
    public class EmployeeSearchService
    /* Hard-coded sample data. Normally this would come
    from a real data
    source such as a database. */
    ivate static Employee[] employees =
    new Employee("Bob Davidson", "123-45-6789"),
    new Employee("Mary Williams", "987-65-4321"),
    new Employee("Jim Smith", "111-11-1111"),
    new Employee("Beverly Harris", "222-22-2222"),
    new Employee("Thomas Frank", "333-33-3333"),
    new Employee("Jim Davidson", "444-44-4444")
    // Search for employees by name.
    public ArrayList searchByName(String name) {
    ArrayList resultList = new ArrayList();
    for (int i = 0; i < employees.length; i++) {
    if
    (employees.getName().toUpperCase().indexOf(name.toU
    pperCase()) != -1) {
    resultList.add(employees[i]);
    return resultList;
    // Search for employee by social security number.
    public ArrayList searchBySsNum(String ssNum) {
    ArrayList resultList = new ArrayList();
    for (int i = 0; i < employees.length; i++) {
    if (employees[i].getSsNum().equals(ssNum)) {
    resultList.add(employees[i]);
    return resultList;
    <br> File Name : <b> Employee.java </b>
    package com.solversa;
    public class Employee
         private String name;
         private String ssNum;
         public Employee(String name, String ssNum) {
         this.name = name;
         this.ssNum = ssNum;
         public void setName(String name) {
         this.name = name;
         public String getName() {
         return name;
         public void setSsNum(String ssNum) {
         this.ssNum = ssNum;
         public String getSsNum() {
         return ssNum;
    Pls help me out.
    Not able to prompt errors.
    Hi,
    Your error message are not displaying because u does not made Message-Resoucrce property file (Resource Bundle) when you make it .
    give it entry in
    struts-config.xml
    <message-resources parameter="ApplicationResources" />
    and
    define key and corresponding error message to key in this ApplicationResources i.e
    #Error Resources
    label.search.ssNum=Plz Enter correct ssNum

  • How to get values from a table(in jsp) for validation using javascript.

    hi,
    this is praveen,pls tell me the procedure to get values from a table(in jsp) for validation using javascript.
    thank you in advance.

    Yes i did try the same ..
    BEGIN
    select PROD_tYPE into :P185_OFF_CITY from
    magcrm_setup where atype = 'CITY' ;
    :p185_OFF_CITY := 'XXX';
    insert into mtest values ('inside foolter');
    END;
    When i checked the mtest table it shos me the row inserted...
    inside foolter .. Now this means everything did get execute properly
    But still the vallue of off_city is null or emtpy...
    i check the filed and still its empty..
    while mtest had those records..seems like some process is cleaining the values...but cant see such process...
    a bit confused..here..I tried on Load after footer...
    tried chaning the squence number of process ..but still it doesnt help
    some how the session variables gets changed...and it is changed to empty
    Edited by: pauljohny on Jan 3, 2012 2:01 AM
    Edited by: pauljohny on Jan 3, 2012 2:03 AM

  • How do I do validation using SDK.

    How do I do validation using SDK.
    We have created different warehouses for the client business operations.
    For eg:
    1. Inspection Stores
    2. Rejection Stores
    3. Main Stores
    In Goods Return & A/P Credit Memo, other than RejectionStores is
    selected, we want to generate a warning message.
    How do I do this through SDK.
    I need the code sample for the following activity:
    1. Reading the data available at each row of the current form (Goods
    Return/ A/P Credit memo)
    2. Validate the data with a paricular warehouse
    3. Generate warning message.
    I could not find any samples related to this.

    There is a method called MessageBox for the Application object. Have a look at
    the documentation, everything is there.

  • Struts2 - Dynamic values in expression while doing validations using annota

    Hi,
    I am using Struts2. I am doing validations using annotations in action class.
    I have many forms having same type of fields say zip code.
    I am adding validations like below in each action class having zip code field
    @Action(value = "/saveData")
    @Validations(
         regexFields = {
              @RegexFieldValidator(fieldName = "databean.zipCode", expression = "^([1-9]{1}[0-9]{4}(-[0-9]{4})?)$", key = "errors.zipcode.format", message = "errors.zipcode.format")
    public String saveData() throws Exception {
    Now, in case if I need to change the expression for zip code validations, then I need to modify the same in each action class.
    I would like to know if there is any way to use java variable or property for expression so that i only need to change at one place (value of variable) and all actions get modified.
    I want something like below
    private static final String ZIP_CODE_FORMAT_EXPRESSION = "^([1-9]{1}[0-9]{4}(-[0-9]{4})?)$"
    @Action(value = "/saveData")
    @Validations(
         regexFields = {
              @RegexFieldValidator(fieldName = "databean.zipCode", expression = "${ZIP_CODE_FORMAT_EXPRESSION}", key = "errors.zipcode.format", message = "errors.zipcode.format")
    public String saveData() throws Exception {
    Thanks
    Krishan Babbar

    Thanks
    That is working..
    I defined my expression as constant in my another file and it is working fine....
    One more question i need to check space in expression but its not working... I tried following:
    expression = "^([a-zA-Z0-9@_.-\\s]+)$" and expression = "^([a-zA-Z0-9@_.-\\\\s]+)$"

  • Foreign currency validation

    Hi, Experts,
    I was wondering when doing Foreign currency validation,  The system get the Profit center defaultly, when posting the variance.
    I am wondering where did system get the Profit center when we do FAGL_FC_VAL?

    Hi Bryan Shala,
    When you execute T-code FAGL_FC_VAL for sub-ledger like Customer and Vendor. It will check the open item posted with Profit Center.
    It will post the Gain/Loss to same Profit center, to the Profit center which posted in open Item.
    Regards
    Rakshith

  • Pre-validation using JavaScript cannot work in JSF?

    Sometimes we need to do pre-validation using JavaScript in some senarios that data need be entered and validated at client site before it reaches to Web Application Server. Remind that JSF is a server validation. Creator seems not to allow Developers to do pre-validation using JavaScript for any editable input fields in form. I will illustrate an example and hope anyone can help me to solve it out.
    Assume that if we write the a new web page that allows User enters Name and Phone. The pre-validation function called test() is written in JavaScript for validating field Phone. For simplicity, the below HTML/JavaScript without nested in table is a simple one for HTML form.
    <html>
    <body>
    <script language="JavaScript">
    function test(){
         if (form1.phone.value == "")
              alert("Please enter phone number in digits.");
              return false;
    </script>
    <form name=form1>
    <input id="phone" type="text" size=20><Br>
    <input id="name" type="text" size=20><Br>
    <input type="submit" id="submit" onclick="test()" value="Submit">
    </form>
    </body>
    </html>
    Now, we consider using Java Studio Creator to generate the same form as describing above. The script is shown below:
    <?xml version="1.0"?>
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <html>
    <head>
    <title>testForm Title</title>
    </head>
    <body rave-layout="grid">
    <h:form binding="#{testForm.form1}" id="form1">
    <h:inputText binding="#{testForm.textField1}" id="phone" style="position: absolute; left: 192px; top: 96px; width: 168px; height: 23px"/>
    <h:inputText binding="#{testForm.textField2}" id="name" style="position: absolute; left: 192px; top: 144px; width: 168px; height: 23px"/>
    <h:commandButton binding="#{testForm.button1}" id="submit" style="position: absolute; left: 192px; top: 216px" value="Submit"/>
    </h:form>
    </body>
    </html>
    </f:view>
    </jsp:root>
    After running Script that Creator created, the HTML is generated and reduced (for simplicity) as follows:
    <f:view>
    <html>
    <body rave-layout="grid">
    <form action="/rave/rave" id="form1" method="post">
    <input id="form1:Phone" type="text"></input>
    <input id="form1:name" type="text"></input>
    <input id="form1:button1" value="Submit" onClick="test()"></input>
    </body>
    </html>
    </f:view>
    Take a look carefully at <input> elements. We see the syntax for naming for each "input" element that there is a semi colon added between form1 and phone or form1 and name. This syntax is generated from built-in JSF components. Hence, I rewrite the test() JavaScript function to match with the naming that Creator generated as follows:
    <script language="JavaScript">
    function test(){
         if (form1.form1:Phone.value == "")
              alert("Please enter phone number in digits.");
              return false;
    </script>
    Clearly, this JavaScript cannot be worked because of a semi column that Creator has named it.
    I have tried to work arround for this but cannot find a solution except changing the name such as: from <input id="form1:phone" ...> to <input id="form1_phone" ..>. But I could not change or modify the scripts because it is generated from JSF components when running it under browser.
    I guess to solve this problem, the naming for elements in form should be reconsidered in the next release of Java Studio Creator.

    Hi Marie,
    I currently sucess in client pre-validation using JSF. I found a way to do it.
    Please take a look of how javascript has been added in the following scripts:
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <html lang="en-US" xml:lang="en-US">
    <head>
    <meta content="no-cache" http-equiv="Cache-Control"/>
    <meta content="no-cache" http-equiv="Pragma"/>
    <title>login Title</title>
    </head>
    <body style="-rave-layout: grid">
    <h:form binding="#{login.form1}" id="form1">
    <h:outputLabel binding="#{login.componentLabel1}" for="componentLabel1" id="componentLabel1" style="position: absolute; left: 216px; top: 72px">
    <h:outputText binding="#{login.componentLabel1Text}" id="componentLabel1Text" value="Application System Name"/>
    </h:outputLabel>
    <h:panelGrid binding="#{login.gridPanel1}" columns="3" id="gridPanel1" style="position: absolute; left: 72px; top: 168px; width: 504px; height: 100px">
    <h:outputLabel binding="#{login.componentLabel2}" for="componentLabel2" id="componentLabel2">
    <h:outputText binding="#{login.componentLabel2Text}" id="componentLabel2Text" value="User Name: "/>
    </h:outputLabel>
    <h:inputText binding="#{login.textField1}" id="textField1" onclick="" style="width: 149px; height: 22px"/>
    <h:outputText binding="#{login.outputText1}" id="outputText1"/>
    <h:outputLabel binding="#{login.componentLabel3}" for="componentLabel3" id="componentLabel3">
    <h:outputText binding="#{login.componentLabel3Text}" id="componentLabel3Text" value="Password: "/>
    </h:outputLabel>
    <h:inputSecret binding="#{login.textField2}" id="textField2" style="width: 147px; height: 22px"/>
    <h:outputText binding="#{login.outputText2}" id="outputText2"/>
    <h:outputLabel binding="#{login.componentLabel4}" for="componentLabel4" id="componentLabel4">
    <h:outputText binding="#{login.componentLabel4Text}" id="componentLabel4Text"/>
    </h:outputLabel>
    <h:commandButton action="#{login.ok_action}" binding="#{login.button1}" id="button1" onclick="return checkUserIdentity(this.form)"
    style="width: 90px; height: 25px" value="OK"/>
    <h:outputLabel binding="#{login.componentLabel5}" for="componentLabel5" id="componentLabel5">
    <h:outputText binding="#{login.componentLabel5Text}" id="componentLabel5Text"/>
    </h:outputLabel>
    </h:panelGrid>
    </h:form>
    </body>
    <script type="text/javascript">
    function checkUserIdentity(form){
    var userName = form["form1:textField1"].value;
    var userPassword = form["form1:textField2"].value;
    if (userName == "") {
    alert("Please enter User Name.");
    form["form1:textField1"].focus();
    return false;
    if (userPassword == "" ){
    alert("Please enter password.");
    form["form1:textField2"].focus();
    return false;
    form.submit();
    return true;
    </script>
    </html>
    </f:view>
    </jsp:root>
    The key for getting data value from Form based on Javascripts is var userName = form["form1:textField1"].value;
    Thanks,
    VTT_

  • Valid Use of a Collection in SCCM

    I've read the contents of this post with much interest and would like to ask about whether my particular requirement is possible.
    When we build a server for the first time we need to ensure that it is not placed in collection with other production servers for obvious reasons. So I was thinking about creating a provisional collection
    container where we can place newly built servers pending the QA of the build. The container will resemble the Production Collection in every respect except who has permissions to perform maintenance tasks on the objects in the collection. So if there is an
    issue with the build and we need to delete the object or reset its maintenance flag, we don't risk inadvertently doing this to a normally functioning production server. That way we can also restrict who has the authority to maintain the collection to the build
    teams. Only when the server is fully functioning and provisioned in AD and formally handed to the run teams, will it be moved to the Production Collection.
    Is this a valid way to use Collections? If so is there any existing SCCM Task Sequence tool that will move servers between containers or do we need to develop one?
    Many thanks....

    Hi,
    It sounds like a valid use of Collections. There is no builtin tool to move a device from a collection to another, you could check out the Right Click tools for SCCM 2007 and see if there is one or, simply change one of the right click tools script to have
    that feature.
    Regards,
    Jörgen
    -- My System Center blog ccmexec.com -- Twitter
    @ccmexec

  • Not valid use of the New word

    Hi,
    I have an old script in visual basic 6 which I need to modify.
    In the variables declaration I have the following:
    Dim test as mscomm
    and later I instantiate this variable in the following way:
    set test = new mscomm
    In the components I have selected the following:
    Microsoft comm control 6.0
    I must say that it works fine when I have this in an ocx but I would like to debug a piece of code. The error is in the line with the New and the error is: Not valid use of the New word.
    Can anybody help me?
    Thanks in advance. Regards.

    You can't have the "set" in VB.NET.
    If you create a new project and copy-paste the old VB6 code into your file it will convert most of the code for you to be compatible with VB.NET.
    I think MSComm might be a Shared class. If so you don't need "test = new mscomm"
    You can just use "test.CommPort = 2" for example. I'm not sure about this because this is the only example I could find.
    https://msdn.microsoft.com/en-us/library/aa259394(v=vs.60).aspx
    Dan Randolph -
    My Code Samples List

  • Euro currency symbol  using '€'

    Hi Everyone,
    Do you have any problem populate the Euro currency symbol using '&#8364;'. I use XDK 9.2.0.2.0 and run on WinNT, Solaris and both display the Euro currency symbol using '&#8364;' as a "?"
    Sample test.xsl:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" encoding="ISO-8859-1"/>
    <xsl:template match="/">
    <Root>
    <euro>&#8364;</euro>
    </Root>
    </xsl:template>
    </xsl:stylesheet>
    or
    test.xsql
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <Bid xmlns:xsql="urn:oracle-xsql">
    <euro>&#8364;</euro>
    </Bid>
    Thanks

    Using the unicode &#8364; Your best bet is to ask tom at: http://asktom.oracle.com

  • I have loaded the newest 7.0.2 to my i phone and got an italian appstore, not  the norwegian one I use

    I  loaded the newest 7.0.2 to my i phone and got an italian appstore, not  the norwegian one I use, what can I do???

    Hi sislu,
    You may want to check to make sure that the iTunes Store Country is correctly set for the Norwegian one. You may find the following article helpful:
    iOS: Changing the signed-in iTunes Store Apple ID account
    http://support.apple.com/kb/HT1311
    Change your iTunes Store country
    Sign in to the account for the iTunes Store region you'd like to use. Tap Settings > iTunes & App Stores > Apple ID: > View Apple ID > Country/Region.
    Regards,
    - Brenden

  • Validation using a DB function

    Hi,
    I am trying to add declarative validation for a field. The validation is a complex one whose logic resides in the database (let's call it is_valid_part).
    There are 2 pages, first page they enter a part, and on the second they get some part info. I'm using a transient VO, and hoping to stop the user at the first page if the is_valid_part doesnt pass.
    is_valid_part takes 2 parameters - the part number and the logged in user's ID.
    I saw this blog: http://andrejusb.blogspot.com/2010/04/implementing-custom-generic-plsql.html, and other examples on custom validator using backing bean, but they dont talk about how you can pass any other value other than the value on the field (in this case part number). In my case I am trying to pass in both the part number and user's id, which will come from a backing bean.
    I can write a method in the AM but I am trying to as declaratively as possible. Any suggestions?
    Thank you
    Kalp

    Thank you. Looked at the page you provided, but it mentions that "For an attribute-level validator, the method must take a single argument of the same type as the entity attribute. " That is, it can only use the value of the part number, and I cant pass in user id. i'd said user id for simplicity, it's actually a user related ID that is coming from another transient attribute that stores that info, and I will pull that into a managed bean..
    So is an AM method the only way to go? Or there is some other way to allow validation rule to accept 2 parameters?
    thanks!
    kalp

Maybe you are looking for

  • How to attach files in soap response?

    IS there any way to attach a file in soap response? how to do that??:|

  • Replace text with number

    Hi i have 2 columns from flat file 0amount       number 10000           "Intangibles"         2000 20000               'sales'         4000 my output is required like incase if i am getting text ( this text is not constant its coming like any thing s

  • Ipod problems with my iphone 5

    I can't see the songs that are in my playlists on my phone.. it says that music is taking up the gigs but theres no music there.. This happened when i downloded the newest version of itunes can anybody help?

  • Paying someone $10 for a quick 5 minute script.

    You'll need Paypal so I can pay you the $10. If you don't have a Paypal account, then just ignore this. It's quite simple really, but I'm too lazy to look up the code myself. I have a flash file already set up with all the graphics and buttons you ne

  • Adobe flash player/with apple products

    I need to know which adobe flash player works with apple.