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)

Similar Messages

  • Cant multiple JSF Forms post to same Backing Bean?

    Wondering why cant i have two jsf forms (for example : Create & Update jsf form) post to same backing bean using value binding technique

    I have one more question
    Cant i have single JSF form post to multiple backing beans even this doesnt work for me
    Please not backing bean is in session scope in both the cases

  • Backing Bean Validation Method error

    Hi all,
    I've an ADF JSF User Registration Form and I want to set my server-side validation to confirm passwords entered by the user using the validator attribute bound to customized validation logic sitting in a method my backing bean. I've tried quite a few cracks at this but I still seem to get a java.lang.NullPointerException error when the method is invoked.
    The relevant method in my Backing Bean looks like this:
    public void comparePassword(FacesContext facesContext, UIComponent uiComponent, Object newValue) {
    //Get the new value that is passed passed from the Confirm Password field
    String confirmPassword = (String)newValue;
    //Get the password that has already been entered
    String password = (String)getLoginPasswordText().getValue();
    //Compare passwords and raise validation error message
    if (!password.equals(confirmPassword)){
    throw new ValidatorException(new FacesMessage
    (FacesMessage.SEVERITY_ERROR,
    "Passwords need to be the same",
    "Password values should be the same"));
    The getters and setters for the components are also in the bean and the gettLoginPasswordText() returns the original password input text field (the one that I want to compare it to).
    Is there something that I've missed here?
    Cheers

    Thanks Frank.
    I now understand a bit more about value binding. But unfortunately I need a little more help (from anyone) on this one. I've tried quite a few things and I think the problem stems from the fact that the validation code doesn't seem to pickup the value entered in the comparison field - at least in the way that I've coded it. Here's a more complete example of what I'm trying to overcome:
    I've got two input text components:
    <af:inputText required="true" simple="true"
    id="loginPasswordText"
    immediate="true"
    value="#{backing_UserRegistration.password1}">
    </af:inputText>
    <af:inputText required="true" simple="true"
    id="loginConfirmPasswordText"
    immediate="true"
    validator="#{backing_UserRegistration.comparePassword}"
    value="#{backing_UserRegistration.password2}">
    </af:inputText>
    I've setup the relevant accessors as in the following:
    String password1 = "";
    public String getPassword1(){
    return password1;
    String password2 = "";
    public String getPassword2(){
    return password2;
    And my validation now code looks like this:
    public void comparePassword(FacesContext context, UIComponent toValidate, Object value) {
    if (!Password2.equals(Password1)) {
    FacesMessage msg = new FacesMessage("summary message", " detailed message");
    msg.setSeverity(FacesMessage.SEVERITY_INFO);
    ValidatorException e = new ValidatorException(msg);
    throw e;
    I've tested the validation code on a standalone basis ie passing in a new variable as part of the method ie.
    String word = (String) value;
    if (word.equals("tom"))....
    The validator and message fires OK, so I know the problem lies with picking up the entered values for password1 and password2. I know the values are there because I can "see" them on screen and they are recognized by standalone validators and the bean has a session scope.
    Ideas anyone?
    Thanks

  • JSF EL: referencing programmatically generated backing beans

    Hi all,
    I create backing beans in Java code using the ValueBinding class:
    for(Question q : questions){
      ValueBinding vb = FacesUtilities.createValueBinding("#{requestScope.questionBean" + question.getId() + "}");
      vb.setValue(FacesContext.getCurrentInstance(), new QuestionBean(question));
    }No problem so far, but how can I reference these backing beans dynamically using the JSF EL?
    <c:forEach var="question" items="#{questionListBean.questions}">
      <h:outputText value="#{#{requestScope.questionBean}#{question.id}.type}"/>
      <h:outputText value="#{requestScope.questionBean#{question.id}.type}"/>
    </c:forEach>None of them seem to work because nesting expressions is not an option. Anybody got a clue?
    Thanks in advance!
    Kind regards,
    Dirk

    Make a List of QuestionBean objects and place that in the request scope instead.

  • Differences between servlet and backing bean

    Could anyone please tell me whether everywhere that servlet can be used, backing bean and JSF can be used too? Are JSF and backing beans the new alternatives for JSP and servlets? please clarify the relations between these concepts for me.
    Thanks
    Laura

    Laura_Jlover wrote:
    Thank you. You mean backing beans can do every thing that servlets can do? Yes.
    JSF pages can work with servlets? Strictly speaking, every JSF page gets passed through the FacesServlet which does all the task. The lifecycle, creating the FacesContext, putting the request parameters in backing beans, rendering the response, etcetera.
    what are the advantages of servlet and the advantages of backing beans? what's the disadvantages? In general, which one is better?In context of JSF, you should be using backing beans, not Servlets. There is nothing what a Servlet can offer you as an advantage in the JSF context. It is simply not an option/alternative. You can't even call a Servlet (directly) using a JSF h:form. You, however, can access backing beans in any JSP or Servlet outside the JSF context.
    Just carefully read the JSF specification or buy a JSF book and the picture will be clear.
    JSF spec: [http://jcp.org/aboutJava/communityprocess/final/jsr252/index.html].
    JSF book: [http://www.amazon.com/JavaServer-Faces-Complete-Reference/dp/0072262400].

  • Calling init() method from "session scope" backing beans (AbstractPageBean)

    hi,
    i prepared a jsp/jsf page named DBmanage, its backing bean's scope is set to "session"
    the page contains - among other components - one radiobuttongroup, the buttons of which i would like to rename at the first time when the user visits the page... (default names are "item 1", "item 2", "item 3")
    i thought that the overridden init() method does the work for me with this simple code:
    import com.sun.webui.jsf.model.Option
    @override
    init() {
    rbg_default_options.setOption( new Option[]{new Option("it1", "RB1"), new Option("it2", "RB2")}
    so, let see how this code works when DBmanage backing bean's scope is "request"
    great! i see a radiobuttongroup with two buttons, named RB1 and RB2
    ok, now i change the scope to "session"
    sh&#@t!!! now i'm gazing at a page with buttons named "item 1", "item 2", "item 3"
    let's place a breakpoint inside the init() method and DEBUG... and my init() code has not run(??), how can this happen? init() method is valid only for request beans?
    pls! could anyone help me?
    ps.: i work with netbeans6.0 & glassfish
    thanks
    Gabor

    it's ok. i found out why it wasn't working.
    my scope was set to "session", but had to be "request" so that i could use the params syntax.
    thanks anyway.

  • Shoul I have my backing beans extend my domain objects?

    Hi,
    In our JSF application, most of our backing beans have the same properties that a corresponding domain object.
    In order to have a clear separation between layers, we have a set of view objects and a separate set of domain objects. Once we populate the backing bean, we copy the value of properties to the domain object.
    Since all the properties of my domain object are duplicated in my backing beans, we were wondering if it is a good (or bad) idea to extend (inherit) my backing beans from my domain objects, and pass the backing beans to my persistence and business layers. This will save us some work.
    Thanks a lot for the advice.
    Mauricio L.

    I think I've solved my own issue though I'm not sure if it is the correct way to accomplish the task at hand.
    When the button for login is clicked and the logginButton_action() method is called inside of my login_jsp_backing class I do the following:
    User user = new User();
    FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("User", user);
    return user.doLogin(this.getInputUsername().getValue().toString(), this.getInputPassword().getValue().toString());
    (The String return of this method in User is a navigation rule I've setup in my faces-config)
    So my new question is that "Is this best practice?" or should I be doing it differently?
    Message was edited by:
    Steve Carlson

  • Serializing of backing beans

    I have the following backing bean:
    public class BackingBean {
       private UIData dataComp;
       public void setDataComp(UIData d) { dataComp = d; }
       public UIData getDataComp() { return dataComp; }
    }I use it in the JSP as such:
    <h:dataTable binding="#{BackingBean.dataComp}"...>
    </h:dataTable>The above code works fine when the state saving method is set to server. However, when I set the saving method to client, JSF tries to serialize my backing bean. Needless to say, I get serializable exceptions and my app doesn't work with client side state saving.
    For a variety of reasons I don't want my BackingBean to be Serializable. Any ideas on how to make my app work without my BackingBean having to implement Serializable?
    Thanks.

    ~ JSF should not be attempting to serialize your backing bean
    I was under the same impression myself. But my debugging so far suggests otherwise... Below is the stack trace (As you can see, the ViewHandlerImpl.renderView() method is trying to serialize the backing bean):
    javax.servlet.ServletException: Error while saving state in 'session': 'myPackage.MyBackingBean'.
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:471)
         at org.apache.jsp.map$jsp._jspService(map$jsp.java:984)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:683)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:431)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:355)
         at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:142)
         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 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
         at java.lang.Thread.run(Thread.java:536)

  • Need help with fillling backing bean w/info

    I am new to JSP and have some very basic questions regarding filling a JSF with data from the database and then allowing the user to edit and save the data back to the database.
    I am using JDeveloper 10.1.3 developer preview
    This is what I have so far (which may be suspect in itself):
    1. A method called DatabaseUtil.getProductApproval(productApprovalNbr) which creates and returns a ProductApprovalBean
    2. A JSF called search.jsp with backing bean Search.java.
    3. Another JSF called productApproval.jsp with backing bean ProductApproval.java
    4. Successful navigation defined from search.jsp to productApproval.jsp
    5. The backing bean Search.java has a SearchButton_action that returns success if productApprovalNbr specified is OK (edit currently hard-coded)
    6. The productApproval.jsp has a component called productApprovalNbr with binding to backing_search.productApprovalNbr
    This is want I want to do but don’t know how:
    1. Make a call to create the ProductApprovalBean and fill the productApproval.jsp backing bean with info from ProductApprovalBean before the productApproval.jsp is displayed to the user.
    2. Allow the user to change values and save them back to the db after clicking on the save command button.
    How do I wire this stuff up?
    Any advice will be greatly appreciated because I am stuck big time.
    Regards,
    Al Malin

    Thanks for the reply Brian.
    I’ve looked at directly binding to the ProductApprovalBean and that looks like a good approach to take in other cases but for the UI design I currently have I am not sure.
    Basically, the ProductApprovalBean is a master entity with several related detail entities. This is so because the user wants to see all of the related data on a single page instead of showing one page for a master, another for a detail, another for another detail, etc. So I am designing a JSF form that consists of multiple sections, each section presenting an entity. Each detail section would have its own command buttons for editing, adding, and deleting rows.
    Since my first post I have figured out how to fire an event in search.jsp and catch it in an event handler in the backing_bean. (This was great progress --- only took me 9 hours to write 6 lines of code. :-) From here I figured I could access the db and load up the fields for the first screen and do updates with the subsequent screens.
    After looking through the documentation, I not sure I’m up to the task. New problem, I don’t know the JSF classes well enough to load up the fields, and after they are loaded, how do I get the data out. (At first, JSF looked really slick but there has been a steep leaning curve associated with it, I'm real close to reverting to JSPs and servlets.)
    If I am on the wrong path and this approach is all wet, please say so.
    Regards,
    Al Malin

  • JSF Backing Bean State Being Lost Prior to Submit

    ISSUE
    I have an attribute in a backing bean for a drop-down list in a JSF that loses its state before I submit the page, which causes data updates to the backing bean dependent upon its state to be ignored.
    CONTEXT
    The JSF in question has a selectOneMenu drop-down list that determines whether or not several inputText fields will be rendered. The selectOneMenu is bound to an enum in the backing bean, and there are conditional accessors allowing the JSF to determine which inputTexts should be included in the current view. The three valid values of the drop-down are "ALL", "RANGE" and "SINGLE". The page is request scoped, a requirement of this project.
    Here is the JSF tag for the selectOneMenu drop-down list:
    <h:selectOneMenu disabled="#{not backingBean.newEntry}"
        id="tCriteria"
        value="#{backingBean.tCriteria}"
        onchange="submit()">
        <f:selectItems value="#{backingBean.possibleTCriteria}" />
    </h:selectOneMenu>And here are the RANGE selection-specific inputText controls:
    <h:inputText disabled="#{not backingBean.newEntry}"
        rendered="#{backingBean.tRange}"
        id="startTIndex"
        value="#{backingBean.tIndex}" />
    <h:inputText disabled="#{not backingBean.newEntry}"
        rendered="#{backingBean.tRange}"
        id="endTIndex"
        value="#{backingBean.endTIndex}" />Here is how I initialize the backing bean for the drop-down list attribute:
    * The current "t" criteria.
    private TCriteria tCriteria = TCriteria.ALL;And there are basic accessor/mutator methods for it. All of this works pretty well, with one problem. If I select "RANGE" in the drop-down, the appropriate inputText fields appear in the view. When I submit the page with values in the inputText fields, the value of the drop-down in the backing bean has been reset to its default initial value ("ALL") without having been updated through its mutator. Thus, when values in the backing bean are updated from the JSF, the conditional inputText fields are ignored, as they appear to have been deemed irrelevant during the update phase by the invalid state of the backing bean for the drop-down.
    To test my theory, I changed the default value of the backing bean attribute for the drop-down to be "RANGE", and made it final. The page behaves perfectly in updating the backing bean with the values entered for the conditionally-displayed inputText controls. This tells me that the invalid state of the backing bean drop-down list attribute must be the problem. Furthermore, I have tried using "disabled=", "readonly=" and "rendered=" on the conditional inputText fields, and none of that seems to make a difference. I also tried using a ValueChangeHandler, but that didn't do anything about it.
    Note - the backing bean does realize that the correct state for the drop-down should be "RANGE", but only AFTER the backing bean has received its updated values from the page controls.
    Has anyone seen anything like this? I haven't read anything in previous posts about an issue like this, but it has to be something someone has seen before. Maybe related to using the enum type? Thanks.

    Hi,
    did your web.xml file had any parameter regarding explicitly indicating the way to save state?
    I mean something like
    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>server</param-value>
      </context-param>One last question: did you stay with request scope beans or session ones?
    Greetings.
    MogaRick

  • ADF BC/Faces - Order of validation / backing bean action problem

    Hello,
    I want the user to enter the same "operation date" into all adf faces table rows created in one batch (one transaction).
    So I removed operation date field from the table and added "unbound" date field above the table. The date field value is then copied into all new rows in background. This process is invoked from backing bean from Commit button actionListener method.
    The problem is the validation of the operation date in entity is executed before a new date value is copied into the date attribute (validation of model is in JSF lifecycle executed prior invoking actions in backing beans).
    It means the user can enter dead lock when he enters invalid date (for example date higher then a valid value).
    Then after commit:
    1. First validation is ok (wrong date value haven't been copied into model yet)
    2. backing bean copy action is executed - model now contains wrong date value
    3. Validation before commit isn't successfult - error message is displayed
    4. User corrects the date value and presses commit again but:
    5. First validation is not successful - model still contains recent wrong date value - error message is displayed again
    6.There is no way out from this situation
    I'm going to override lifecycle to be able to invoke copy method before validation cycle. Is this solution acceptable? Do you have any other suggestion?
    Thank you.
    Rado

    hi Rado
    Would it make sense to design your ADF BC View Objects in some kind of master-detail shape that fits your data?
    View Object : OperationMaster (OperationDateAttr, ...)
    View Object : OperationDetail (OperationAttr1, OperationAttr2, ...)
    View Link : OperationDetailForMasterVL (based on some attribute that keeps the detail rows together)
    You would need some Application Module method that does the "row batch setup", but it look like your already have something like this.
    A change to OperationMaster.OperationDateAttr could update all its detail rows date attribute.
    I think that building a UI on this would be less "view layer dependant".
    Just a suggestion.
    regards
    Jan Vervecken

  • JSV-Validation discards some backing bean properties

    Hi guys,
    I'm facing a curious problem occuring in my jsf-application. I have a userlist on my page. Every user can be edited (change password, etc) or a new user can be created. When I click the "edit-user"-button, a new page is opened where I can change different properties of this user. When I submit the form, the jsf-validation is beeing called (because I set some properties to attribute "required"). When an error occurs, the action-command returns null and goes back to the page. But not all properties of my backing bean arent set! It seems, that only the properties beeing set to attribute "required" are saved... How can I fix this?
    My jspx-page that creates/updates a user looks like that:
    <h:form>
         <h:inputHidden value="#{userFormBean.userID}" />
         <h:panelGrid border="0" columns="2" style="margin-bottom:15px;">
              <h:outputLabel value="#{msg['ui.user.create.lastname.label']}:" />
              <h:inputText value="#{userFormBean.name}"
                              required="true"
                              label="#{msg['ui.user.create.lastname.label']}" />
              <h:outputLabel value="#{msg['ui.user.create.firstname.label']}:" />
              <h:inputText value="#{userFormBean.firstname}"
                              required="true"
                              label="#{msg['ui.user.create.firstname.label']}" />
              <!-- more properties... -->
         </h:panelGrid>
         <c:if test="#{userFormBean.state == applicationScope.constants.STATE_NEW}">     
              <h:commandButton action="#{userFormBean.createUser}" value="#{msg['ui.user.create.button']}">
                   <f:setPropertyActionListener value="#{applicationScope.constants.STATE_NEW}" target="#{userFormBean.state}"/>
              </h:commandButton>
         </c:if>
         <c:if test="#{userFormBean.state == applicationScope.constants.STATE_UPDATE}">
              <h:commandButton action="#{userFormBean.updateUser}" value="#{msg['ui.user.update.button']}">
                   <f:setPropertyActionListener value="#{applicationScope.constants.STATE_UPDATE}" target="#{userFormBean.state}"/>
              </h:commandButton>
         </c:if>          
    </h:form>     This is my backing bean that does all the logic...
    public String updateUser(){
         try{
              // do some business-logic
         }catch (Exception ex){
              // set error message and return to form
              FacesContext ctx = FacesContext.getCurrentInstance();
              // provide some error-msgs
              return null;
         return "success";
    }I need to save all the properties on my backing bean, especially my "state"-property that decides whether I create a new user or update a given user identified by its id...

    To start, do not mix JSF with JSTL this way. Remove all of those c:if tags and use the JSF 'rendered' attribute instead.
    E.g.
         <c:if test="#{userFormBean.state == applicationScope.constants.STATE_NEW}">     
              <h:commandButton action="#{userFormBean.createUser}" value="#{msg['ui.user.create.button']}">
                   <f:setPropertyActionListener value="#{applicationScope.constants.STATE_NEW}" target="#{userFormBean.state}"/>
              </h:commandButton>
         </c:if>should be
         <h:commandButton action="#{userFormBean.createUser}" value="#{msg['ui.user.create.button']}" rendered="#{userFormBean.state == applicationScope.constants.STATE_NEW}">
              <f:setPropertyActionListener value="#{applicationScope.constants.STATE_NEW}" target="#{userFormBean.state}"/>
         </h:commandButton>Back to your actual problem: I cannot correlate your problem description to the given code snippet. Which non-set values are you talking about?

  • Automatic amendment of jsf when backing beans refactored: tool support ?

    Hi there,
    Whenever I refactor backing beans I have to adjust EL expressions in all my jsf files manually.
    That is annoying, time-consuming and finally prevents me from refactoring regularly.
    Does anybody know an IDE or tool that supports refactoring of backing beans ?
    Many thanks in advance
    Ott

    Hi there,
    Whenever I refactor backing beans I have to adjust EL expressions in all my jsf files manually.
    That is annoying, time-consuming and finally prevents me from refactoring regularly.
    Does anybody know an IDE or tool that supports refactoring of backing beans ?
    Many thanks in advance
    Ott

  • Adding JSF 2 composite component at runtime from backing bean

    Hello,
    I try to add a custom composite component to a JSF page from a backing bean method in this way:
    +//-----------------------------------------------------------------------------------------------------+
    +public String addCC(){+
    +//create my comoposite component's istance+
    ccPageLoader = new CCPageLoader();
    +//set a property+
    ccPageLoader.setSrc("one.xhtml");
    +//get the object on the JSF page that must contains the comp.comp.+
    UIComponent c = this.findComponentInRoot("container");
    +//ADD THE COMPOSITE COMPONENT TO THE PAGE+
    c.getChildren().add(ccPageLoader);
    return null;
    +}+
    +//-----------------------------------------------------------------------------------------------------+
    Now, the method doesn't get errors, the beginEncode() method of the composite component is called, but I cannot see the composite component in the page...
    Instead, if a try to add a standard JSF component, using the same code, I can see the JSF component in the page.
    Any suggestion?
    Thank you, F. ...

    I removed all my assertions to see how far the submission could go when going unsane.
    I discovered that JSF attempts to redisplay my web page, and not to follow on the next one...
    ... so I have one explanation.
    Except that:
    There is no fields in the form that require a validation.
    (three hidden text fields, and a <h;inputTextarea> but that is not checked or mandatory).
    The form is not supposed to fail,
    and even if it had too, why the validation step doesn't carry the current managed bean at redisplay time, but instead re-create an empty managed bean?
    My form starts with a:
    <h:form id="${someId}"> where ${someId} is a scoped variable.
    Can it causes a problem during submission? Shall I use only a constant id for my form?
    What can you suggest me to do?
    Do I have a way to discover what JSF is about to complain against, before it tries to redisplay the page? I see nothing in my logs, but may be I shall redefine a log level somewhere, add one handler or something else?
    Regards,
    Grunt.

  • Open URL in a new browser from a JSF backing bean

    I want to use commandButton action in jsf to launch a new browser instead of using commandLink.
    How do you launch url in a new browser window by firing up a method in backing bean?
    So far I am able to launch a URL within the same browser window. Here is my code:
    In jsp file:
    <h:commandButton rendered="#{openDataList.valueModifiable}" value="link" action="#{openDataList.link}" />
    In backing bean:
    public void link()
         try{
         FacesContext faces = FacesContext.getCurrentInstance();
         faces.responseComplete();
         ExternalContext context = faces.getExternalContext();
         context.redirect("http://www....");      }
         catch(java.io.IOException e)
    ...

    with a commandButton i dont belive you can
    well there are ways you can use javascript window.open
    or you can use a commanLink ans set the target
    but from my understanding there is no way to open a new browser from the backing beans ( this is because this is a client function and your backing beans are on the sever )

Maybe you are looking for

  • ITouch 5 is not recognized by Windows 7

    Hi, I bought a used iTouch 5th gen and charger cable and have spent the last 5 hours trying to get it to sync to iTunes. I had a 4th gen iPod that i lost a month ago that worked perfectly with my computer. I have reconnected and restarted both device

  • /etc/modprobe.d folder is empty

    My modprobe.d folder is empty.I don't have a modprobe.conf file in it. Pacman did not seem to have altered any files in this folder,when I upgraded. [2012-01-20 22:47] Running 'pacman -Syu' [2012-01-20 22:47] synchronizing package lists [2012-01-20 2

  • Storing the VISA adress in a .ini file

    Hi, I'm looking for 'good' way to store the (RS232) VISA adress in a ini-File. One way to do this, is using the 'flatten to string.vi', and cut away the first 3 characters ('^\00\00\04'), this way I get a readable and easy to change ini-information.

  • ActionPerformed not working ??

    Hi all, I have written this program to display a box for user to enter a value and display the computed value :- import java.awt.*; import javax.swing.*; import java.text.*; import java.awt.event.*; public class ConvertMachine extends JFrame implemen

  • In CS6, using brush mode, I option click on an image to select a color ...

    But it goes to back in color picker, which means to use it I have to hit X to toggle the back to front. It used to be that the front color was always the color you pick with this keyboard shortcut. What is going wrong? Or how can I fix it?