JSF 1.1 Tabset validation

Hi!
I have a simple page with a tabset and 2 tabs on it (JSF 1.1 Netbeans 6 vwp). I have a save button also. The two tabs have components that have required property true. I can save the page without getting a validation error if the unvisible tab is unfilled. I can reach all components in Invoke Apllication phase but only the visible tab is validated.
How is it possible to validate all tabs on the tabset?
Or how is it possible to recognize wich tabs are not wisited by the user and inform it?
Thanks in advance!
Peter

If required is "false", then validators will not execute when the field is empty.
The spec defines how to override the error message for when "required" validation fails, though I don't have the spec handy at the moment.
-- Adam Winer (EG member)

Similar Messages

  • JSF and XHTML Transitional validation

    We're finishing our first public-facing JSF project and our final hurdle is to make sure our pages are XHTML compliant (we're a government department and we have to fall in line); we've chosen XHTML 1.0 Transitional.
    We have two problems:
    1. When we use <h:commandLink ...> the inserted javascript is not escaped and produces the validation errors using the W3C validator:
    Warning Line 87 column 121: character "<" is the first character of a delimiter but occurred as data.
    ...p;if (adp != null) {for (var i = 0;i < adp.length;i++) {f.removeChild(adp)
    Warning Line 87 column 270: character "<" is the first character of a delimiter but occurred as data.
    ...p.split(',');for (var i = 0,ii = 0;i < ps.length;i++,ii++) {var p = document.
    [/code]
    Is this a known problem, and is there a solution? A last resort could be to use a ServletFilter to insert <[CDATA[ ]]> into the page, around the javascript.
    2. Multiple forms produce multiple hidden input tags with the same ID:
    Error Line 106 column 54: ID "javax.faces.ViewState" already defined.
    ...en" name="javax.faces.ViewState" id="javax.faces.ViewState" value="j_id114:j_As far as I can see we're going to have to re-design our pages to use just one form (we have two navigation menus each with their own form, then one form for the page.)
    Unless there is another solution?
    We're using Sun JSF RI 1.2_03-b09-FCS (with facelets), but observe the same behaviour with 1.2_04.
    Many thanks for any help,
    Andy.

    I have encountered the same issue. Hard-coded "javax.faces.ViewState" is a design bug in my view. subviews make absolutely no sense when view state id is hard-coded. It has to be auto-generated just as it's values are, even though that may require iteration thru the params. One way to deal w/ this to avoid iteration thru params in JSF impl, is to append subview id "javax.faces.ViewState" hidden field, have each subview look up accordingly. There is no other way to have valid XHTML.
    If there's a work-around, please share.
    Thanks,
    Reshat.

  • JSF autocomplete - fails XHTML validation

    My JSF pages (mojarra 2.0.1) generate a hidden state holder with an autocomplete="off"' property as part of the </h:form> closing tag:
    <input type="hidden"
    name="javax.faces.ViewState"
    id="javax.faces.ViewState"
    value="-1715251979060474851:6281790946545926031"
    autocomplete="off" />
    </form>The autocomplete property is not valid XHTML so it does not validate under XHTML 1.0 Transitional, or any other common XHTML DTD as far as I can tell (see: [http://validator.w3.org/]).
    I'd like to validate under XHTML 1.0 Transitional. Has anyone got a good fix for this?

    The autocomplete was added as a fix, so you do not want to disable this. See: [Issue 1129|https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1129]
    There are a couple of ways to pass validation.
    *1) add ATTLIST to doctype - does not work*
    I found a way to pass XHTML validation as suggested by: [https://wiki.mozilla.org/The_autocomplete_attribute_and_web_documents_using_XHTML]
    Its a little bit it of a cheat really, but I add *[<!ATTLIST input autocomplete CDATA #IMPLIED>]* into my doctype and it will pass the W3C XHTML validator:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
       [<!ATTLIST input autocomplete CDATA #IMPLIED>]>This method passes validation, but this leaves your HTML with a "]>" at the start of the page, so is not usable
    *2) Custom DTD*
    The other way is to download the DTD from W3C, modify it and use your own custom DTD.
    Also a cheat but gets you through the W3C tests.
    Edited by: zsaurnni on Dec 7, 2009 10:24 PM

  • JSF 2 : dynamic required validation for different buttons ?

    Hello,
    I'm currently learning about jsf 2.0 from core jsf 2.0 book + glassfish + cdi.
    I have a question about the validation feature of JSF.
    Let's say i have a very simple login application, which has a very simple layout like :
    userid : (input field for userid - using required="true")
    password : (input secret for password - using required="true")
    loginButton + registerButton(using immediate="true") + checkUserIdAvailabilityButton
    Now, let's say the loginButton is pressed, and the userid and password are left empty, validation error would occur on both of the fields, and that's working as what i intended.
    And when the registerButton is pressed, it doesnt care whether the userid or password is filled by the user, since it's using immediate="true", thus bypassing validation and the command gets executed at the apply request value phase, and that's still working as what i intended.
    And here comes my problem .. When the checkUserIdAvailabilityButton is pressed, i only expect the userid to be filled, and i dont need to care about whether the password field is filled or not, but the password field will throw error saying that it's a required field.
    Is there anyway to resolve this kind of problem ? I know this could be a very simple application, but in my working place, i think they design lots of screens like this, like the save button along with refresh button with different required fields but the buttons are in the same page.
    Thank you !

    Hello there !
    Thank you for the response.
    I agree with the server side approach. I also find it not easy to maintain lots of uncentralized validations on many jsf pages.
    For example, validation on the my CustomerName's length could get replicated on hundreds of pages, and when the requirement changes, i have to update many pages.
    But doing this on the serverside is not easy either, i suppose, got to have a custom framework to fill the needs. Im thinking of a general validator that could validate when supplied the variable's name, and the validator will know whether the field needs validating on the correctness of the date value, or the length of the fieldname, etc, based on some external configuration that says this variable is a type of date, with max length of this, min value of that, etc.
    If i dont have this kind of tools, i'll also replicate all the validations like the CustomerName's case on many bean methods, which i think is not maintainable too.
    Do you happen to know whether this kind of validation tools exist somewhere ? I dont think that bean validation framework from jsr 303 would fill my need, am i correct ?
    Regards,
    Albert Kam

  • JSF: how to avoid validation but still submit data to the "business layer"

    Greetings
    The scenario is common and sounds like this:
    1) We have 2 forms, each with some fields marked with required = "true"
    2) Navigation between these two should be unlimited and data should be submitted to the (stateful) business layer every time we move from one to another, without validation,
    thus all of my h:commandButton tags are marked with type="submit"
    3) On final "save" command data should be validated and sent to DB
    Now,
    - if i avoid required attributes on fields, everything works fine except validation ofcourse
    - if i add immediate="true" where needed, data gets lost when i navigate from one page to another
    thanks a lot in advance

    Use an EL expression for the value of the required attribute. Note that the important thing is its value during the subsequent request. If you have other types of validations you may have to use custom validators.

  • JSF, NetBeans and customizing of Standard Validation Errors

    Hello together,
    i want to use german Standard Validation Errors via a own .properties File:
    1.
    Here is my faces-config.xml ( the entries are uncommented ! ):
    <faces-config>
    <application>
    <locale-config>
    <default-locale>de</default-locale>
    <supported-locale>de</supported-locale>
    <supported-locale>en</supported-locale>
    </locale-config>
    *<message-bundle>alles.mymessages</message-bundle>*
    </application>
    </faces-config>
    2.
    Here is mymessages.properties-File in package alles:
    javax.faces.validator.NOT_IN_RANGE=Das angegebene Attribut liegt nicht zwischen den erwarteten Werten {0} und {1}.
    javax.faces.validator.NOT_IN_RANGE_detail="{2}"\:Eingegebener Wert liegt nicht im erwarteten Bereich von {0} bis {1}.
    javax.faces.validator.LongRangeValidator.LIMIT=Validierungsfehler
    javax.faces.validator.LongRangeValidator.LIMIT_detail=Eingegebener Wert kann nicht in den korrekten Typ umgewandelt werden.
    javax.faces.validator.LongRangeValidator.MAXIMUM=Validierungsfehler
    javax.faces.validator.LongRangeValidator.MAXIMUM_detail="{1}"\:Wert ist gr\u00F6\u00DFer als das erlaubte Maximum"{0}".
    3.
    Here the part of the JSF-View with the Validator:
    <ui:textField binding="#{WorkTypeEdit.textFieldBeschartKzSoll}" converter="#{WorkTypeEdit.bigIntegerConverter1}"
    id="textFieldBeschartKzSoll" required="true" style="height: 24px; width: 48px" validator="#{WorkTypeEdit.longRangeValidator1.validate}"/>
    The application still shows the standard englisch validation error text. What is wrong here ?
    I' am using NetBeans 5.5.1 with VWP and the deploment is to Glassfish server.
    Thanks a lot.
    HJA

    Hello Raymond,
    i did some coding and create additional a custom validator:
    My JSF-View part:
    <ui:textField binding="#{WorkTypeEdit.textFieldBeschartKzSoll}" converter="#{WorkTypeEdit.integerConverter1}"
    id="textFieldBeschartKzSoll" maxLength="2" required="true" style="height: 24px; width: 48px" *validator="#{MyValidation.validateInput}">*
    *<f:validateLongRange minimum="1" maximum="9"></f:validateLongRange>*
    </ui:textField>
    My custom validator in Myvalidation class:
    public void validateInput (FacesContext facescontext, UIComponent component, Object value) throws ValidatorException
    long min = 0, max = 0;
    Locale locale = facescontext.getViewRoot ().getLocale ();
    String mb = facescontext.getApplication ().getMessageBundle ();
    ResourceBundle rb = ResourceBundle.getBundle (mb, locale);
    Validator[] validator = ((UIInput) component).getValidators ();
    for (int i=0; i < validator.length; i++)
    if (validator[i] instanceof LongRangeValidator)
    LongRangeValidator lv = (LongRangeValidator) validator;
    long lvalue = Long.valueOf ((String)value.toString ());
    min = lv.getMinimum ();
    max = lv.getMaximum ();
    if (lvalue < min || lvalue > max)
    ((UIInput) component).setValid (false);
    *String message = rb.getString ("javax.faces.validator.NOT_IN_RANGE");*
    *String messageDetail = rb.getString ("javax.faces.validator.NOT_IN_RANGE_detail");*
    *facescontext.addMessage (component.getClientId (facescontext), new FacesMessage (FacesMessage.SEVERITY_ERROR,message,messageDetail));* }
    What happen now is, at first i get the german message because of rb.getString........ so the locale is working
    and then the englisch message follows in the message component.
    Sorry that i take your time so long...
    HJA

  • 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_

  • About Validation in JSF

    i encounter such a problem that: when a jsf page fails in validation, i cannot do anything on that page till validation success or i kill the session. For example when i fill a field with an inappropriate value, it fails in validation. then i send another parameter to that page which is appropriate to the scope of validation. then the jsf page refreshes but the value that caused the validation failed is rendered not the parametre i sent. when i asked it to the senior developers they said it is such the way. they said the wrong value kept somehow. if u share your knowledge i will be appreciate. santiago

    you can create a demo use JSF achitecture, and create the simple page,
    for example ,login.jsp, and add tag <h:inputText/> <h:commandButton/> in you login page,
    add custom validation and custom converter to <h:inputText/>
    for your tag <h:commandButton/>, adding the phaseListener and track the JSF lifeCycle by log4j.
    you will learn more about component-based JSF achitecture.
    ...

  • Issue in converting Struts view to JSF view using struts-faces integration

    Hi All,
    I am facing a issue in my Sruts to JSF conversion application using struts-faces.jar integration library.
    Need expert's help desperately as I am not able to use <s:form> tag in my new jsf page to call a struts action.
    I want to call a struts action from my web page designed using JSF,
    but it seems impossible without using <s:form> tag from struts-faces integration library.
    Please suggest how to resolve this...
    I am using WSAD 5.1 IDE with inbuilt Test environment WebSphere server
    JSF Version: Sun's RI 1.1
    Struts framework: 1.2.6
    Struts-Faces Integration Library version: 1.0
    I have configured a controller element in struts-config.xml file as has been suggested by different online
    documents I studied:
    <controller>
    <set-property property="processorClass"
    value="org.apache.struts.faces.application.FacesRequestProcessor"/>
    </controller>
    But configuring a controller does not allow my test server to start up properly and due to errors the ActionServlet also becomes unavailable.
    If I comment the controller and start the test server it starts fine but then I cannot access the converted jsf page which contains the <s:form action="/xxxxx.do"> tag.
    If now I get back to <h:form> tag instead of <s:form> tag with a <h:commandButton action="xxxx.do"/> for form submission in my jsf page, I see the html page generated with all components but now checking the html source generated I see
    <form action="/contextName/jspFolder/sameDisplayedPage.jsf"> which is not valid and never gets called successfully.
    I think someways I need to use the <s:form> tag with the controller configured properly to use the struts-faces integration library's request processor, to get things working. But HOW???
    Following is the error I get if I use the <controller> tag element in struts-config.xml file and start the server.
    This error appears on starting the server without accessing any application's jsp web page
    [6/12/06 15:31:14:109 IST] 3e311815 ActionServlet E org.apache.struts.action.ActionServlet Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as unavailable. Most likely, this is due to an incorrect or missing library dependency.
    [6/12/06 15:31:14:109 IST] 3e311815 ActionServlet E org.apache.struts.action.ActionServlet TRAS0014I: The following exception was logged java.lang.IllegalAccessError: org.apache.commons.digester.SetPropertyRule tried to access method org/apache/commons/beanutils/BeanUtils.setProperty(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V
    at org.apache.commons.digester.SetPropertyRule.begin(SetPropertyRule.java:198)
    at org.apache.commons.digester.Rule.begin(Rule.java:200)
    at org.apache.commons.digester.Digester.startElement(Digester.java:1273)
    at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
    at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
    at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.commons.digester.Digester.parse(Digester.java:1548)
    at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:736)
    at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:685)
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:331)
    at javax.servlet.GenericServlet.init(GenericServlet.java:258)
    at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doInit(StrictServletInstance.java:82)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._init(StrictLifecycleServlet.java:147)
    at com.ibm.ws.webcontainer.servlet.PreInitializedServletState.init(StrictLifecycleServlet.java:270)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.init(StrictLifecycleServlet.java:113)
    at com.ibm.ws.webcontainer.servlet.ServletInstance.init(ServletInstance.java:189)
    at javax.servlet.GenericServlet.init(GenericServlet.java:258)
    at com.ibm.ws.webcontainer.webapp.WebAppServletManager.addServlet(WebAppServletManager.java:870)
    at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:224)
    at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadAutoLoadServlets(WebAppServletManager.java:542)
    at com.ibm.ws.webcontainer.webapp.WebApp.loadServletManager(WebApp.java:1277)
    at com.ibm.ws.webcontainer.webapp.WebApp.init(WebApp.java:283)
    at com.ibm.ws.webcontainer.srt.WebGroup.loadWebApp(WebGroup.java:387)
    at com.ibm.ws.webcontainer.srt.WebGroup.init(WebGroup.java:209)
    at com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:987)
    at com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java:136)
    at com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:356)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:418)
    at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:787)
    at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:354)
    at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:575)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:271)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:249)
    at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:536)
    at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:413)
    at com.ibm.ws.runtime.component.ApplicationServerImpl.start(ApplicationServerImpl.java:125)
    at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:536)
    at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:413)
    at com.ibm.ws.runtime.component.ServerImpl.start(ServerImpl.java:183)
    at com.ibm.ws.runtime.WsServer.start(WsServer.java:128)
    at com.ibm.ws.runtime.WsServer.main(WsServer.java:225)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41)
    at java.lang.reflect.Method.invoke(Method.java:386)
    at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94)
    at com.ibm.etools.websphere.tools.runner.api.ServerRunnerV5$1.run(ServerRunnerV5.java:97)
    [6/12/06 15:31:14:188 IST] 3e311815 WebGroup E SRVE0020E: [Servlet Error]-[ActionServlet]: Failed to load servlet: javax.servlet.UnavailableException: org.apache.commons.digester.SetPropertyRule tried to access method org/apache/commons/beanutils/BeanUtils.setProperty(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:366)
    at javax.servlet.GenericServlet.init(GenericServlet.java:258)
    at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doInit(StrictServletInstance.java:82)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._init(StrictLifecycleServlet.java:147)
    at com.ibm.ws.webcontainer.servlet.PreInitializedServletState.init(StrictLifecycleServlet.java:270)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.init(StrictLifecycleServlet.java:113)
    at com.ibm.ws.webcontainer.servlet.ServletInstance.init(ServletInstance.java:189)
    at javax.servlet.GenericServlet.init(GenericServlet.java:258)
    at com.ibm.ws.webcontainer.webapp.WebAppServletManager.addServlet(WebAppServletManager.java:870)
    at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:224)
    at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadAutoLoadServlets(WebAppServletManager.java:542)
    at com.ibm.ws.webcontainer.webapp.WebApp.loadServletManager(WebApp.java:1277)
    at com.ibm.ws.webcontainer.webapp.WebApp.init(WebApp.java:283)
    at com.ibm.ws.webcontainer.srt.WebGroup.loadWebApp(WebGroup.java:387)
    at com.ibm.ws.webcontainer.srt.WebGroup.init(WebGroup.java:209)
    at com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:987)
    at com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java:136)
    at com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:356)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:418)
    at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:787)
    at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:354)
    at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:575)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:271)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:249)
    at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:536)
    at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:413)
    at com.ibm.ws.runtime.component.ApplicationServerImpl.start(ApplicationServerImpl.java:125)
    at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:536)
    at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:413)
    at com.ibm.ws.runtime.component.ServerImpl.start(ServerImpl.java:183)
    at com.ibm.ws.runtime.WsServer.start(WsServer.java:128)
    at com.ibm.ws.runtime.WsServer.main(WsServer.java:225)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41)
    at java.lang.reflect.Method.invoke(Method.java:386)
    at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94)
    at com.ibm.etools.websphere.tools.runner.api.ServerRunnerV5$1.run(ServerRunnerV5.java:97)
    (same error message re-iterates/repeats itself... and finally -
    Error 503: Failed to load target servlet [ActionServlet] comes in web-browser
    Following is the error which I get if I comment the <controller> element in the struts-config.xml file
    and use a <s:form action="xxxxx.do"> in the struts converted jsf page. The web-server starts fine, but
    accessing the jsf page givers error as:
    [6/12/06 15:38:00:781 IST] 696f19de WebGroup I SRVE0180I: [Sample Struts-JSF integration application] [training2] [Servlet.LOG]: /jsp/welcomeF.jsp: init
    [6/12/06 15:38:01:219 IST] 696f19de WebGroup E SRVE0026E: [Servlet Error]-[]: java.lang.NullPointerException
    at org.apache.struts.faces.renderer.FormRenderer.encodeBegin(FormRenderer.java:114)
    at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:683)
    at javax.faces.webapp.UIComponentTag.encodeBegin(UIComponentTag.java:591)
    at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:478)
    at org.apache.jsp._welcomeF._jspService(_welcomeF.java:207)
    at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:344)
    at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:662)
    at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
    at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
    at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
    at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
    at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:974)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:555)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
    at org.apache.struts.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
    at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
    at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
    at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
    at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:974)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:555)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
    at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1054)
    at org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:992)
    at org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:551)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:209)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1192)
    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:412)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
    at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
    at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
    at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
    at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:974)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:555)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
    at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
    at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
    at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
    at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
    at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
    at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
    at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
    at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)
    Finally if I change my <s:form action="xxxxx.do"> tag to
    <h:form>
    <h:commandButton id="submit" action="xxxx.do" value="Submit" />
    I see the webpage coming up in the browser (no controller element used in struts-config.xml file this time)
    But in the html source of this html created from jsf I see
    <form id="_id2" method="post" action="/training2/jsp/welcomeF.faces" enctype="application/x-www-form-urlencoded">
    here form's action attribute is pointing to the same displayed page with the context name prefixed. I
    assume it is because jsf could not resolve the "xxxx.do" action to anything so set it to the same displayed page.
    May be I am wrong as usual...
    Below is the simple struts jsp page which I need to convert to jsf page as I am converting only the View part of application.
    I want to use the same struts beans and application logic at the back-end. At front-end I need UIComponents from JSF to be used.
    Following is the struts jsp page
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %>
    <%@ taglib prefix="html" uri="/WEB-INF/lib/struts-html.tld" %>
    <%@ taglib prefix="bean" uri="/WEB-INF/lib/struts-bean.tld" %>
    <html:html>
    <html:base/>
    <html:messages id="messages" />
    <font style="color:red; font=weight:italic; font-family: century gothic">
    <html:errors/>
    </font>
    <BODY>
    <P>Sample Struts and JSF integration example</P>
    <P>This one is being displayed via Struts specific tags</P>
    <html:form action="validateUser.do">
    <bean:message key="label.name" /> : <html:text property="name" />
    <bean:message key="label.password" /> : <html:password property="password" />
    <bean:message key="label.age" /> : <html:text property="age" />
    <bean:message key="label.city" /> : <html:text property="city" />
    <bean:message key="label.address" /> : <html:text property="address" />
    <html:submit property="submit" value="Show info via Struts" />
    </html:form>
    </BODY>
    </html:html>
    I have converted it into the following jsf page
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://struts.apache.org/tags-faces" prefix="s" %>
    <f:view>
    <HTML><BODY>
    <f:verbatim><P>Sample Struts and JSF integration example</P></f:verbatim>
    <f:verbatim><P>This one is being displayed via JSF tags</P></f:verbatim>
    <h:form> <!-- Want to use s:form tag instead of this h:form tag -->
    <h:inputText id="name" value="#{userForm.name}" /><f:verbatim>
    </f:verbatim>
    <h:inputSecret id="password" value="#{userForm.password}" /><f:verbatim>
    </f:verbatim>
    <h:inputText id="age" value="#{userForm.age}" /><f:verbatim>
    </f:verbatim>
    <h:inputText id="city" value="#{userForm.city}" /><f:verbatim>
    </f:verbatim>
    <h:inputText id="address" value="#{userForm.address}" /><f:verbatim>
    </f:verbatim>
    <h:commandButton id="submit" action="#{user.facesAction}" value="Show info via Struts" />
    </h:form>
    </BODY></HTML>
    </f:view>
    I am very hopeful of some answer from respected group experts, please help me.
    I am in urgency of course but would not push for immed. response like other, just want some help for sure that is going to
    be extremely valuable to me. Anticipating a helping hand...
    Thanks and Regards
    Vishal Sharm
    Time's fun when you're having flies � Kermit, the Frog
    -------------------------------------------------------------------------

    I've managed to get this working Ok from JDeveloper:
    See:
    http://www.groundside.com/blog/content/DuncanMills/J2EE+Development/?permalink=573FDB6F8D918B9704907899635CABB1.txt
    http://www.groundside.com/blog/content/DuncanMills/J2EE+Development/?permalink=2B04ACE99A6437EDED775F15553D1DED.txt
    Basically you just have to fiddle around with Library settings to get this working OK.
    As to how useful this is, well that's up to you - I'd not regard Faces + Struts as a must use combination, rather it's a can mix if you really need to. Look at Faces and Faces navigation first and see if that actually gives you enough before you start to look at mixing.

  • h:form with W3C validation failure

    Hi gurus,
    I tried to validate my JSF page against W3C validation rules. However, each <h:form> in my page creates a hidden field as:
    "+<input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="j_id14:j_id15" />+"
    with same id and value, so as a result, i can't pass the validation.
    So could anyone has a suggestion on this problem?
    BTW, i found some threads suggest to use a "giant" h:form for the entire page, and clearly this is not the answer i am looking for.
    Thanks in advance!

    Yep, it's a known issue.
    I've attempted fixes in the RI in the past, however due to potential reliance on the presence of both
    fields for AJAX libraries+JSF, it's left as is.

  • Editable datatable field validation when using datascroller pagination

    Hi,
    Im using tomahawk-1.1.8 and myfaces-api-1.2.6 I have an editable datatable with each rows having the following set of fields
    selectBooleanCheckBox , three selectOneMenus , three outputTexts, three inputTexts
    There will be close to 200 rows in the table so im using t:dataScroller to paginate the datatable.
    The following are my requirements
    1     All elements of the form except the selectBooleanCheckbox must be disabled on load of the page.
    2     On clicking on the boolean check box the corresponding rows must be enabled.
    3     I should be able to extract only the selected row in the bean side to perform some action and finally save it in the database.
    4     On submit of the page I should validate the following.
    a. at least one check box is selected
    b. Whether all the three intputTexts in the row have values and must also verify if they have valid values.
    c. Rows which are not selected (using check box) need not be considered for validation
    d. if any invalid data is found appropriate error message must be thrown and that particular element should be given the focus
    On seeing the requirement I felt it’s better to use Javascript to enable/disable controls and to validate data. Everything works fine if I have all the controls in a single page. But since I have server side pagenation enabled (using datascroller) I’m able to access only the current page form elements from javascript. In shot I’m able to access only the elements which are in the page from where I click on submit.But the user may change data in several pages and finally submit.
         This leads me to a situation where validation can be done using JSF only. I’m ok to do validations in JSF using a custom validator .But certain things like enabling or disabling controls on the form and the onLoad behavior can be coded using javascript only. This is because if I set the values such as disabled=”true” on the jsf inputText tag itself it is taking effect every time I move out and come back to the same page.
    I’m new to JSF . Can someone assist me in this. It’s pretty URGENT….
    Thanks,
    Swami

    Hi,
    Thanks for your quick response. I tried setting the disabled attribued based on you suggestion . But the enabling/disabling will not be immediate. I will have to go to some other page and come back to the first page to see the change in state.
    For eg:
    a. I defaulted the 'selected' attribute of bean to 'false' .So all rows loaded in disabled state as expected.
    b. Now if i check the check box other dependant fields will not be enabled immediately . I will have to move do different page and come back to current page for seeing the controls in enabled status.
    To overcome this problem i wrote some javascript function to set the selected rows elements' disabled property to false. I wrote something like the following for every element in the data row . After this the fields got enabled immediately on selecting check box
    document.getElementById("<form name>:<data table name>:"+rowIndex+":<element name1>").disabled=false;
    document.getElementById("<form name>:<data table name>:"+rowIndex+":<element nameN>").disabled=false;
    But now there is one more problem
    1. The page loads with all elements disabled.
    2. I click on the select box and javascript enables the controls on the row (in page 1)
    3. I change a value in a text box in the enabled row and move to page 2.
    4. Come back to page 1 and see the new value of text box not being retained.
    5. I change the value in the same text box again and move to page 2 .
    6. Come back to page 1 and see the new value getting retained.
    After some initial analysis i found that the the change in value of a form element (text box in this example) which is in disabled status will not be updated in the backing bean on page submit i.e the setter methods will not be called for these elements .Though i enabled it using javascript its actuallly still disabled accoring to the bean attributes.
    So in step 3 of the above example the setter methods are not getting called since the field is disabled according to bean. On the contrary , in step 5 the setter methods are getting called when moving to page 2 since the state is enabled according to bean.
    Problem  2
    I have a column containg two elements out of which one can be present based on the value of another selectOneBox in the same row.In the below example based on value of 'type' ,either 'station' or 'period' should be displayed.
    I have set display style as none in station assuming that zone should be displayed on page load.
    style="display:none" This is causing problem when i navigate accross pages. When i go to a different page and come back then the zone is getting displayed irrespective of the value of type. This is because the page is rendered again with the default values.
    <t:column>
    <f:facet name="header">
    <t:outputText value="type" />
    </f:facet>
    <h:selectOneMenu
    id="type"
    value="#{row.typeIndex}"
    onchange="fnHideControls('#{rowIndex}'); return false;"  disabled="#{!(row.selected)}">
    <f:selectItems
    value="#{bean.lstType}" />
    </h:selectOneMenu>
    </t:column>     
    <t:column>
    <f:facet name="header">
    <t:outputText value="Station/Period" />
    </f:facet>
    <h:selectOneMenu
    id="Station"
    value="#{row.stationIndex}"
    style="display:none" disabled="#{!(row.selected)}">
    <f:selectItems
    value="#{bean.lstStation}"  />
    </h:selectOneMenu>
    <h:selectOneMenu
    id="period"
    value="#{row.periodIndex}"
    disabled="#{!(row.selected)}" >
    <f:selectItems
    value="#{bean.lstPeriod}" />
    </h:selectOneMenu>
    </t:column>Can you help me out with both these problems.
    Thanks,
    Swami.

  • XHTML with JSF?

    I'm trying to build a valid XHTML application with JSF 1.1. The <h:form> tag seems to break XHTML rules. I have JSF code that looks something like:
    I had to change add quote characters to "<"p">" expressions; otherwise, this forum doesn't properly display.
    <body>
         <h:form>
              "<"p">"<!--Some controls-->"<"/p">"
         </h:form>
    </body>That renders the following:
    <body>
         <form id="_id0" method="post" action="/TestJSF/FirstPage.faces" enctype="application/x-www-form-urlencoded">
              "<"p">"<!--Some controls-->"<"/p">"
         <input type="hidden" name="_id0" value="_id0" /></form>
    </body>In XHTML:
         - A <form> element can't be in a "<"p">"/<h3>/<table> type element.
         - All <input> elements (including hidden ones) MUST be in a "<"p">"/<h3>/<table> type element.
    The JSF <h:form> outputs a hidden <input> element right before the </form> close. This violates XHTML rules. What can I do to get my JSF app to render valid XHTML?

    i'm very new to jsf so i apologize if this is way off:
    there are 2 methods of saving view state - session / client saves state
    session uses either an identifer (sid) in cookie or URL
    client uses hidden field (or am i way off)
    therefore try session:
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
    </context-param>

  • Adding items to a selectOneListbox from Javascript

    In my JSF page I have...
    <h:form id="alternateDeviceSelectForm">
        <h:selectOneListbox id="selectBox"/>
        <h:commandButton id="okButton" value="#{i18n.ok}" action="#{aBean.anActionMethod}"/>
    </h:form>I also have this Javascript...
    for (var i=0; i < devices.length; i++) {
        var device = devices;
    // a String
    var id = device.getId();
    // another String
    var displayName = device.getDisplayName();
    this.selectBox.options[i] = new Option(displayName,id);
    This creates the listbox and when the Javascript method fires, the appropriate items are listed in as list items.  However, when I hit the OK button, I get a JSF message about a validation error.  I'm not using any custom validation at all.
    Here's the error message I get... "alternateDeviceSelectForm:selectBox: Validation Error: Value is not valid"
    Any ideas on how I can get this working?  (I have to get the listbox item values from Javascript because that is the interface to a browser plugin that is involved in this process.)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    dalearyous wrote:
    the only thing is there is no data to begin with. after you choose the data structure there is a text field to type in something like apple and then you click add. then you can type in something like pear and click add.If you do it right, the part that controls the data structures won't need to directly interact with the part that adds/removes the elements in the data structures -- they'll be independent units. That's what we call "orthogonal", and it helps make programs much easier to develop and maintain. To do that, you have a common set of add/remove operations across all data structures -- just like in the Collections framework, which you should use unless your teacher is telling you that you must make your own. (And even if you do, ask your teacher if you can use the interfaces from the Collections framework, if not the implementations.)
    The example I showed you supports that, in that it doesn't assume that the data structures initially contain any data. (Though it might be better to create empty Collections in your constructor, rather than ever letting existingCollection go null.

  • SelectOneListBox works with Customer Converter Problem

    I am keeping getting validation error when I try to convert SelectOneListBox String value to Name class which contains FirstName and LastName components.
    here is what I did:
    1. SelectOneList has two String items , I assigned the SelectOneList value to Name backend javabean, the source page code is:
    <h:selectOneListbox styleClass="selectOneListbox" id="listbox1" value="#{pc_Test2View.name}">
    <f:selectItem itemValue="Markus Sonnberg" itemLabel="Markus Sonnberg" />
    <f:selectItem itemValue="Roland Paul" itemLabel="Roland Paul" />
    </h:selectOneListbox>
    2. The definition of Name java bean is:
    public class Name implements Serializable{
         protected String firstName = null;
         protected String lastName= null;
    get/set...()
    3. Create the NameConverter class:
    public Object getAsObject(FacesContext context, UIComponent component, String value) {     
              Name name = new Name();
              System.out.println("..... before value: " + value);
              String[] nameComps = value.split(" ");
              name.setFirstName(nameComps[0]);
              name.setLastName(nameComps[1]);
              System.out.println("1st component of name: "+name.getFirstName());
              System.out.println("2nd component of name: "+name.getLastName());
              return name;
    public String getAsString(FacesContext arg0, UIComponent arg1, Object name) {
              return name.toString();
    4. register NameConverter in faces-config.xml
    <converter>
    <converter-for-class>de.impire.javabean.Name</converter-for-class>     
    <converter-class>de.impire.converter.NameConverter</converter-class>
    </converter>
    5. Run the JSF page, from the console, I saw NameConverter is invoked, but the process aborted due to validation error.
    From cosole:
    [05.06.06 14:34:55:234 CEST] 18637864 SystemOut O 1st component of name: Markus
    [05.06.06 14:34:55:234 CEST] 18637864 SystemOut O 2nd component of name: Sonnberg
    On the JSF page, I got :
    Validation error: the value is not valid.
    Some ideas?

    Could it be that the code doesn't find any value in ZCURR_PM_T table for the specified input region?

  • SHOW h:message giving problem

    Hi every body ,
    I am facing one peculiar problem in my App.
    I am validating some textfields , radiobuttons , checkboxes by JSF (I am using JSF 1.1) simple validation (by required "true") and showing message by h:message .But when I am pressing the SUBMIT button it will validation only radiobuttons , it is not validatinf text fields or checkboxes , after I click the radio button & again click the SUBMIT button then only it is validating other fields like text fields / check boxes .
    So suppose I am submitting empty from with out click any thing , then JSF showing only the radio button's message , it is not showing all other fields.When I click only the radio button (with out click check box / filling nothing in the text field )& press the SUBMIT button then it is showing all error message in the view page .
    Could any body explain me why it is happing ?
    ** I am validating all fields in the SUBMIT button click by this way :
    in the required field I am giving :
    required="#{ not empty param['form:submit'] } here SUBMIT button's ID is submit.
    Thanks
    S

    Ok, that's what happens, but the idea was that the "test" appear at the second line. Think about that, and if the "test" was a label for another textbox? So The label would appear at the first line and its textbox at the second line. We can't configure the panelgrid for 2 columns, because we need a column for the h:message.
    Try out this code:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1">
    <af:form id="f1">
    <h:panelGrid columns="3" border="0" cellpadding="5" cellspacing="3" headerClass="login-heading">
    <h:outputLabel for="userNameInput">
    <h:outputText value="Enter your user name:"/>
    </h:outputLabel>
    <h:inputText id="userNameInput" size="20" maxlength="30" required="true">
    <f:validateLength minimum="5" maximum="30"/>
    </h:inputText>
    <h:message for="userNameInput"/>
    <h:outputLabel for="passwordInput">
    <h:outputText value="Enter your user password:"/>
    </h:outputLabel>
    <h:inputText id="passwordInput" size="20" maxlength="30" required="true">
    <f:validateLength minimum="5" maximum="30"/>
    </h:inputText>
    <h:message for="passwordInput"/>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>

Maybe you are looking for

  • Reservation of stock at Storage Type level in Warehouse

    Hi Gurus, My client is currently using ORACLE ERP system and they are migrating to SAP. In ORACLE there is a flexibility wherein reservation can be activated for warehouse stock. However, in SAP we are mapping the multiple warehouses present in ORACL

  • Last Closed Fiscal Period

    Hi All How can I identify the Last Closed Fiscal Period in a query variable ? eg. The current calendar month is Feb which is Fiscal period 11 (Variant is Z3). However Finance still have January open so they want to report YTD figures up to and includ

  • Sapscript Issue . Same line appears in all the line

    Hi All , By using the logic below , i am able to find the 4 diffrenet line item in my window . Now i am getting the same line in all the lines in sapscript. Pls suggest , how to avoid this . In  my final table it_excdtl , all diffrent line item are s

  • Why are the File Symbols of miniscule size?

    If I control-click and select Show layout alternative (this may be an erronous retranslation from Swedish back to English: hope you can understand me anyhow) I find a screen for e g the Desktop showing various alternatives (Symbol size, space between

  • UC540 FXS port "CCA Hangs"

    Dear all, The port needs to be a user phone I need to be able to set it up in a hunt group etc When I go to users and extensions / users and phones the operation in progress sits there endlessly with operation in progress. The end result I need is an