InputText loosing value after setting required="true"

Hi Folks,
'myBean' is request scope bean.
I have a problem here with the inputText tag
in edit.jsp
<h:inputText value="#{myBean.name}" id="name" required="true"/>
<h:message for="name"/>
When i click the 'Update' CommandLink without entering the value in the text field, i see a validation error message. After this when i go back to the old page from my menu and comes back to edit.jsp i see no value in the text field. i can print the value by using outputText like
<h:outputText value="#{myBean.name}" id="outputname">
Why is the value getting lost in inputText?
Any help appreciated.
Thanks a bunch.
Regards,
Sreedhar

the error msg was expected behaviour, when i did not enter any thing in the text. The page was redisplayed with validation error when nothing was entered in the text field. After that when i come back to the edit page for different set of result i see nothing in the name text field. The page is not rendering text field name. Where as when i try to print the value by using outputText i could see the value.
I am wondering why inputText is not rendering the valueand why outputText can render the same value

Similar Messages

  • Restoring af:selectBooleanCheckbox value after setting visible=true

    Using JDev 11.1; I have a table that displays data from a model object, and one of the columns contains true/false values which we render in the table using an af:selectBooleanCheckbox. All works fine except that user is able to hide the table by expanding other components which sets visible=false on the bounding component for the table. If user elects to redisplay the table by reducing the other component zoom, then the table displays again but the selected check-marks/tags do not return.
    Thought initially it might've been because the query was being reissued on the table, but not so. More about the selected attribute on the af:selectBooleanCheckbox, which I have set to the default (false). So the value property is set to the table collection attribute as required to interface with the model, but I need to know what to set the selected attribute to. I can see that when the table is redisplayed, this default value of false is being sent through to the model which is discarding the values I want to retain.
    I've tried some EL in the selected property to set it to true/false based on what's in the table, but the problem with that is that it becomes essentially a read-only control. I need to find some way to disable the value assignment when making the table visible again. Any suggestions?
    Thanks,

    Andrefs,
    In ADF BC, one way we deal with this is by adding a transient Boolean attribute to the View Object with getters (translate 0/1 to false/true) and setters (vice-versa). Then, we bind the UI to the transient attribute. It's been so long since I've done EJB's, but could you take a similar approach?
    John

  • Method CreateChildren in ApplicationControllBar class called twice after setting dock=true

    Hi during creating of a custom ApplicationControllBar
    component in ActionScript I probably found a (nasty) bug?!
    package net.neijman.julia.jaContainers
    import mx.containers.ApplicationControlBar;
    public class JAApplicationControlBar2 extends
    ApplicationControlBar
    public function JAApplicationControlBar2(): void
    this.dock = true;
    super();
    override protected function createChildren(): void
    trace("CREATECHILDREN EXECUTED");
    When I am using my simple custom component in my application:
    <jaContainer:JAApplicationControlBar2 />
    The trace message trace("CREATECHILDREN EXECUTED"); is
    executed twice (meaning CreateChildren is called twice BUT ONLY
    AFTER SETTING dock = true (see constructor). When setting dock =
    false CreateChildren is executed once. I want to build a framework
    on the standard components (depending heavily on the
    CreateChildren-method).
    In other words, creating dynamic components in the docked
    ApplicationControlBar in the method CreateChildren results in a
    double placement in the DisplayList.
    Has anyone has a clue what's going wrong here? (my
    workarround for now is to start the createChildren method with
    removeAllChildren();)
    Thanks Tom Neijman

    Interesting. I would file it as a bug here:
    http://bugs.adobe.com/jira/secure/Dashboard.jspa
    And then see what happens. If it's not a bug, you'll probably
    get a decent reason why this occurs in the bug notes.
    matt horn
    flex docs

  • Typing a phrase in the Address Bar of Firefox 3.6 used to lead me to the relevant website, but this doesn't happen in FF4, even though keyword.enabled value is set to true in the config page. Why doesn this happen?

    In the about:config page the keyword.enabled value is set to "true". And the keyword.URL value is set to "default". When I type a phrase in the Address Bar, a page with a Yahoo! search result opens unlike intuitively loading the relevant page using Google. Why is this happening?

    To use the Google's browse by name feature as used in Firefox 3.6, set keyword.URL to this link:
    [http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=navclient&gfns=1&q= http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=navclient&gfns=1&q=]

  • Hi..while validating h:InputText tag with required="true"

    <div class="new_campaign_block">
    <div class="campaign_basic">
    <h:outputLabel value="List Basic Details:" styleClass="headings" />
    <s:validateAll>
    <h:panelGrid columns="2" border="0">
    <h:outputLabel for="listname" value="List Name: (*)" styleClass="wizard"/>
    <h:inputText id="listname" value="#{lists.name}" required="true"/>
    am validating using required="true" and i modified the messages.properties file as
    so its validating if i didnt enter the listname like this-- "wizard_form:j_id1248:listname:should not be empty"
    but i want the validation o/p like this "listname should not be empty" . is there any way to eliminate the
    "wizard_form:j_id1248:" this part in the o/p validation. Or any way to display validation messages as our wish.
    please .. ur suggestions are most valuable.

    I am facing same problem, can u help me.
    I have put command button which proceeds to next page and when product type is not selected, even though it calls the bean method and proceeds to next page!!! I tried all possible combination.
    Here I have two queries
    1) what possible reason for required tag not to work?
    2) if I am checking that product type is not selected in bean method, how to reflect this to jsf and it will shows the message like 'validaiton error : value is required or something similar...
    Pranav

  • JSF keeps displaying old values after Validation Phase fails

    Hi all,
    I would like to ask some help in understanding a particular behaviour that JSF shows when Validation Phase fails.
    I'm using:
    - Tomcat 7.0.2
    - JSF 1.2_12
    - RichFaces 3.3.3
    Problem description.
    I wrote a form with 4 input fields: an inputText and 3 selectOneMenu. The inputText is required while the selectOneMenus don't require any validation.
    Attached to the first selectOneMenu (row 32), is an a4j:support tag so that, whenever the change event is fired, the list of items of the second
    and the third selectOneMenu (row 44 and 58) are correctly filled (note that the mandatory of the inputText is ignored thanks to the ajaxSingle attribute).
    In particular, after loading the two lists of items, the actionListener forces the value of the second and the third selectOneMenu to null.
    This mechanism seems to work fine until I submit the whole form without filling the input text: as expected, JSF validation fails but if I change the value of
    the first selectOneMenu again (causing a new submit), the page keeps displaying the values specified before JSF validation failed for the second and the third
    selectOneMenu (note that the actionListener is still called and the values of the second and the third selectOneMenu are still forced to null).
    Since I'm using a simple PhaseListener, I noticed the following: before JSF validation fails, every time I change the value of the first selectOneMenu, JSF life
    cycle always calls the get method for the second and the third selectOneMenu during the Render Response Phase. In this way, JSF is able to "see" that
    those values have been set to null during the Invoke Application Phase.
    After validation fails, JSF stops calling those getters when I change the value of the first selectOneMenu.
    I hope my explanation was clear enough, thanks a lot for your help.
    Regards,
    Nico
    Web Page
    <?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">
    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:a4j="http://richfaces.org/a4j"
          xmlns:rich="http://richfaces.org/rich">
    <head>
      <title>Prove Rich</title>
    </head>
    <body>
      <h2>Prove Rich</h2>
      <f:view>
      <a4j:outputPanel ajaxRendered="true">
        <h:messages style="color:red" />
      </a4j:outputPanel>
      <h:form>
      <p>
         Input required: <h:inputText value="#{provaProbReplyBean.inputRequired}" required="true" />
      </p>
      <p>
           <h:outputText value="Scegli il canale:" />
           <h:selectOneMenu value="#{provaProbReplyBean.canale}">
            <f:selectItem itemLabel="--" itemValue="" />
            <f:selectItem itemLabel="Profamily" itemValue="Profamily" />
            <f:selectItem itemLabel="Captive" itemValue="Captive" />
            <a4j:support event="onchange" action="#{provaProbReplyBean.caricaProcBanche}"
                                  ajaxSingle="true" reRender="procedure, banche" />
         </h:selectOneMenu>
      </p>
      <p>
           <h:outputText value="Scegli la procedura:" />
           <h:selectOneMenu id="procedure" value="#{provaProbReplyBean.procedura}">
            <f:selectItem itemLabel="--" itemValue="" />
            <f:selectItems value="#{provaProbReplyBean.procedureList}" />
            <!-- immediately save the current value -->
            <a4j:support event="onchange" ajaxSingle="true" />
         </h:selectOneMenu>
      </p>
      <p>
           <h:outputText value="Scegli la banca:" />
           <h:selectOneMenu id="banche" value="#{provaProbReplyBean.banca}">
            <f:selectItem itemLabel="--" itemValue="" />
            <f:selectItems value="#{provaProbReplyBean.bancheList}" />
            <!-- immediately save the current value -->
            <a4j:support event="onchange" ajaxSingle="true" />
         </h:selectOneMenu>
      </p>
      <p><h:commandButton value="Submit" /></p>
      </h:form>
      </f:view>
    </body>
    </html>
    Bean
    public class ProvaProbReply {
         private String inputRequired;
         private String canale;
         private String procedura;
         private String banca;
         private Map<String, List<SelectItem>> canaliProc = new HashMap<String, List<SelectItem>>();
         private Map<String, List<SelectItem>> canaliBanche = new HashMap<String, List<SelectItem>>();
         private List<SelectItem> procedureList = new ArrayList<SelectItem>();
         private List<SelectItem> bancheList = new ArrayList<SelectItem>();
         public ProvaProbReply() {
              List<SelectItem> l = new ArrayList<SelectItem>();
              l.add(new SelectItem("Cessione del quinto"));
              l.add(new SelectItem("Credito al consumo"));
              l.add(new SelectItem("Mutui"));
              canaliProc.put("Profamily", l);
              l = new ArrayList<SelectItem>();
              l.add(new SelectItem("Credito al consumo"));
              canaliProc.put("Captive", l);
              l = new ArrayList<SelectItem>();
              canaliBanche.put("Profamily", l);
              l = new ArrayList<SelectItem>();
              l.add(new SelectItem("BDL"));
              l.add(new SelectItem("BM"));
              l.add(new SelectItem("BPM"));
              l.add(new SelectItem("CRA"));
              canaliBanche.put("Captive", l);
         public String getInputRequired() {
              return inputRequired;
         public void setInputRequired(String ir) {
              inputRequired = ir;
         public String getCanale() {
              return canale;
         public void setCanale(String c) {
              canale = c;
         public String getProcedura() {
              System.out.println("\ngetProcedura called\n");
              return procedura;
         public void setProcedura(String p) {
              procedura = p;
         public String getBanca() {
              System.out.println("\ngetBanca called\n");
              return banca;
         public void setBanca(String b) {
              banca = b;
         public List<SelectItem> getProcedureList() {
              return procedureList;
         public List<SelectItem> getBancheList() {
              return bancheList;
         public String caricaProcBanche() {
              System.out.println("\nListener called\n");
              procedureList.clear();
              bancheList.clear();
              if(canale != null && !canale.equals("")) {
                   procedureList.addAll(canaliProc.get(canale));
                   bancheList.addAll(canaliBanche.get(canale));
              System.out.println("BEFORE setting:\n");
              System.out.println("\nProcedura: "+procedura+"\n");
              System.out.println("Banca: "+banca+"\n");
              procedura = null;
              banca = null;
              System.out.println("\n\n\nAFTER setting:\n");
              System.out.println("\nProcedura: "+procedura+"\n");
              System.out.println("Banca: "+banca+"\n");
              return "";
    }Edited by: 869000 on 28-giu-2011 14.05

    I'm thinking this has to do with the fact that the UIComponents use the localValue after validation fails. This prevents the values from being overwritten when re-rendering the page, i.e. the inputs keep the value set by the user.
    The solution is to manipulate the components directly during the AJAX request when the first pull down is changed. Use the binding attribute to place them into your bean and clear the value directly. That way it will not matter that the expression is not evaluated.

  • Problem with required="true"

    Hi,
    If I set required="true" for an inputText, then if I click the return button without filling in this inputText , I can't return because the field must be filled!!!!
    Does someone have an idee about resolving that?
    Thanks

    Set immediate="true" on your return button.
    Note: This will skip ALL component validation. Which is probably what you want anyways.
    CowKing

  • Submit values despite of immediate="true"

    Hi,
    This is my first try to post a question. So please don't be angry with me if my post isn't perfekt. :-)
    I have a JSP with serveral inputText-fields. Each field is required and has a lick to a special search-JSP. To release the link without having the input-fields validated at this moment I had to add the attibute immediate="true". If I fill the input-field while choosing a value from the search-JSP the value will be submitted to the bean. Now my Problem: If I fill the first field without searching with the Link an then try to fill the second field while releasing the link, the first value disappears. (because of the attribute immediate it is not going to be submitted). Is there a possibility to submit this value despite of immediate="true".
    I tried to add <f:param> to the link. This seems a possibility. But it could be that I have up to six input-field like this. In this case I habe to sumbit 5 values and this six times. That seems too much. And I hope there is another way to do it.
    To clarify my problem here is a reduced and simplified part of my code:
    <h:panelGroup>
         <h:outputText value="Field1" />
         <h:commandLink value="Search" action="#{pc_Test.executeSearch1}" immediate="true" />
         <h:inputText id="field1" value="#{pc_Test.field1}" required="true" />
         <h:message for="field1" />
    </h:panelGroup>
    <h:panelGroup>
         <h:outputText value="Field2" />
         <h:commandLink value="Search" action="#{pc_Test.executeSearch2}" immediate="true" />
         <h:inputText id="field2" value="#{pc_Test.field2}" required="true" />
         <h:message for="field2" />
    </h:panelGroup>At the end of the JSP is the submit-Button. If this is clickes the fields will be validated.
    I hope you can help me.
    Thanx in advance.
    Steffi

    The immediate="true" attribute in the UICommand will skip under each the update model values phase.
    You may find this article useful to get some more insights in the JSF lifecycle:
    http://balusc.blogspot.com/2006/09/debug-jsf-lifecycle.html

  • Using value binding expressions to set 'required' attribute

    I am trying to use a value binding expression to determine whether the value of various input control's is required or not according to where they are used and not having much luck. I wonder if anyone can shed some light on this...
    The following expression works: <h:inputText id="name" required="#{true}"/> whereas <c:set var="required" value="true" scope="request"/>
    <h:inputText id="name" required="#{required}"/> does not, even though the expression evaluates to true! I have tried numerous variations (requestScope.required, required == true, required ? true : false, etc.) to no avail. Interestingly, #{1 == 1} or binding to a backing bean method works, but as soon as you add a request variable it breaks.
    Am I doing something wrong, is this something that JSF doesn't allow, or just a bug in the RI? Note that I don't want to vary this flag between multiple submissions of the same form, I am just trying to reuse the same JSP include to generate form controls for required and optional data on different forms to avoid a whole lot of cutting any pasting.
    Any pointers gratefully received.
    -- Keith Wilson

    I had something like this happen, and here's what I concluded the problem was. Perhaps your problem is similar.
    In the first non-working example you show a request-scope variable being set in the JSP page, and then use that to set the "required" attribute. But consider what happens when you submit the form. There is no longer any request-scope variable set because we have a new request and we don't go through the JSP page! (Not before validation is checked, anyhow).
    So basically I concluded that the variable had to be in (say) session scope for it to work as you would like.

  • How to set/change spell value after button is pressed

    Hi All,
    I have a requirement, I need to change the spell value(Boolean) dynamically based on the sitution. (say for eg. If i click search spell (ReadOnly) variable shouldbe set to TRUE.like that ..
    I have create a dummy VO and in that VO I have created spell variables.
    Can some one help me how to do this when a button is pressed, I wrote code after buttton pressed it's throwing the below error.
    if(pageContext.getParameter("Create")!=null)
    OAViewObject disvo = (OAViewObject)am.findViewObject("XxafpEepStageRebateValidateVO1");
    OARow row1 = (OARow)disvo.first();
    row1.setAttribute("ItemProperty", Boolean.FALSE);
    row1.setAttribute("ReadOnly", Boolean.TRUE);
    call another page..
    Error(102,6): class OAViewObject not found in class xxafp.oracle.apps.qp.pricelistrebate
    Thanks,
    Mahesh

    Hi Mahesh
    Seems you have not imported OAViewObject Class in your controller..Do the following in the import section of your controller..
    import oracle.apps.fnd.framework.OAViewObject;AJ

  • Focus after Setting a Form Value within the Validate Event ( =8.8)

    Hi
    Setting Values within Validate Event sets Focus incorrectly on SAP >= 8.8
    The following  example works fine  on SAP 2007.
    Why i don't like this behaviour
      -I didn't found an easy workaround to fix it
      -SetMatrixCellWithoutValidation has the right behaviour but only works with Userdefined - Columns
      -It's a quite common usecase to validate something and in the same step set some values after successful validating (or cancel the input by using BubbleEvent = False)
      -It just worked for 6 years now
      -I have developed around 20+ AddOns and i'm running into this Regression Issue more and more.
    But maybe i'm just missing something.
    So how would you solve the following code now with Versions >= 8.8 ?
    Thanks for any enlightment!
    private void SBO_Application_ItemEvent(string FormUID, ref SAPbouiCOM.ItemEvent pVal, out bool BubbleEvent)
                BubbleEvent = true;
                // 11.08.2011 knp
                // use case is for example setting the price according a custom price table
                // it's triggered by the item column in the sales order matrix and sets the unit price
                // Expected: Focus is on the column after "Item" column
                // Result:   Focus is on column after the "Unit Price" column
    validation
                if (pVal.InnerEvent == false)
                    if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_VALIDATE)
                        if ((pVal.FormTypeEx == "139"))
                            if (pVal.BeforeAction == true)
                                if (pVal.ItemUID == "38")
                                    if (pVal.ColUID == "1") // item code
                                        SAPbouiCOM.Matrix oMtx = (SAPbouiCOM.Matrix)SBO_Application.Forms.Item(pVal.FormUID).Items.Item("38").Specific;
                                        SAPbouiCOM.EditText oEd = (SAPbouiCOM.EditText)oMtx.Columns.Item("14").Cells.Item(pVal.Row).Specific;
                                        oEd.Value = "2";

    Hi
    Try this
    private void SBO_Application_ItemEvent(string FormUID, ref SAPbouiCOM.ItemEvent pVal, out bool BubbleEvent)
                BubbleEvent = true;
                // 11.08.2011 knp
                // use case is for example setting the price according a custom price table
                // it's triggered by the item column in the sales order matrix and sets the unit price
                // Expected: Focus is on the column after "Item" column
                // Result:   Focus is on column after the "Unit Price" column
    validation
                if (pVal.InnerEvent == false)
                    if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_VALIDATE)
                        if ((pVal.FormTypeEx == "139"))
                            if (pVal.BeforeAction == true)
                                if (pVal.ItemUID == "38")
                                    if (pVal.ColUID == "1") // item code
                                        SAPbouiCOM.Matrix oMtx = (SAPbouiCOM.Matrix)SBO_Application.Forms.Item(pVal.FormUID).Items.Item("38").Specific;
                                        SAPbouiCOM.EditText oEd = (SAPbouiCOM.EditText)oMtx.Columns.Item("14").Cells.Item(pVal.Row).Specific;
                                        oEd.Value = "2";
                                        oMtx.Columns.Item("1").Cells.Item(pVal.Row).Click(SAPbouiCOM.BoCellClickType.ct_Regular, 0);
    Regards
    Arun

  • Hi  When i create the downpayment process in the invoice i get amount as value but my requirement is in percentage even after i select the percentage basis milestone billing please help what can be done

    Hi  When i create the downpayment process in the invoice i get amount as value but my requirement is in percentage even after i select the percentage basis milestone billing please help what can be done

    downpayment percentage , so if i want 50 percent of order value to be paid  and when i go to faz type the invoice is created for 0 value that 50 percent of the amount is not getting calculated , where as when i enter in order same as 50 percent in amount it gets calculated in invoice, any help ?

  • InputText renders as just text when readOnly set to true

    Apparently when a <af:inputText> component's readOnly attribute is set to true, the component renders as plain text rather than a text box whose readOnly attribute is set to true. Oracle's ADF tag definition site makes no mention of this 'feature' (http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/tagdoc/core/inputText.html) but I remember reading it somewhere, I believe in some of the documents that came with an ADF faces download.
    And if I had not happened to come across this information somewhere, I would otherwise think this was a bug. But either way, I don't think this is the way it should perform. If I specify a field on a page to be inputText, I expect it to be a text box, regardless of whether I want it readOnly or not. I think its a bad assumption on ADF's part to completely change the rendering of the component.
    I want to render text inside a textbox on a page, but make it read only. And I am using it within the confines of a <af:forEach> so I am using the var parameter, and thus am forced to use Oracle's components so the forEach var parameter is recognized. So it appears to me I cannot render the field how I want. I dont see any other Oracle components to render this.
    Is this going to be changed or is there a way to submit something to Oracle to have this addressed?

    FYI...if I use the disabled attribute instead, thankfully the component still renders as a textbox. Obviously it renders grayed out, but at least I still get a textbox with text in it.
    But the readOnly attribute still, I feel, performs badly. So my question still stands, are there plans to change it or can it be addressed? Maybe when Apache takes full control of the library, it will be changed...

  • Why does my preferred search engine gets hide set to True in search.json after every update to Firefox?

    I use DuckDuckGo as my preferred search engine. Everytime Firefox gets updated it dissappears from the drop down menu of search engines. I found in search.json that the Hide value would be set to True. By changing it to False and restarting Firefox DuckDuckGo would be back, until the next update. Why is this happening? It is an extension available from the Mozilla/Firefox extension/addons site.

    First of all, thank you for providing troubleshooting info (Troubleshooter addon), have you tried the searchreset tool.
    * https://addons.mozilla.org/en-US/firefox/addon/searchreset/

  • Even after set Mo:Security and HR:Security,user not able to restrict require Inventory Org.

    Hi All,
    Even after set Mo:Security and HR:Security,user not able to restrict require Inventory Org.
    Both the profile option have set at responsibility level.
    Reagrds,
    Sandesh

    2785222 wrote:
    Hi All,
    Even after set Mo:Security and HR:Security,user not able to restrict require Inventory Org.
    Both the profile option have set at responsibility level.
    Reagrds,
    Sandesh
    Hi Sandesh,
    First note that HR:Security Is for HRMS module for restricting data for respective OUs
    MO:Security is for other Modules such as Inv, PO, AR, AP etc., for restricting data
    Change the inventory Org to the one you want and then query data...
    Hope it helps.
    Regards,
    Shahzad.H.Magsi

Maybe you are looking for

  • Call a procedure in a function to create an Index

    Hi, i want to doing a text search and have to create some index to doing that. I have to choose between create two index according to what a search i want to doing. The function, which call the sql-statement to search the text is: CREATE OR REPLACE F

  • Embedding Multimedia in an eBook

    Adobe claims - and shows, that you can run audio and video within a window in an eBook.  I can place mp3 and mp4 files in a frame but they do not show up in the epub file when run on my iPad, or  Adobe Digital Editions.  How does one impliment this m

  • Altering / Adding Publication Items

    Hi all, I know that there had been similar requests to this in the past and I have read all of these and I still have an issue. I have also seen rekounas's code to use the ConsolidatorManager API to add/alter.. the publication items. I have tried to

  • My blackberry 9800 (torch) is dead...help!!

    Hi... I've had my BB 9800 for more or less 2 years now. Recently I forgot to recharge it and it wouldn't charge or show any light. I've just bought a new battery, thought that it might solve the problem but it didn't. Could you please help me? Is the

  • Help with Select SQL

    I have a (driver Table) with two number columns: customer_id, fake_id 1233232, 5466 4342344, 5432 over 10 million rows... The customer_id and fake_id match on a 1-to-1 basis, no duplicates. Fake Id is given out to vendors for security reason and then