3 Replies Latest reply on Mar 20, 2007 8:19 AM by Fady Matar

    Validation Error

    Fady Matar Novice

      Can I use a validator on the EJB 3.0 for example @Length(max=16) without using the @NotNull validator?

      This must only check when data is available but for certain reasons it's not working unless I add the @NotNull validator as well.
      Can anybody assist in this?

        • 1. Re: Validation Error
          Wayne Bagguley Newbie

          Seems to work fine for me. Why not supply a bit of code we can look at?

          • 2. Re: Validation Error
            Fady Matar Novice

            I have incorporated the TinyMCE rich text editor in my template and it looks as follows:

            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
            <html xmlns="http://www.w3.org/1999/xhtml"
             xmlns:ui="http://java.sun.com/jsf/facelets"
             xmlns:h="http://java.sun.com/jsf/html"
             xmlns:f="http://java.sun.com/jsf/core"
             xmlns:s="http://jboss.com/products/seam/taglib">
             <head>
             <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
             <title>Admininstration</title>
             <link href="../stylesheet/admin-style.css" rel="stylesheet" type="text/css" />
             <script language="javascript" type="text/javascript" src="../javascript/tiny_mce/tiny_mce.js"></script>
             <script language="javascript" type="text/javascript">
             tinyMCE.init({
             mode : "textareas",
             theme : "advanced",
             plugins : "devkit,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
             theme_advanced_buttons1_add_before : "save,newdocument,separator",
             theme_advanced_buttons1_add : "fontselect,fontsizeselect",
             theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,separator,forecolor,backcolor",
             theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,separator,search,replace,separator",
             theme_advanced_buttons3_add_before : "tablecontrols,separator",
             theme_advanced_buttons3_add : "emotions,iespell,media,advhr,separator,print,separator,ltr,rtl,separator,fullscreen",
             theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,|,code",
             theme_advanced_toolbar_location : "top",
             theme_advanced_toolbar_align : "left",
             theme_advanced_path_location : "bottom",
             plugin_insertdate_dateFormat : "%Y-%m-%d",
             plugin_insertdate_timeFormat : "%H:%M:%S",
             extended_valid_elements : "hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
             theme_advanced_resize_horizontal : false,
             theme_advanced_resizing : true,
             nonbreaking_force_tab : true,
             apply_source_formatting : true,
             });
             </script>
             </head>
             <body>
             <div class="header">
             <h1>safami website - administration interface</h1>
             </div>
             <ui:include src="menu.xhtml"/>
             <ui:include src="loginout.xhtml"/>
             <div class="body">
             <f:facet name="aroundInvalidField">
             <s:span styleClass="errors"/>
             </f:facet>
             <f:facet name="afterInvalidField">
             <s:span>&#160;<s:message/></s:span>
             </f:facet>
             <ui:insert name="body"/>
             </div>
             <ui:include src="footer.xhtml" />
             </body>
            </html>
            
            


            Please note that the TinyMCE editor is appearing and looks perfect however it doesn't save the data.

            • 3. Re: Validation Error
              Fady Matar Novice

              I apologize wrong post, never mind the regular expression I used was wrong.