JSC2 - Disgusting backing beans question

After manually writing jsf code for about a year I've started considering switching over to Creator 2. I am in love with the UI components and quick drag drop page creation, but I absolutely hate the backing beans that are generated. Is there a way to use only my own and get rid of all those messy bindings that are created for each component? Any help on this subject would be endlessly appreciated.
Thank you for your time,
- Daniel

Hi Daniel,
The backing bean is an integral part of the webapplication created in Creator. Could you please tell us what is the problem you are facing with the backing bean? What do you mean by only your way? Could you please elaborate.
Cheers
Giri

Similar Messages

  • JSF Backing bean / JSP interaction questions

    A few questions about JSF beans and JSP page interactions. Bear in mind that I'm new to both JSP and JSF, so a solution that might be obvious to the rest of the world may be new to me.
    1. Can I pass a parameter to the backing bean method from an "action" attribute:
    <h:commandLink action="#{TableData.SortRec}">
    <h:outputText value="#{msgs.selectedHeader}"/>
    </h:commandLink>
    I'd like to call the same method from several controls, but pass it a parameter to determine which field to sort on.
    2) Is there a way for a backing bean method to determine which control invoked it?
    3) Is there a way to access JSF backing bean methods from JSP tags. I'd like to do some conditional page assembly based on a JSF bean property... JSF doesn't appear to have a conditional like JSP's <c:if>, but I could use JSP's if it could access the JSF bean.

    Could you pl tell me how to pass parameter thru CommandButton
    I have the following situation
    1) greetingList.faces which list the Ids & greeting Text
    Id Text
    1 Hello World
    2 Hello World
    2) Pl note Ids are h:commandLink. A click on the Id will render greetingForm.faces with data pertaining to that Id and with Update h:CommandButton
    3) When i click Update button it results in the following error
    javax.faces.FacesException: Error calling action method of component with id greetingForm:_id4
    Caused by: javax.faces.el.EvaluationException: Exception while invoking expression #{greetingForm.update}
    Caused by: java.lang.NullPointerException
    So i verified with h:message that Id is passed as Null when click on Update button. I also checked greetingForm.faces has a not null value by printing <h:outputText value="#{greetingForm.message.id}"/>
    So i guess the Id value is overwriteen with null. Also i have defined Id as property in managed bean
    <managed-bean-name>greetingForm</managed-bean-name>
    <managed-bean-class>com.mycompany.GreetingForm</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    <managed-property>
    <property-name>id</property-name>
    <value>#{param.id}</value>
    </managed-property>
    Any pointers/suggestions at the earliest on how to pass the value of Id on a click of update button from greetingForm.faces to greetingForm.java will be highly appreciated
    I am willing to upload my war file
    Regards
    Bansi

  • ADF Question: call javascript function from backing bean?

    Hi all,
    I am running JDeveloper 10.1.3.3 with ADF BC.
    Heres my situation:
    I have a table, and after inserting a new row, then committing, I want to call a javascript function. I tried using the onkeyup javascript to force a click of the save button, and then call my function after that. However, I really only want the second function to be called AFTER the commit has occurred.
    I have tried putting a setTimeout on the second function, but this never executes then. Is there some way that I can call the second javascript function from the backing bean? Is there a better workaround for this? Here is some code:
            function submitCreate(e) {
                var _event = (window.event) ? event : e;
                var KeyID = _event.keyCode;
                switch (KeyID)
                    case 13:
                        document.getElementById("form1:tvoTable:commitButton").onclick();
                        doAjax();
                        break;
            function doAjax() {
                var item = document.getElementById("form1:inputText3").innerHTML;
                getAjax(item, "FULL");
            }Thanks,
    Heather

    Maybe try adding an af:script block in your jsp as a partial target in your backing bean when you commit to the database? We are doing something similar when we get a tab DisclosureEvent but the principle should be the same.
    In our jsp we have:
    <af:script id="scriptID" text="alert('javascript here');"/>
    In the backing bean we have:
    method(DisclosureEvent de) {
    // get a component somehow or the component, we get it from the disclosure event
    // but you could use a binding also. if you don't have the exact script element you need
    // to find it like we do below.
    UIComponent c = de.getComponent();
    // Find our real script component
    UIComponent target = c.findComponent(":scriptID");
    // get the adf context
    AdfFacesContext adfContext = AdfFacesContext.getCurrentInstance();
    // add the script as a partial target.
    if(target != null) {
    adfContext.addPartialTarget(target);
    This relies on PPR though, which you may not be doing. If you are navigating to a new page you could set an indication in a backing bean and then access that in an <af:script> block in the new page or even generate the Javascript you want depending on your logic and access all of it via an EL binding on the af:script tag:
    <af:script id="scriptID" text="#{bbean.generatedScript}"/>
    Hope this helps!
    Steve

  • Backing bean usage question

    Hi guys,
    I'm quite new to JSF, and I was wondering wether this is the correct way to use a backing bean.
    I got a page, with two inputText boxes, 'name' and 'age'. When I submit that page, some simple validation is invoked and the page will call the submit() function in the backing bean.
    In the submit function, I want to get the values that are stored in the request scope, and that is where I'm not sure what to do...
    Should I just call 'this.getName()' and 'this.getAge()' ? It feels not right to me for some reason; I'm used to messing around in the request maps for those values and I was wondering if I should use the facesContext instead ? Either way seems to work, but I just want to use JSF the way it was ment to be used :-)
    Thanks lots!

    Hi, thanks for your reply
    So basically you mean that I have a regular bean (the VO) which I instantiate in the managed bean, after I press the submit button ?
    E.g.
    Submit() -> get values from facesContext -> create VO with those values ?
    Just asking because right now I have the properties that I want to have inside my managed bean. You suggest I should separate these properties in their own bean ?
    Thanks :-)
    Message was edited by:
    Ophyr

  • How to call a query from the backing bean ?

    Hi all,
    Another question for you guys :
    I made a jspx page with an input form and a submit button.
    When I click the submit button, the action my_action in my backing bean is executed.
    This is the code :
    public BindingContainer getBindings() {
    return BindingContext.getCurrent().getCurrentBindingsEntry();
    public String my_action() {
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("EmployeesView");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    I hoped that the query 'EmployeesView' was executed in this way, but I get the following exception :
    java.lang.ClassCastException: oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding cannot be cast to oracle.binding.OperationBinding
    So how should I execute the query EmployeesView ?
    Second part of the question : What if I typed the name an employee in my form, and I want to
    execute a query that selects all the Employees with that name ?
    How do I make a query with a variable as input in the WHERE clause ?
    Thanks in advance.
    Edited by: Facehugger on 7-apr-2010 11:15

    I'm still trying all the stuff you guys says, but still no result.
    This is my backing bean :
    +// the button action+
    +public String my_action()  {+ 
    +// get the selected rows from the multiselect table and store the objectid's in an String array+
    RowKeySet rks = graph_table.getSelectedRowKeys();
    Iterator itr = rks.iterator();
    Object key;
    int nbr_objects = 0 , i = 0;
    if (rks.size()>0)  nbr_objects = rks.size();
    +String[] objectid = new String[nbr_objects];+
    while(itr.hasNext())
    +{+
    key = itr.next();
    graph_table.setRowKey(key);
    Object o = graph_table.getRowData();
    JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding) o;
    Row row = rowData.getRow();
    +objectid[i] = row.getAttribute("Objectid").toString();+
    i+;+
    +}+
    +// now get all the x and y values for these objectid's from the database out of the table history.+
    BindingContainer bc = BindingContext.getCurrent().getCurrentBindingsEntry();
    for (int j=0 ; j<nbr_objects; j+){+
    +// get X and Y values for object number j+
    DataPoints history = new DataPoints();
    OperationBinding operationBinding = bc.getOperationBinding("retrieveHistory");   ===> operationBinding stays NULL ???+
    +operationBinding.getParamsMap().put("OBJECTID", objectid[j]);+
    Object retVal = operationBinding.execute();
    +// ==> retVal should contain a List of all X and Y values for the provided objectid.+
    +// while (retVal has values)+
    +// {+
    +// List_of_x_values.add(retVal.valueX);+
    +// List_of_y_values.add(retVal.valueY);+
    +// }+
    history.add(List_of_x_values);
    history.add(List_of_y_values):
    +// call the soap method to do some calculations+
    methodname.forecast(history);
    +}+
    +}+
    In my application module :
    public void retrieveHistory(String objectid) {
    getHistory().setWhereClause("OBJECTID = '" + objectid + "'");
    System.out.println("current query : "+getHistory().getQuery());
    getHistory().executeQuery();
    public ViewObjectImpl getHistory() {+
    return (ViewObjectImpl)findViewObject("History");+
    The query for the VO History : SELECT * FROM HISTORY
    Please anyone ?
    Edited by: Facehugger on 9-apr-2010 14:19

  • Is there any way to create backing bean, After page gets created?

    Hi
    Any one can please answer to my quick question !!!
    Is there any way to create the backing bean ,after a jsf page gets created using ADF ..?
    When i first time created the jsf jppx page i unchecked the option to generate backing bean, but later some time I would like to have backing bean for the newly created page. so is there any way to create backing bean ...?
    Thanks in Advance

    Have your page in the visual design mode then go to the Design->Page Properties menu and you'll be able to select auto-bind on the second tab.

  • How to get selected items from a tree in backing bean without adfbc

    Hi ADF Experts,
    Below is my code for af:tree. My question is how can I get selected Items from the selectionListener (without adf bc) this uses formation of tree from backing bean.
    Using Jdev 11.1.1.7.0
    <af:tree var="node" value="#{pageFlowScope.MerchandizeBean.model}"
                      binding="#{pageFlowScope.MerchandizeBean.treeModel}"     id="tree" immediate="true" autoHeightRows="0"
                           styleClass="AFStretchWidth" rowSelection="multiple"
                           selectionListener="#{pageFlowScope.MerchandizeBean.treeNodeSelection}">
                    <f:facet name="nodeStamp">
                      <af:commandLink text="#{node.classDescription}"
                           actionListener="#{pageFlowScope.MerchandizeBean.createListManyItemForMerchandise}"           id="displayTable" partialSubmit="true">
                      </af:commandLink>
                    </f:facet>
                  </af:tree>
        public void treeNodeSelection(SelectionEvent selectionEvent) {
            // Add event code here...
            RichTree tree = (RichTree)selectionEvent.getSource();
                    TreeModel model = (TreeModel)tree.getValue();
                    //get selected value
    Thanks
    Roy

    Hi,
    in a multi select case, try
    RowKeySet rks = tree.getSelectedRowKeys();
    Iterator iter = rks.iterator();
    while(iterator.hasNext()){
    Object aKey = iterator.next();
    tree. setRowKey(aKey);
    Object rowData ? tree.getRowData();
      .... do something with the data here ...
    Frank

  • How to call a method in backing bean on hitting 'Enter' key on a page.

    Hi all,
    I would be obliged if any one can provide me solution for the below given problem.
    My requirement is to call a method in backing bean when i hit 'Enter' key on a JSP page.
    I am trying this by using a script given below.
    *function fnChangeFocus(){*
    *if(window.event.keyCode==13){*
    * document.getElementById("mainform:submitForm:commandbutton").focus();*
    The JSP has the textbox as given below.
    *<h:inputText id="inputtxtboxid" disabled="false" value="#{Bean.inputvalue}"*
    onkeypress="fnChangeFocus()" size="24" />
    Using this I could not acheive the required functionality. Please suggest some alternative.
    Thanks,
    Jagadeesh Pala

    Only a form element supports the submit() function. Make sure that the getElementById returns the appropriate form. Or rather pass the element as the 'this' reference to the function and get the parent form from it.
    After all this is just basic DHTML / Javascript+DOM knowledge and in fact this has nothing to do with JSF. For future basic DHTML / JS+DOM questions you may take a look at the appropriate forums, e.g. dhtmlcentral.com, dynamicdrive.com, etcetera.

  • Problem in sending variable to backing bean

    I want to send the data selected by the user that retrieved from the database to the backing bean. I have two questions. First, I don't know why the variable irl, irw, ird cannot display in the inputbox. Second, when the user click the commandbutton, it will throw NullPointerException. Please help. Thanks.
    Code of the JSF
                     <sql:query sql = "SELECT PLI_ITEM_NO,PLI_RD_CODE,PLI_TRNH_LEN,PLI_TRNH_WID,PLI_TRNH_DEP FROM PLI_PLAN_ITEM WHERE PLI_PLAN_ID = ${pid} AND PLI_ITEM_NO = ${iid}" var = "itemresult" dataSource="${db}">
                     </sql:query>
                     <table id="ro-item" cellspacing="0" cellpadding="3" border="0">
                          <c:forEach var="itemrow" items="${itemresult.rows}">
                               <c:set var="irl" value="${itemrow.PLI_TRNH_LEN}"/>
                               <c:set var="irw" value="${itemrow.PLI_TRNH_WID}"/>
                               <c:set var="ird" value="${itemrow.PLI_TRNH_DEP}"/>
                               <tr>
                                    <td>Road Category:</td>
                                    <td></td>
                               </tr>
                               <tr>
                                    <td>Length:</td>
                                    <td>
                                         <h:inputText id="itemlength" value="#{irl}" size="6"></h:inputText>m
                                    </td>
                               </tr>
                               <tr>
                                    <td>Width:</td>
                                    <td>
                                         <h:inputText id="itemwidth" value="#{irw}" size="6"></h:inputText>m
                                    </td>
                               </tr>
                               <tr>
                                    <td>Depth:</td>
                                    <td>
                                         <h:inputText id="itemdepth" value="#{ird}" size="6"></h:inputText>m
                                    </td>
                               </tr>
                          </c:forEach>     
                     </table>
                   <c:if test="${irl==null}"><c:set var="irl" value=""/></c:if>
                     <c:out value="${irl}"/>
                  <h:commandButton id="submit" value="Submit" actionListener="#{planBean.action}">
                      <f:attribute name="attributeName1" value="#{irl}" />
                  </h:commandButton>Code of the backing bean
    public class PlanBean {
        public void action(ActionEvent event) {
            String attributeName1 = FacesUtil.getActionAttribute(event, "attributeName1");
            System.out.println("attributeName1: " + attributeName1);
    }

    Its never advisable to use JSTL and JSF together
    not sure ... but if i were at ur place .. i will never use <c:forEach> and <c:if> etc with JSF
    There are a number of reasons:
    1. Using JSTL actions and JSF actions means using both JSP EL expressions and JSF EL expressions.
    Because of the subtle differences between these two expression types, it's not always obvious what's going on.
    For instance, all variables in a JSP EL expression must refer to existing beans, while beans for variables in a JSF
    value binding expression are created automatically if they don't exist. Another difference is that a JSF EL expression can't access page scope variables.
    2. When you use <c:if> to conditionally include or exclude a JSF action, the corresponding component is physically added
    or removed from the view's component tree. This can lead to strange effects because the component loses its state when
    its removed from the view.
    3. The <c:if> action and the type of conditions used in the EL expressions represent application logic,
    and it's better kept out of the template altogether.
    Intead why r u not using JSF table ...?
    the reason for null pointer may be u are declaring variable in JSTL and using as a parameter as attribute for JSF component
    try using JSF table ... things shud get resolved ...
    [http://myfaces.apache.org/trinidad/devguide/table.html|http://myfaces.apache.org/trinidad/devguide/table.html]
    [http://lavnish.blogspot.com/2007/12/all-about-adf-tables.html|http://lavnish.blogspot.com/2007/12/all-about-adf-tables.html]

  • Best practice for backing bean population? (also, ActionListener RANT)

    Hello,
    I am about 3/4 of the way through development of a small to medium size JSF application. Sometimes I really like JSF, but much of the time I am left puzzled or frustrated for hours trying to find workarounds to JSF's bugs/glitches and design flaws.
    For example, early on, I was impressed with how easily it was to invoke a method from a page using an actionlistener. Now that I'm actually building things with JSF, the actionlistener funtionality still seems cool, but incredibly half baked. I find myself using request parameters LIKE CRAZY to work around the fact that JSF doesnt support passing parameters directly to backing bean methods. This feels awkward and wrong considering the fact that JSF is intended to abstract the HTTP underpinnings. To add insult to injury, I often have to iterate through ALL of the request parameters looking for one that has an id with an ending matching my desired property name (since JSF appends it's own crap to the beginning). I don't like doing things in a hacky way. This seems very hacky, and I feel dirty doing it.
    So, my first question is, what is the best practice for populating backing beans??? How do others accomplish this. I can think of several other approaches, but none feel less hacky.
    Second, are there plans in the next spec (please say there are) to allow parameters to be passed to backing bean methods? If not, WHY THE HECK NOT?
    Even though JSF expert group people have been conspicuously absent from this forum of late, I'd really appreciate responses from you as well.
    Thank you for your thoughts.

    Hi BrownBear,
    I've been using JSF for about 6 months now and I'd be glade to help as much as I can.
    Concerning parameters, I'm not sure what your issue is but I use the f:param tag to pass them. If you could post an example of what you are trying to do, I could see exactly what your issue is. Maybe the f:param can't help you.
    As for best practice for populating backing beans, I personaly try to let JSF do as much as possible. For example, if I have a backing bean with five properties, I make sure that they all are on the JSP page the bean serves. If one of the property is just there as an Id like, lets say, a Person ID (DB row key), then I put it on my JSP page as a hidden input field. I do the same with the properties that only for display, if I want them to be back in my bean when request comesback.
    Hope this help some how. Please, feel free to ask specific questions related to your specific problem and I monitor this post and trnasfer to you the ;little JSF experience I have.
    I'm pretty happy with JSF as it is but it sure needs improvements. :) What the heck, it's version 1.01 after all, and the next release should be a great one with the integration of JSTL.
    Cheers

  • How to get specific rows from the vo or Iterator in the backing bean?

    Hi,
    I have to get the specific number of rows from iterator in the backing bean. means i want to get the records from the VO or Iterator only from 5 th record to 10th record its like rownum in SQL.
    We can use rownum in VO sql query. but there would be a performance issue with that ...
    SO i am trying to get the rows from ADF Iterator once we fetch from DB.
    Is it possible to do that ?
    Do we have any way to set the pointer to the VO/Iterator like setFirst() and after that setMaxResult to retrun the rows between first and maxresult..
    Thanks

    If this is for pagination, then af:table offers pagination by design when you set accessmode=RangePaging or RangePagingIncremental in VO. Paginated queries are fired when scroll down in the table. Explore this option before you try out any custom solution
    To answer the question,
    Note: same logic i have implpemented ADF with EJB ..In EJB Query class we have setFirst(int) and setMaxResult(int) methods...simply i did setFirst(30) and setMaxResult(10)..It worked fine...Theoretically speaking the same can be achieved by setting setRangeStart() on the viewobject(which in turn sets to the default rowset) and by setting max fetch size on VO + accessmode=RangePaging. However when you use table with ADF binding, these will be overridden by the binding layer. If you are not using ADF binding, then the above is same as what you did for JPA entity. Other option is, you build expert mode VO with rownum for this special case, which will work if you dont need to set accessmode=RangePaging for VO.

  • How to show popup from backing bean code immediately?

    Hi,
    I'm using JDeveloper 11.1.2.1.0 and have problems with showing popups. I have a button with an action on my page and a method in backing bean.
    I want to rise up few popups from this method in backing bean (for example just an anouncement that something will happen) or a dialog
    (for example a question if you want to continue).
    I understand how to get a dialog response to deal with it in code, but the problem is that the popup doesn't show up immediately, but only when
    this method called on button finishes. I'd like to handle dialog responses in the middle of the action and then the code to continue with the execution.
    Here is my backing bean code:
    private RichPopup popup;
    public String test() {
    //Some code...
    RichPopup.PopupHints hints = new RichPopup.PopupHints();
    popup.show(hints);
    //Here is the place for code which I want to be executed after popup closes,
    //but is executed before the popup shows...
    return null;
    And here is part of my jssf:
    <af:commandButton text="Test" id="cb1"
    action="#{popupBean.test}"/>
    <af:popup id="popup" binding="#{popupBean.popup}">
    <af:dialog id="dialog" type="yesNo"
    title="Dialog"
    dialogListener="#{popupBean.onDialogAction}"
    binding="#{popupBean.dialog}" clientComponent="true">
    <af:outputText value="Do you want to continue?" id="ot1"/>
    <af:clientListener method="onDialogCancel" type="dialog"/>
    <af:serverListener type="DialogCancelHandlerEvent" method="#{popupBean.onDialogCancel}"/>
    </af:dialog>
    </af:popup>
    Can someone give me some answer how to show the popup from backing bean code immediately?
    Thanks in advance,
    Tina

    If you want to execute code after popup closes, then put this code in PopupCanceledListener or in DialogListener(you can't block method execution).
    Dario

  • Dynamic backing bean

    Hello
    Someone can help me with the following issue?
    Im working on an application that creates jsf pages based on user input. Its a tool where one user should build a questionnaire and another user has to ansewer it.
    The component creation based on user(quetionnaire builder) input is working has well, but i dont have any idea how to store the inputs from the user that has to ansewer the questionnaire.
    I need a way to dynamic generate a backing bean and create a valueBind with all UIInput Components, forcing the bean to store the ansewers in a collection.
    Someone know how may i do this?
    Maybe a hashMap in a backingBean solve my problem, but i dont know how to bind all components with the map... how to make my jsfComponents add their own key and value in a map?
    Thanks, and sorry for my poor english.
    Ferryman

    Using a map to hold generated inputs is something I've used before and it works. I had a set of different classes that all knew how to create the JSF to add themselves to the form. When they added themselves, they bound the value to the map attribute using the name as specified on the constructor. The objects also know how to get the value out of the map. So during construction of the input form you loop through all these objects and tell them to add themselves to the input form, and then to get the values back you loop through the objects and ask them what the value is.
    Here's another suggestion: how about using an h:dataTable to display a List of "QuestionBean"s.
    Here's a sketch of what the code would look like:
    public class QuestionBean {
      private String prompt;
      private String input = "";
      public void setPrompt( String p ) {
      // getPrompt, setInput, getInput...
    public class QuestionsBean {
      String current_question_input;
      List questionList;
      public void getQuestionList() {
        return question_list;
      public void setCurrentQuestionInput( String qi ) {
        current_question_input = qi;
      public void addQuestion( ActionEvent e ) {
        QuestionBean qb = new Questionbean():
        qb.setPrompt( current_question_prompt );
         questionList.add( qb );
    <h:dataTable value="#{questions.questionList}" var="var_question">
      <h:column>
        <h:outputText value="#{var_question.prompt}"  />
      </h:column>
      <h:column>
        <h:inputText value="#{var_question.input}" />
      </h:column>
    </h:dataTable>

  • Target Servlet in page from backing bean.

    Hi,
    How do I render a servlet in a page from a backing bean instead of a new page as it currently doing.
    the backing bean consists of...
    String url = "/ScriptOutputServlet?docNum=" + command;
            blog.debug("URL = " + url);
            FacesContext ctxt = FacesContext.getCurrentInstance();
            try
                ctxt.getExternalContext().dispatch(url);
            }catch(Exception e)
                e.printStackTrace();
            }finally{
                ctxt.responseComplete();
            }I suppose my question is how do I add a target into the URL to render back into a frame on the original page for example?
    Thanks in advance

    First off, let me thank you for all your replies, your help is much appreciated.
    What I'm trying to achieve is for the user to be able to click a command link which is a shell script and have the stdout of the script returned to the same page. Please let me know what info/code you need.
    From the jsf page...
    <h:commandLink action="#{executeBean.executeScript}" immediate="true" styleClass="#{t.nodeSelected ? 'documentSelected':'document'}" actionListener="#{t.setNodeSelected}" >
                                                <t:graphicImage value="../images/document.png" border="0"/>
                                                <h:outputText value="#{node.description}"/>
                                                <f:param name="docNum" value="#{node.description}"/>
                                            </h:commandLink>
                                        </h:panelGroup>
                                    </f:facet>
                                </t:tree2>
                                <jsp:include page="/ScriptOutputServlet" />
    public void doExecute(String command)
            String url = "/faces/private/main.jsp?docNum=" + command;
            blog.debug("URL = " + url);
            FacesContext ctxt = FacesContext.getCurrentInstance();
            try
                ctxt.getExternalContext().redirect(url);
            }catch(Exception e)
                e.printStackTrace();
            }finally{
                ctxt.responseComplete();
            }I'm hoping I'm making some more sense...
    Many thanks again,
    nick
    Edited by: nickbeenham on Dec 26, 2007 9:38 AM

  • JSF 1.0 Final - no backing bean validation of empty imputs

    Hi,
    I have simple inputText with validator in backing bean :
    <h:inputText id="layName" maxlength="30" value="#{shp.layerName}" validator="#{shp.validate}"/>
    and validator is executed properly when inputText isn't empty, but when is empty it isn't !.
    In my opinion validator should be executed in every reason, so I wonder if it is a bug ?
    I know that I can set required attribute to "true" and have additional validation of empty values :
    <h:inputText required="true" id="layName" maxlength="30" value="#{shp.layerName}" validator="#{shp.validate}"/>
    <h:message id="errors1" for="layName"/>
    but in this case I will receive standard error message. So my second question is how to overwrite this message with localized massage if backing bean validator isn't executed ?
    Thanks in advance.
    Olek

    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)

Maybe you are looking for

  • Media Encoder CC R3D GPU Debayer?

    Does anyone know if the new PrP CC update of added GPU acceleration support for debayering R3D material will also be added into Media Encoder CC, to aid in exporting quicker and not relying only on the CPU?

  • Are third party Microphones compatible?

    I noticed the Nano has an integrated voice recording app, which is quite excellent. Will I be able to plug in third party 3.5mm microphones (Such as the Sony ECM-DS70P or similar) into the nano for recording purposes? It'd be really nice if this new

  • Lookout 6.7 or 6.7.1 and VPN Connections

    I am having difficulty after upgrading to Lookout 6.7 and 6.7.1 from 6.1 with a client process that is receiving its data from a Lookout server across a VPN. Two different VPNs have been tested and multiple computers running various versions of the c

  • Text_io from webforms

    Is it possible to write to a file with text_io from a webform? I can imagine it's possible to the webserver, but can I also write to a file on the "client-machine"?

  • Acquisition de mesures de déplacement

    Bonjour,  je suis débutant dans ce domaine. Pour un projet, je dois faire l'acquisition de mesure de déplacement et la visualiser avec labview. Pour mesurer mon déplacement induit par un défaut , je souhaite utiliser le capteur TWK MPE , avec une sor