JSF Validation failure causes input values disappear

I am using a custom validator in my application by creating a class that implements javax.faces.validator.Validator. I use this validator for some input fields. When the validation fails the values that the user has entered are lost. Is their any way that we can keep these values? These input fields are in DataTable.
- Sandeep.
Edited by: sgatl2 on Mar 24, 2010 10:41 AM

If you see the JSF lifecycle, the validation phase comes before the update values phase.
So if your custome validator fails, the model will not change.
I would suggest you try with client side validation without a page refresh/server call.

Similar Messages

  • JSF Validation failure causes entered values to be lost

    I've created a JSP that has required="true" and a requiredMessage on several elements.
    If any one element on the page fails it's validation on submit(ie was left blank), when the screen is redrawn all the entered values have disappeared.
    This is obviously not going to be acceptable to a user as there may have been 5 valid entries and one mistake, and they now have to retype every entry.
    Can anyone suggest why the form might be being cleared like this?

    I'm using reference implementation 1.2 04-b10
    I've tried using an implementation of validator and it makes no difference.
    It's the only example of an inline validator other than required, which seems to work ok.
    I've got around the problem for now by doing the validation in the method called when the user hits submit. It's not quite right as if the 'required' validation fails they get mutliple messages showing these failures, but the codeRef validation doesn't even fire until all the other validation passes.

  • Validation failure resetting the values

    Hi,
    when ever the validation fails on a specific text field, it is resetting the value of the field. Is there any possibility to retain the value in the text field even the validation fails.
    Thanks and Regards,
    S R Prasad

    I created the validation rule on entity attribute and then created inputText on the user interface. If the validation fails it is resetting the value of the field to the original value (I have tested it on the data field)
    Thanks and Regards,
    S R Prasad

  • Retain all form field values after input text field validation failure

    Hi,
    I have a form with 1 input text field, one Command button and one h:selectManyListbox. when User enteres some values in input field and clicks on command button named Add, the value is validated. If input is invalid, then an error message appears next to the field. If input is valid, then the value is added into h:selectManyListbox. Adding to list box is done using Ajax4Jsf.
    Probelm:
    Let's assume user entered 3 valid values one after another and all are added into the list box. When he enters a wrong value, and error message appears. however, the entered values in list box goes away. Is there a way to retain the values even after validation failure.
    Code is given below;
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
    <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
    <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
    <h:panelGroup>
         <h:outputLabel for="inputEmailId1" value="Email Id: " />
         <t:inputText value="#{bean.newEmailId}" id="inputEmailId1" maxlength="100" size="40" immediate="true">
              <t:validateEmail message="Enter a valid Email Id." />
         </t:inputText>
         <t:message for="inputEmailId1" styleClass="errorStyleClass" />
    </h:panelGroup>
    <t:panelGroup style="text-align: left;" >
         <a4j:commandButton value="Add" styleClass="buttonsSub" action="#{bean.addSharedEmails}"
              reRender="inputEmailId1, selectedSharedEmails" />
    </t:panelGroup>
    <t:panelGroup style="text-align: left;">
         <h:selectManyListbox id="selectedSharedEmails" size="8" style="width:100%;" immediate="true">
              <f:selectItems value="#{bean.sharedEmails}" />
         </h:selectManyListbox>
    </t:panelGroup>
    Thanks in advance,

    Use the attribute "binding" instead of a "value". This will remember the value. You can also make sure that you dont have anything in your constructor or class level that initialises that value to "" or null. Because if JSF is remembering your value but your initialization that gets triggered before the page loading resets it to default values then you need to change that part of the code.

  • How to make default value in form input field disappear on user click

    I have an HTML input tag with a default value.
    How can I have that value disappear when user begins to type?
    Form is here:
    http://www.kardsbykaren.us/10pack.php
    Happy Holiday and thanks.

    Have a look here http://www.matiasmancini.com.ar/ajax-jquery-validation-html5-form.html
    Gramps

  • I am facing error while running Quickpay in Fusion payroll that "The input value Periodicity is missing for element type KGOC_Unpaid_Absence_Amount. Enter a valid input value". Any idea?

    I am facing error while running Quickpay in Fusion payroll that "The input value Periodicity is missing for element type KGOC_Unpaid_Absence_Amount. Enter a valid input value". Any idea?

    This is most probably because the Periodicity input value has been configured as "Required" and no value has been input for it.
    Please enter a value and try to re-run Quick Pay.

  • How do I pass input values from a html page to a jsf page

    hi,
    In my project,for front view we have used html pages.how can I get input values from that html page into my jsf page.for back end purpose we have used EJB3.0
    how can I write jsf managed bean for accessing these entities.we have used session facade design pattern and the IDE is netbeans5.5.
    pls,help me,very urgent
    thanx in advance

    Simplest way is to rewrite html page into jsf page.
    You can use session bean in your managed bean like this:
    import javax.naming.Context;
    import javax.naming.InitialContext;
    public class ManagedBean {
    private Context  ctx;
    private Object res;
    // session bean interface
    private Service service;
              public ManagedBean() {
                try{
                     ctx = new InitialContext();
                     res = ctx.lookup("Service");
                     service = (Service) res;
               catch(Exeption e){
    }Message was edited by:
    m00dy

  • VPD: Column Level Masking - Error: ORA-28104: input value for sec_relevant_cols is not valid

    Hi Gurus,
    I am trying to mask the secured column from the table for one specified user, Here is the detail of DB and code which I am using to apply the security:
    DB Version: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0
    Security Function:
    create or replace function kr_sec_function_papf(p_object_schema IN VARCHAR2,
    p_object_name VARCHAR2)
    return varchar2
    as
    p_nid varchar2(200);
    whoami varchar2(100);
    begin
    if SYS_CONTEXT('USERENV', 'SESSION_USER') = 'VPDTEST'
    then
    p_nid := 'national_identifier = national_identifier';
    return (p_nid);
    else
    p_nid := '1=2';
    return (p_nid);
    end if;
    end kr_sec_function_papf;
    Code to Add Policy:
    BEGIN
    DBMS_RLS.ADD_POLICY(
    object_schema => 'APPS',
    object_name => 'PER_ALL_PEOPLE_F',
    policy_name => 'secure_emp',
    policy_function => 'kr_sec_function_papf',
    statement_types => 'SELECT',
    sec_relevant_cols=>'NATIONAL_IDENTIFIER',
    sec_relevant_cols_opt=>DBMS_RLS.ALL_ROWS);
    END;
    I am getting error while executing the above plsql block, Error is:
    ORA-28104: input value for sec_relevant_cols is not valid
    ORA-06512: at "SYS.DBMS_RLS", line 20
    ORA-06512: at line 2
    Any one please help me to resolve the issue.
    Thanks in Advance.
    ~Krishna Nand Singh

    Hi Every one,
    I got this issue resolved.
    The issue is with parameter object_schema => 'APPS' , the object schema name is 'HR' and APPS has synonym with the same name.
    The Correct code should be:
    BEGIN
    DBMS_RLS.ADD_POLICY(
    object_schema => 'HR',
    object_name => 'PER_ALL_PEOPLE_F',
    policy_name => 'secure_emp',
    policy_function => 'kr_sec_function_papf',
    statement_types => 'SELECT',
    sec_relevant_cols=>'NATIONAL_IDENTIFIER',
    sec_relevant_cols_opt=>DBMS_RLS.ALL_ROWS);
    END;
    Thanks,
    Krishna Nand Singh

  • Validating input values in Entity

    Hi,
    Is there any drawbacks while validating Input values in Entity object ?

    As your business logic remains in the model layer there is always some kind of entity level validation (at least the DB constrains are checked by the DB). There are other validations which don't touch EO at all. One is e.g. input parameters for ViewCriteria which may need to meet some conditions. As there is no EO involved you have to either make the check in the VO before executing the view criteria or you do it on the UI (if you can).
    Some simple checks are always done in the UI (e.r. required).
    So in summary you have to do validation on all levels, it just depends what you want to check. As a rule of thumb all validation which are part of the business logic should be define there (e.g. EO). ADF allows you to simply define such validation which are then enforced on the data.
    Timo

  • Dynamic values for JSF selectOneMenu using javascrpt. JSF validation error.

    Hi,
    Im using Myfaces 1.2 (tomahawk) . I have a very bulky page having lot of drop down menus. It has a datatable containing four drop downs in a row and the datatable has close to 40 rows (with pagination) . Each of the drop downs have close to 100 items . This makes the page size very huge and not suitable for an internet application.
    Im thinking of a way to have the drop downs populated using javascript in body onload event so that the page size reduces drastically. I have defined a selectOneMenu without selectItems. So before page load there will be no items in the drop down. The body onLoad method populates the drop downs and the page gets rendered as expected. All the javascript events related to these drop downs works fine. When page is submitted i want the selected value in the bean variable.
    But when the page gets submitted im getting the error
    Validation Error: Value is not valid
    Can someone let me know the reason behind this and a way to solve this problem . Its really URGENT...
    Please help....
    Thanks,
    Swami.

    JSFdeveloper wrote:
    Validation Error: Value is not valid During validations phase, the submitted value of UISelectOne/UISelectMany will be tested against the current SelectItems. If it is not covered by the SelectItems, you will get this error.
    Its really URGENT...This is your own problem, not our problem. This way you're only trying to move the problem/pressure to us and pushing us to respond soon. This is considered very rude in terms of netiquette. Next time you do so, I have no problem adding you to my ignore list. [Just ask questions the smart way|http://catb.org/esr/faqs/smart-questions.html].

  • Custom Tabular form - Session state values disappear

    Hi,
    I have a custom tabular form page using apex_item and apex_collections. I am using the apex_collection to store the values in memory in order to avoid the data loss in session state. The page is working fine after a validation failure and it shows the values on the second report (as advised for custom tabular forms).
    In this, some of the rows have clob value which needs to be edit on a rich text editor. Since apex_item does not provide a solution to have rich text editor, I have to branch to another page on an Edit link for the CLOB data using a modal window. However When I return back from the modal page, the values disappear from session state, and the validation (using htmldb_application.g_fxx arrays) does not take place.
    Is there any workaround to overcome this issue?
    Apex version: 4.1
    Thanks in advance.
    Natarajan

    Thanks Daniel for your reply.
    Actually its an interface with a custom tabular form on page 1 with apex collections and rich text editor on page 2. Since it is not possible to have the rich text editor, I need to have it in another page (I could have it the same page, that is the way I am trying now) however I open the next page as a modal window.
    I have a link on the tabular form, so that the clob content is opened in the rich text editor on the next page. After the edit, I update it to the same collection and go back to the tabular form page and refreshes the report. It works fine, but causes trouble to the data entered on the other columns in the custom tabular form.
    I have now deviated to another work and put this on a hold. If my explanation is still not clear, I will create the same page in apex.com to simulate the error.
    Thanks again.
    Natarajan
    Edited by: Nattu on Mar 14, 2012 11:35 PM

  • Text Entry Box--Advanced Actions--Conditional Statement--Double quotes in literal input value

    Hello forums,
    I'm new to the forums (and Captivate in general), but I'm having a real problem carrying out a tutorial design and I think you may be my only hope.  Let me explain what I want to do and the difficulty that I'm having:
    I'm an instruction librarian at a university, and I'm designing an interactive tutorial for English 100 students to complete in order to become familiar with how to search the library catalog.  What I've done is taken a screenshot of the catalog search page, made it the background of a slide in Captivate (vers. 6), and placed a text entry box over the search bar in the screenshot.  The idea is for the students to conduct a simulated search by choosing one of three suggested search string formulations, and depending on the search string they enter, the tutorial will jump to a slide featuring a screenshot of what the actual search results would look like.  The idea is to emphasize the use of keywords over full-sentence phrases, and the use of double quotation marks to enclose multi-word search terms.
    So I've set the action for the TEB to "Execute Advanced Actions" and then created some IF/THEN statements in the "Advanced Actions" pop-up window (with action type set to 'conditional'). The script is such that if the student enters the first search option (how does sleep affect college students) in the TEB, the tutorial jumps to 1 slide, if they enter the second option (college students AND sleep), featuring a Boolean operator (AND), the tutorial jumps to a 2nd slide, and if they enter the third option ("college students" AND sleep) with the double quotes around "college students" and the Boolean operator, the tutorial should jump to a 3rd slide.  This action script works fine for the first two input options, but I can't make it work for the third search option.
    I think that it has something to do with the fact that the third input option features double quote marks, and this seems to throw off the script (I tried a quote-less input value for the third IF/THEN just to make sure that it would work jumping to the 3rd slide and it did), and I'm wondering if anyone has any suggestions as to how I can get around this issue.  Again, I need it to work so that if the student enters "college students" AND sleep, with the quote marks and the Boolean operator, the tutorial will jump to a slide showing the search results if those search terms were used in a real search of the catalog.
    I'd be extremely grateful for any help that anyone here can give me, we've been trying to make our online tutorials more engaging and interactive (and therefore more interesting), and I think this would be a great way to teach students about using quotes in their catalog searches.
    Thank you for your time and consideration.
    Andrew Wilk
    College Library
    UW-Madison

    The tutorial is for a "how to use catalog searching" instruction in an undergraduate library session.  We use boolean operators (AND, OR, NOT) to combine search terms, ex. to search for books about the sleeping habits of college students, I would enter "college students AND sleep."  Because "college students" is a multi-word phrase to describe one concept, I need to put quotation marks around the phrase to prevent the catalog from searching for the individual words separately, so the most correct search becomes ["college students" AND sleep] with quotation marks around only "college students," a user-typed "AND," and the word "sleep" (no q-marks).
    A colleague of mine worked out a pretty cool (if complicated) solution that I'll share if anyone is interested.  Since the q-marks where the problem, we've set it up so that the TEB validates the response for the search string with q-marks around "college students." If they enter it correctly, the tutorial jumps to the corresponding slide. The attempt # is set to 1, and if the user fails to enter the validated phrase (they misspell or use one of the other response options) then the TEB is set to run an Advanced Actions Script in which the other two options are scripted in IF/THEN statements that cause, when the term is entered correctly, the tutorial to jump to their corresponding slides. We've created another tab of IF/THEN statements that say that if the response is NOT equal to one of these response options, then the slide restarts (technically the slide "jumps" back to itself and starts over) and the user gets another chance to start the cycle over again.
    I know this is confusing (I had a really hard time explaining it in words), so if anyone is interested I could make a Jing video when I have some time.
    Thank you for all your suggestions

  • Trying to understand a WS-I validation failure

    I'm trying to understand the following WS-I validation failure message. I'm sure I'm making a basic mistake but I can't find an example of the use case where an xsd is imported. Can someone point out my error?
    Thanks,
    Bret
    Validation failure:
    Result failed:
    Failure Message: A QName reference that is referring to a schema component, uses a namespace not defined in the targetNamespace attribute on the xs:schema element, or in the namespace attribute on an xs:import element within the xs:schema element.Failure Detail Message:
    {http://Messages.xsd}SigReplyMessage,
    {http://schemas.xmlsoap.org/wsdl/}string,
    {http://Messages.xsd}SigRequestMessage
    Element Location: lineNumber=8
    My wsdl looks like this:
    <definitions targetNamespace="urn:S3SignatureGenerator"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:tns="urn:S3SignatureGenerator"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:messages="http://Messages.xsd">
    <types>
    <xsd:schema>
    <xsd:import id="Messages.xsd"
    schemaLocation="../../XSDDocument/Messages.xsd"
    namespace="http://Messages.xsd"/>
    </xsd:schema>
    </types>
    <message name="ReturnSignature">
    <part name="SigAndExp" type="messages:SigReplyMessage"/>
    </message>
    <message name="RequestSignature">
    <part name="Keys" type="messages:SigRequestMessage"/>
    </message>
    <portType name="SigGenerator">
    <operation name="GetSignature">
    <input message="tns:RequestSignature"/>
    <output message="tns:ReturnSignature"/>
    <fault name="sigFault" message="tns:SigFault"/>
    </operation>
    </portType>
    <message name="SigFault">
    <part name="faultMessage" element="string"/>
    </message>
    <binding name="SigGenSoapHttp" type="tns:SigGenerator">
    <soap:binding style="document"
    transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="GetSignature">
    <soap:operation soapAction="urn:S3SignatureGenerator/GetSignature"/>
    <input>
    <soap:body use="literal" parts="SecretKey PublicKey"/>
    </input>
    <output>
    <soap:body use="literal" parts="Signature"/>
    </output>
    <fault name="sigFault">
    <soap:body use="literal" parts="SecretKey PublicKey"/>
    </fault>
    </operation>
    </binding>
    <service name="SignatureGenerationService">
    <port name="SigGenSoapHttpPort" binding="tns:SigGenSoapHttp">
    <soap:address location="tbd"/>
    </port>
    </service>
    </definitions>
    Messages.xsd looks like this:
    <?xml version="1.0" encoding="windows-1252" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://www.bret.org/S3test/Messages"
    targetNamespace="http://www.bret.org/S3test/Messages"
    elementFormDefault="qualified">
    <xsd:complexType name="sigRequestMessage">
    <xsd:sequence>
    <xsd:element name="publicKey" type="xsd:string"/>
    <xsd:element name="privateKey" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="sigReplyMessage">
    <xsd:sequence>
    <xsd:element name="Signature" type="xsd:string"/>
    <xsd:element name="expiration" type="xsd:dateTime"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>

    Hi Bret,
    Sorry it's taken me a bit of time to respond, but please find below a run-down of the WS-I related problems I spotted in your WSDL document. The first few are related to the import error you saw, and there's a few others that I'll also discuss. Apologies in advance if you've already spotted and corrected those.
    I'll use line numbering based on the formatting of the WSDL and XSD that you supplied.
    BP2417 (the one you asked about)
    The line number in the error is a red herring. There are two problems here:
    - WSDL document, line 29: You're using the XSD type string unqualified - it should be xsd:string.
    - WSDL document, lines 8 and 13; schema, lines 3 and 4: The namespaces you're using don't match. Either change the namespaces in the schema to be http://Messages.xsd, or change the namespaces in the WSDL to http://www.bret.org/S3test/Messages.
    BP2202
    You should declare UTF-8 or UTF-16 encoding when creating WSDL or schema documents. The easiest way to do this is to go to Tools|Preferences, and set JDeveloper's default encoding to either UTF-8 or UTF-16.
    BP2032
    WSDL document, line 26 and 43: The name attribute of the fault should read SigFault, not sigFault, as WSDL is case-sensitive.
    WSDL document, line 44: You should use a soap:fault element, not a soap:body element, to bind a fault, thus:
    <soap:fault name="SigFault" use="literal"/>
    BP2012
    WSDL document, lines 17 and 20: Message parts in a document-bound service like this one should reference XSD elements and not complexTypes. What you need to do is define two elements in your messages schema whose types are SigReplyMessage and SigRequestMessage respectively, and then reference those elements from the WSDL.
    WSDL document, line 38: The value of the parts attribute should be Keys to match the name of the part child of the RequestSignature.
    WSDL document, line 41: The value of the parts attribute should be SigAndExp to match the name of the part child of the ReturnSignature.
    WSDL document, line 44: The value of the parts attribute should be faultMessage to match the name of the part child of the SigFault.
    BP2115
    WSDL document, lines 17 and 20: The names of the elements should be sigReplyMessage and sigRequestMessage and not SigReplyMessage and SigRequestMessage, again because WSDL is case-sensitive.
    WSDL document, line 30: The element attribute of the part references xsd:string, which is not an element but a complexType. You'll need to add an element declaration to your schema, which is of type xsd:string.
    I've included corrected versions of your WSDL and schema below, I hope this helps. I also note you've posted a few other messages related to WS-I and WSDL, I hope I've managed to cover those in this message too.
    Regards,
    Alan.
    WSDL:
    <?xml version="1.0" encoding="UTF-8" ?>
    <definitions targetNamespace="urn:S3SignatureGenerator"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:tns="urn:S3SignatureGenerator"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:messages="http://Messages.xsd">
    <types>
    <xsd:schema>
    <xsd:import id="Messages.xsd"
    schemaLocation="Messages.xsd"
    namespace="http://Messages.xsd"/>
    </xsd:schema>
    </types>
    <message name="ReturnSignature">
    <part name="SigAndExp" element="messages:sigReplyMessage"/>
    </message>
    <message name="RequestSignature">
    <part name="Keys" element="messages:sigRequestMessage"/>
    </message>
    <message name="SigFault">
    <part name="faultMessage" element="messages:faultMessage"/>
    </message>
    <portType name="SigGenerator">
    <operation name="GetSignature">
    <input message="tns:RequestSignature"/>
    <output message="tns:ReturnSignature"/>
    <fault name="SigFault" message="tns:SigFault"/>
    </operation>
    </portType>
    <binding name="SigGenSoapHttp" type="tns:SigGenerator">
    <soap:binding style="document"
    transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="GetSignature">
    <soap:operation soapAction="urn:S3SignatureGenerator/GetSignature"/>
    <input>
    <soap:body use="literal" parts="Keys"/>
    </input>
    <output>
    <soap:body use="literal" parts="SigAndExp"/>
    </output>
    <fault name="SigFault">
    <soap:fault name="SigFault" use="literal"/>
    </fault>
    </operation>
    </binding>
    <service name="SignatureGenerationService">
    <port name="SigGenSoapHttpPort" binding="tns:SigGenSoapHttp">
    <soap:address location="tbd"/>
    </port>
    </service>
    </definitions>
    Schema:
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://Messages.xsd"
    targetNamespace="http://Messages.xsd"
    elementFormDefault="qualified">
    <xsd:element name="sigRequestMessage">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="publicKey" type="xsd:string"/>
    <xsd:element name="privateKey" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="sigReplyMessage">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="Signature" type="xsd:string"/>
    <xsd:element name="expiration" type="xsd:dateTime"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="faultMessage" type="xsd:string"/>
    </xsd:schema>

  • Bug with validation or rendering after validation failure (?)

    Can anyone confirm the behaviour on other J2EE containers that I will describe below ?
    h2. Environment:
    JBoss 7.1.1 (Brontes)
    JDK 1.7.0_06 32-bit
    Win7 64-bit
    17:40:44,365 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-13) Initializing Mojarra 2.1.7-jbossorg-1 (20120227-1401)Below is the very simple test case:
    h2. 1) A very simple request-scoped bean:
    package test;
    import java.io.Serializable;
    import javax.faces.bean.ManagedBean;
    import javax.faces.bean.RequestScoped;
    import javax.validation.constraints.NotNull;
    @ManagedBean
    @RequestScoped
    public class RequestBean implements Serializable {
         private static final long serialVersionUID = 1L;
         @NotNull(message="Input 1 is required")
         private String input1;
         @NotNull(message="Input 2 is required")
         private String input2;
         public String getInput1() {
              return input1;
         public String getInput2() {
              return input2;
         public void setInput1(String input1) {
              this.input1 = input1;
         public void setInput2(String input2) {
              this.input2 = input2;
    }h2. 2) A very simple test.xhtml page:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head></h:head>
    <body>
    <h:form>
           <h:panelGrid columns="2">
               Input 1: <h:inputText value="#{requestBean.input1}" />
               Input 2: <h:inputText value="#{requestBean.input2}" />
               <h:commandButton id="submit" value="Submit"/><br/>
               <h:messages/><br/>
           </h:panelGrid>
    </h:form>
    </body>
    </html>h2. 3. web.xml contents:
    <?xml version="1.0"?>
    <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    <display-name>test</display-name>
      <context-param>
      <param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
      <param-value>true</param-value>
    </context-param>
      <context-param>
      <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
      <param-value>client</param-value>
    </context-param>
    <!--
      <welcome-file-list>
        <welcome-file>index.html</welcome-file>
      </welcome-file-list>
    -->
    <servlet>
      <servlet-name>Faces Servlet</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.faces</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    </web-app>h2. 4. faces-config.xml contents:
    <?xml version="1.0" encoding="UTF-8"?>
    <faces-config
        xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_1.xsd"
         version="2.1">
    </faces-config>h2. 5. Contents of WEB-INF/lib:
    salvojo@AAS-AUD20901BL /cygdrive/c/jboss-as-7.1.1.Final/standalone
    $ ls -alt deployments/test.war/WEB-INF/lib/
    total 1384
    drwx------+ 1 Administrators Domain Users      0 Nov  2 17:40 ..
    drwx------+ 1 Administrators Domain Users      0 Nov  2 16:56 .
    -rwx------+ 1 Administrators Domain Users 393259 Nov  2 16:56 standard.jar
    -rwx------+ 1 Administrators Domain Users  21029 Nov  2 16:56 jstl.jar
    -rwx------+ 1 Administrators Domain Users  38015 Nov  2 16:56 commons-logging.jar
    -rwx------+ 1 Administrators Domain Users 139966 Nov  2 16:56 commons-digester.jar
    -rwx------+ 1 Administrators Domain Users 559366 Nov  2 16:56 commons-collections.jar
    -rwx------+ 1 Administrators Domain Users 188671 Nov  2 16:56 commons-beanutils.jar
    -rwx------+ 1 Administrators Domain Users  48742 Nov  2 16:56 common-annotations.jarh2. 6. The test case
    h4. 6.1 Open the test.jsf page with your browser
    h4. 6.2 Click on Submit WITHOUT specifying any values for both Input1 and Input2.
    Expected behaviour: Messages displayed that both input fields are required.
    Actual: As expected
    h4. 6.3 Supply values for both Input1 and Input2, then click Submit
    Expected behaviour: No validation messages displayed. Entered values remain in the input field
    Actual: As expected
    h4. 6.4 Remove input value for Input1, then click Submit
    Expected behaviour:
    Validation message that Input1 is required.
    Current value for Input1 remain blank.
    Previous value for Input2 remain in the input field.
    Actual: As expected
    h4. 6.5 Remove input value for Input2, then click Submit ( both Input fields are now blank )
    Expected behaviour:
    Validation message both input fields are required.
    Input value for Input1 remain blank.
    Input value for Input2 remain blank.
    h3. Actual ( NOT AS EXPECTED, see below )
    Validation message both input fields are required.
    Input value for Input1 remain blank.
    Input value for Input2 remain NON-blank. The previous value before it was blanked out and submitted is rendered / displayed on the page*

    gimbal2 wrote:
    jmsjr wrote:
    I thought I was going crazy !Why? You created proper test cases and you proved something was off. At that point you get realistic, not crazy.
    Perhaps you simply need to get it into your system to look for an issue tracker to see if something is known about it :)Yup. It is described in:
    http://java.net/jira/browse/JAVASERVERFACES-2262
    http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-939
    However, as mentioned here, I have now found a different issue as described in that JBoss forums when using the same EL expression / same bean property:
    in 1 inputText and 1 disabled inputText and 1 outputText or
    in 1 inputText and 1 disabled inputText or
    in 1 inputText and 1 outputText

  • 기존 ELEMENT에 INPUT VALUE를 추가하는 방법

    제품 : HR_PER
    작성날짜 : 2005-11-23
    기존 ELEMENT에 INPUT VALUE를 추가하는 방법
    ================================
    Explanation
    기존 Element에 Input Value를 하나 더 생성해서 DB Item으로 값을 읽고 싶은데 Input Value추가가 안되네요. 어떻게
    추가하는 방법이 없을까요?
    ### Steps to Reproduce ###
    HRMS Manager > 보상합계 > 기본 > 항목내용 화면에서 입력값버튼을 눌러 입력값을 추가하고 싶음.
    ### CAUSE DETERMINATION ( Not required for Question-Answer issues) ###
    ### SOLUTION / ACTION PLAN OR ANSWER ###
    Note : 175552.1
    "Maintaining Elements
    After you have defined and used an element, you can make the
    following changes:
    -Change a required input value to be not required.
    -Alter the sequence in which input values appear in the Element
    Entries window.
    -Change the input value validation rules for minimum,
    maximum, lookup, or formula.
    -Change your specification of which input values create Database
    Items. Note, however, you cannot remove Database Items if they
    are used in any formulas or QuickPaint reports.
    -You cannot remove existing input values or add new ones if you have
    created any entries for the element."
    Note : 334953.1
    Symptoms
    o Tried to add an Input Value to an existing element.
    The links to the element were end-dated on 29-Jul-2005
    o Navigation: Total Compensation --> Basic --> Element
    Description, Bring up input values form, and try to add a new input value.
    Error happens
    o Error message:
    'FRM-41051: You cannot create records here
    o Expect to be able to enter new input values.
    o Happening in patch instance
    Cause
    The Error 'FRM-41051: You cannot create records here' arises because there are existing element entries for this element.
    An input value cannot be added to an element if element entries exist for that element or input
    value date is greater than the start date of the element.
    Internal Bug:710550 : CAN'T MODIFY OR ADD NEW RECORDS INTO THE INPUT VALUES FOR AN ELEMENT
    States the following:
    "General rule is:
    Insert of new IVs is not allowed when any element entries or run results for the element type exist.
    I understand this is not the case here as there is no link for the element but can this be verified again.
    This functionality is controlled via CONTROL_INPUT_VALUE_INSERTION procedure.
    Insert of input values is not allowed when:
    element_entries_exist or
    no_of_input_values for the element is > 15 or
    :ctl_globals.session_date != element_start_date "
    Bug 809105 : CANNOT ADD INPUT VALUES TO EXISTING ELEMENT (PAYWSDET)
    States:
    The business rule quoted in Bug 710550 also states that you cannot add a new
    input value if element entries exist for this element - please check that this
    is not the case here.
    Note 269070.1
    Title: Cannot Create A User Defined Input Value For A State
    Retirement Plan Deduction Element
    Symptoms
    In the element description form you cannot add new input values for a deduction element. You get
    this error when creating new input value:
    FRM-41051 You cannot create records here
    The deduction element is a newly created element.
    Cause
    When adding the input values Datetrack date was not proper.
    Fix
    Make sure there are no element entries existing for the element.
    Make sure to date track to the date when the element was created.
    Solution
    Because the application looks at three conditions before it will allow you to add an input value
    to an element, if one of those conditions are met it will not allow you to create the element entry.
    In your case 2 are being met so the system will not allow you to create the element entry.
    1- element entries exist
    2- state date of the new input value is greater than the element start date
    Conditions being looked at:
    element_entries_exist or
    no_of_input_values for the element is > 15 or
    :ctl_globals.session_date != element_start_date
    There is no workaround for scenario, you need to create a new element.
    결과적으로 말씀드리면, 한번 입력된 Element에 대해서는
    아래의 두가지 속성을 모두 충족하지 않는 한,
    Input Value를 추가로 입력하실 수 없습니다.
    신규로 Element를 지정해주셔야 합니다.
    1. Make sure there are no element entries existing for the element.
    ==> 해당 Element에 대한 Element Entry가 없어야 합니다.
    2. Make sure to date track to the date when the element was created.
    ==> 신규 Input Value를 입력하려는 DateTrack날짜가 Element가 생성된 날짜와 같아야 합니다.
    Reference Documents
    Note : 334953.1 Paywsdet Error 'FRM-41051: You cannot create records here' when Trying to Add an Input Value to an Existing Element.
    Note : 175552.1 How To Add A New Input Value To An Existing Element ?

Maybe you are looking for