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

Similar Messages

  • Global problem with immediate="true"

    JSF specifies that immediate="true" in UICommands should skip the Validation and Update Model phases.
    The RI uses the Update Model phase to reset the local values of the input components after updating the model. That means that in the case of immediate="true", the local values are not reset, and thus saved by the state manager.
    The problem is that the next display of the page shows the previously entered values, instead of getting the values from the model, which is somewhat strange for a 'cancel' button.
    I think this is mainly a problem with the spec which clearly indicates that the clearing of the local values should be done in the update model phase.
    Is it possible to have a workaround for this ?

    the previous posts have been made long ago, but I'll give it a try:
    I think this behavior is still buggy or at least not logical.
    Example:
    I've got a dataTable which shows a list of entries, each row with an "edit" commandButton and a "new" commandButton below the list.
    If the user clicks an "edit" button, he is redirected to the "details" page where he can edit and save the values of this entry. This works as expected. But: On the "details" page, there's also a "cancel" button, which should navigate to the list again, without doing any validation or updating.
    If I set this "cancel" button to "immediate", navigation works, but then I'll always see the values of the canceled entry, regardless of which "edit" button I click in the list.
    If the "cancel" button is not immediate, validation fails when the user clicks "new" and then "cancel", because he gets an empty form, but some or all fields are required.
    There are two workarounds:
    1) Creating two different views, one for creating a new entry and one for editing.
    2) The "cancel" button is a simple html-button, with the "onlick='location.href=xxxyyy'" attribute.
    IMHO both workarounds are ugly. So, why is the view ignoring that there is a complete different entry object in the backing bean of the "details" input fields???
    BTW: I'm using JSF SUN RI 1.1.01 (same with 1.2 current snapshot).
    With MyFaces, everythings works but it has some other bugs, so I want to stick to the Sun RI.
    Thanks,
    Walter

  • Problem with return true and if statement

    I'm making a
    ship shooter
    game and I have a problem with the collision detection for the
    corners of the stage. When you hold down two of the arrows to move
    the ship into the corners of the screen, the ship will go past it.
    The function bellow is what I'm using to detect this collision. The
    reason I'm using a function is because it's used for the ship and
    for all the balls from the cannons (as shown in the last two lines
    of the attached code). This is the reason I need the return true,
    so the if statement can be evaluated to true and then unload the
    movieclip of the cannon ball. When I remove the return true, the
    collision works fine, but obviously my cannon balls all get stuck
    on the edges.
    Any ideas?

    Well the function is called every frame, for the ship and for
    every cannon ball that's on the screen. So it could be called about
    4 times or so per frame. The problem is that ship goes through the
    corners of the stage (btw, the green background is the stage area)
    when you go in a diagonal direction.
    Just curious...what's the unnecessary code you're talking
    about?

  • Problem with printing true colors

    Had PSE7 and colors printed true and beautiful. Upgraded to PSE10 and all of a sudden colors printed muddy and dull with purplish overcast. Took printer in for service but problem persisted. Upgraded to PSE11 and once again colors were printing true and beautiful for over a year. Printed a card about 5 days ago using PSE11 - beautiful. Printed a card yesterday using PSE11 and colors muddy and dull with purplish overtones. Installed  PSE13 and colors printing dull, muddy with purplish overcast..  I feel it is a problem somewhere in settings of PSE, but can't figure out where.  I don't think it is a problem with printer. Both printer and PSE set to Adobe RGB. Color control set to optimize for printer. Using PC with Windows 7, 64 bit. Printer is Epson stylus photo 1400.  Thanks for any help, Merrie

    See if this helps:
    http://helpx.adobe.com/photoshop-elements/kb/color-management-settings-best-print.html

  • 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

  • Problem with immediate=true, maybe a Bug

    I'm using a dataTable for selecting an user. The selected userBean will be put to the session context with id "selectedUser". The next page allows to edit users values. This edit page contains a cancel button with immedtiate=true param to abort editing and go back to the list. The edit page contains some input fields like:
    <h:inputText id="firstName" value="#{selectedUser.firstName}" />
    <h:inputText id="lastName" value="#{selectedUser.lastName}" />
    These fields are showing correct values for the selected user. But after selecting another user from the list the edit page is showing the values of the previous selected user! By selecting the second user again and again after a while the edit page shows the correct values.
    Well, I've added a JSP expression to the edit page to show me if the selected user is the right one "Edit User (${selectedUser})". The value of this expression always shows the correct selected user.
    If I modify the command button from:
    <h:commandButton action="users" value="Cancel" immediate="true" />
    to:
    <h:commandButton type="reset" onclick="window.location.href='/faces/users'" value="Cancel" />
    the problem does not appear!!!
    For me it looks like a bug. Any ideas?
    Thx,
    Wolfgang

    Sorry for the imcomplete testcase, here it comes again:
    --- Users.java ---------------------------------------------
    package jsf.test;
    import java.util.ArrayList;
    import javax.faces.context.FacesContext;
    public class Users
    private ArrayList users;
    public Users()
    super();
    users = new ArrayList();
    users.add(new User("User_A", "firstName_A", "lastName_A"));
    users.add(new User("User_B", "firstName_B", "lastName_B"));
    users.add(new User("User_C", "firstName_C", "lastName_C"));
    public ArrayList getUsers()
    return users;
    public String edit()
    FacesContext context = FacesContext.getCurrentInstance();
    User user = (User)context.getExternalContext().getRequestMap().get("user");
    System.out.println("selectedUser: " + user);
    context.getExternalContext().getSessionMap().put("selectedUser", user);
    return "navToUser";
    --- User.java ---------------------------------------------
    package jsf.test;
    public class User
    private String loginName;
    private String firstName;
    private String lastName;
    public User()
    public User(String loginName, String firstName, String lastName)
    this.loginName = loginName;
    this.firstName = firstName;
    this.lastName = lastName;
    public String getLoginName()
    return loginName;
    public void setLoginName(String loginName)
    this.loginName = loginName;
    public String getFirstName()
    return firstName;
    public void setFirstName(String firstName)
    this.firstName = firstName;
    public String getLastName()
    return lastName;
    public void setLastName(String lastName)
    this.lastName = lastName;
    public String update()
    System.out.println("user update: " + this);
    return "navToUsers";
    public String toString()
    return firstName + " " + lastName;
    --- users.jsp ---------------------------------------------
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <html>
    <body>
    <f:view>
    <h:form id="selectUser">
    <b>Users</b><p>
    <h:dataTable id="users" value="#{users.users}" var="user">
    <h:column>
    <f:facet name="header">
    <h:outputText value="Login Name" />
    </f:facet>
    <h:commandLink action="#{users.edit}">
    <h:outputText value="#{user.loginName}"/>
    </h:commandLink>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="First Name" />
    </f:facet>
    <h:commandLink action="#{users.edit}">
    <h:outputText value="#{user.firstName}"/>
    </h:commandLink>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Last Name" />
    </f:facet>
    <h:commandLink action="#{users.edit}">
    <h:outputText value="#{user.lastName}"/>
    </h:commandLink>
    </h:column>
    </h:dataTable>
    </h:form>
    </f:view>
    </body>
    </html>
    --- user.jsp ---------------------------------------------
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <html>
    <body>
    <f:view>
    <h:form>
    <b>User</b><p>
    <h:panelGrid columns="2" cellpadding="5">
    <h:outputText value="Login Name" />
         <h:inputText id="lognName" value="#{selectedUser.loginName}"/>
    <h:outputText value="First Name" />
         <h:inputText id="firstName" value="#{selectedUser.firstName}"/>
    <h:outputText value="Last Name" />
         <h:inputText id="lastName" value="#{selectedUser.lastName}"/>
    <h:outputText value=" " />
    <h:panelGroup>
    <h:commandButton action="navToUsers" value="Cancel" immediate="true"/>
    <%-- <h:commandButton type="reset" onclick="window.location.href='/faces/users.jsp'" value="Cancel"/> --%>
    <h:outputText value=" " />
    <h:commandButton action="#{selectedUser.update}" value="OK"/>
    </h:panelGroup>
    </h:panelGrid>
    </h:form>
    </f:view>
    </body>
    </html>
    --- faces-config.xml ---------------------------------------------
    <managed-bean>
    <description>
    Bean for TEST users.
    </description>
    <managed-bean-name>users</managed-bean-name>
    <managed-bean-class>jsf.test.Users</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    <managed-bean>
    <description>
    Bean for TEST user.
    </description>
    <managed-bean-name>user</managed-bean-name>
    <managed-bean-class>jsf.test.User</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    <navigation-rule>
    <from-view-id>/users.jsp</from-view-id>
    <navigation-case>
    <from-outcome>navToUser</from-outcome>
    <to-view-id>/faces/user.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    <navigation-rule>
    <from-view-id>/user.jsp</from-view-id>
    <navigation-case>
    <from-outcome>navToUsers</from-outcome>
    <to-view-id>/faces/users.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>

  • Problems with CFNoCache=TRUE

    I have a problem.
    When forms are submitted with action=post the following is appended to the url string &CFNoCache=TRUE.
    I am using cgi.scriptname?cgi.query string in the  form action and it seems that &CFNoCache=TRUE is being passed along invisibly in the query string.
    I have googled this and can't find anything that  helps.
    Anyone know what I can do as it seems to have the knock on effect of clearing sessions which is causiohg me grief.
    Thanks

    I have had similar problems with same error messages. I've concluded that this problem ocurred due to different versions between SQLLoader and Data Base server and the way OWB invokes SQLLDR during a direct path loading.
    You said you use OWB10 against a 9.2.0.4 database. If you see at OWB10 home you will see at "bin" folder an SQLLDR.EXE, and the version of this SQLLDR is 10.x.x. which does not correspond to de database version.
    If you review the folder "OWB10home\owb\log" you will see log files with the name of the runtime repository and a version number. Please check the one that corresponds to the time of sqlloader execution and you will see that OWB build up a command line using "OWB10home\bin\sqlldr.exe" and due version differences between SQLLoader and the database an error is raised. When you run sqlldr from the owb home through the command line, probably you are reaching the correct version of SQLLDR due to your machine path. Verify which version is used at the log file.
    I could not find where it can be changed the definition of the sqlldr command line, at configure of mappings?, changing paths?, etc. So, the only workaround that I have found was to use OWB 9.2 against a 9.2 database if I will use SQLLoader and uninstalled OWB10g.
    If anybody knows how to solve this problem when OWB 10g is used please let us know.
    Hoping this will help you.
    Emilio Montecinos

  • Problem with "required" attribute in inputBox

    Hi ,
    I have a requirement where a input field needs to be populated using lookup.
    I am using commandButton to populate the input field.Since I dont want user to type anything in this input Field , I have made this field readOnly.
    This is a mandatory field so I have put required attribute true.But on the click of submit button this validation does not trigger.If I make remove readOnly attribute or make it false, the validation triggers.Here is the snippet for this part.
    <afh:rowLayout>
    <afh:cellFormat halign="right" >
    <af:commandButton id="lookupFrom_buttonId" text="From Mfg:"
    action="dialog:company.selectBox"
    immediate="true" windowWidth="390" windowHeight="550"
    launchListener="#{mfgReassignBean.addParameter}"
    returnListener="#{mfgReassignBean.returnFromMfr}"
    partialSubmit="true" useWindow="true"
    >
    </af:commandButton>
    </afh:cellFormat>
    <af:inputText
    partialTriggers="lookupFrom_buttonId"
    readOnly="true"
    required="true"
    binding="#{mfgReassignBean.fromDeveloperInput}"
    value="#{mfgReassignBean.assignmentRule.fromMfgName}"
    />
    </afh:rowLayout>
    has anybody faced such situation...any suggestions ?
    Thanks!!

    disabled and readonly fields are discarded from the JSF stack and thus not validated! Options are: make readonly field not readonly on form submit or copy readonly field to hidden field (both involve client side javascript)

  • Problem with Required fields in Panel Tabbed

    Hi ,
    I am using Jdeveloper 11.1.1.2 and i created a jspx page in which i am using <af:panel Tabbed> which has 2 <af:showDetailItem> items.
    Here the problem is in each show detail item i have selectOneChoice set as required fileds. when i am runnin the page and click the second tab it is asking to select a value for SOC.
    Can anyone help me in how to make required fileds show only for that <showdetailitem> item but not for both the showdetailitems.
    Thanks,
    Harika.

    Set the immediate property for the tab to be true.
    Similar forum post:
    Issue with Panel Tabbed and required property
    Thanks,
    Navaneeth

  • Problem with setTransient(true)  JSF tree method

    Hi all,
    I have created dynamic tree .
    I am parsing the Parent and Child nodes and constructing the tree.
    I am using my own method treeSlectionHandler() for event handling for which i am using MethodBinding class and getCookieSelectedNode() method.
    Here is the problem ,whenever I delete or add any node from/into database change did not reflected in the tree .
    So I am using setTransient(true) which is able to reflect the database changes.
    I have one JSP(tree page) with this tree and one button on this page .I am calling tree.setTransient(tree) inside button action.
    Now I will delete one node from database.
    So I will click the button then which will go to next page.
    Again I will navigate to Tree page through menu.
    If I click any node for the first time it will simply refresh the tree state as in the database (if 10 nodes in database it wil show 10)
    But click action will not work (no check image set)
    But for the very next click the click action works and check image is set.
    So plz suggest me is there any other method to refresh the tree state ?
    I[b] want both tree refresh and click action happen simultaneously.
    I will be thankful if any one suggests me the solution .

    Hello EJP !
    You downloaded the sample to see? I use a button made in the project and not the browser button.
    Note: Sorry if this with some english mistakes but I do not speak very well.

  • Problem with setVisible(true) ??

    Hi All;
    In my application, I am using JFrame and added some component. At last I called setVisible(true); method. But it cann't works.
    Then I tried with show() method. but the result is same.
    Then I tried with isDisplayable() method, but strange ,it is returning false.
    Now my problem is why it is hanging on calling the setVisible() method. or why it is returning false for isDisplayable().
    Can anybody guide me to solve the problem.
    Thanks in advance.
    -Sumeet G

    You should pack() or validate() the frame before
    calling setVisible(). Do pack if you use layout
    managers, validate if you set components size
    manually.

  • Problem with flush=true in the jsp:include tag

    Hello
    I have deployed a JSP based application , based on the apache struts framework. The web server is Sun One Webserver 6 Service Pack4, on a windows 2000 machine
    The same application was tried on SunONE application server 7, and it works without any problem. However in this case the following error , on the page
    javax:servlet.jspexception:Illegal to flush within a custom tag
    Does this mean flush="true" is not allowed within custom tags
    Or is there a workaround for this
    Any help is appreciated
    thanks
    - Aniruddha

    Hi,
    This is a known problem, ��flush before you include�� limitation in JSP 1.1.
    As a result, you have to state flush="true" every time you include a jsp using <jsp:include> tag if you are using JSP1.1.
    Fortunately, it is fixed in JSP1.2. The flush attribute controls flushing. If true, then, if the page output is buffered and the flush attribute is given a ��true�� value, then the buffer is flushed prior to the inclusion, otherwise the buffer is not flushed. The default value for the flush attribute is ��false��.
    Gary Wang
    Developer Technical Support
    SUN Microsystems
    http://www.sun.com/developers/support/

  • Problems with required field

    Hello everybody!
    I'm just makgin my first steps with Visual Composer.
    I created an iView that uses the BAPI "BAPI_DEBTOR_GETDETAIL". I designed an input form that takes the customer number as a required field. The output form then displays some customer details.
    When I execute the iView I get an error message because of the missing entry in the field "custid". How can I configure the application that it waits for an input before it starts searching?

    OK prachi,
    I entered
    NOT ISNULL(@DEBTORID)
    as a trigger for the disabled condition and executed the Dynpro. The form is automatically submitted which leads to an error because the customer number is empty.
    When I try to enter a customer number, the submit button is disabled after I've entered the first digit.
    So, I do not think that disabling the submit button will help. Somehow there should be a way to configure the application so that the form is not automatically submitted. Do you or does anyone else have a suggestion?

  • Problem with immediate="true" used with inputText

    Hi everybody,
    I have two component, A and B, of type inpuText. When A is updated, I want B to be updated according to the value provided in A.
    I have to use immediate=True + context.renderResponse because I'm using some converters and validators because I want to avoid error messages being displayed at that point.
    I'm using partialtrigger to tell B to refresh himself when A changes it's value.
    This doesn't work.
    If I'm using the same code, but with ouputText instead, everything works!
    the code looks like this:
    <af:inputText id="A" styleClass="normalInputText"
    label="A" simple="true"
    value="#{controller.formBean.A}"
    valueChangeListener="#{controller.updateB}"
    autoSubmit="true" immediate="false"/>
    <af:inputText id="netAmount" styleClass="normalInputText"
    label="B" simple="true"
    value="#{controller.formBean.B}"
    partialTriggers="A">
    public void updateGrossPriceDependentFields(ValueChangeEvent event)
    FacesContext context = FacesContext.getCurrentInstance();
    formBean.setA((Long)event.getNewValue());
    if(formBean.getA().intValue() == 0)
    formBean.setB(new Long(222));
    else
    formBean.setB(new Long(0));
    context.renderResponse();
    Any ideas?

    Hi ,
    Just Try with this instead of context.renderResponse();
    Context.addPartialTarget(ComponantNAME);
    So that it will get refreshed
    RHY
    Message was edited by:
    RHY

  • Problem with Require Client Certificate on on IPlanet 6.0 server

    I installed client certificate. When I connect to the server using browser, I get following error........
    You are not authorized to view this page
    You might not have permission to view this directory or page using the credentials you supplied.
    How can I run the server in Verbose mode and see exactly why this error.
    Default error file does not have any information about this rejection.
    Thanks
    Krishna

    The message is cut and paste of what client (IE) shows on the browser.
    But the Server does not show any thing in it;'s log. I don't see any activity. I have Log Verbose On.
    If I change the client certificate on to off it works fine.
    The problem is only when the client certificate is on.
    The client certificate is created using Iplanet Certificate Server as well the server certificate also generated using Iplanet Certificate Server.
    In this case I am not trying to authenticate user in the client certificate just the client certificate is valid or not.
    Thanks for the reply.
    Regards
    Krishna

Maybe you are looking for

  • How to Create the Custom print Quote Report ?

    Hi All, I want to create the custom Print Quote report . I know the below details and referred the below metalinks . Note: 780722.1 - How to Create a Custom Print Quote Template in Oracle Quoting ? https://metalink2.oracle.com/metalink/plsql/ml2_docu

  • Returns PO appearing in VL10B  transaction even after delivery is created with full PO qty

    Hi All, Returns PO is  appearing in VL10B  transaction even after delivery is created with full PO  qty / Regards ab

  • Response structure empty for HTTP to RFC synchronous scenario

    Hi experts, I have a HTTP to RFC synchronous scenario. The request is given to Price List ZBAPI. The input to the BAPI is date, material no, customer no and condition type. The output I am fetcching from access sequence table into the table FINAL  ty

  • Bean Scope in dynamic regions

    JDeveloper Version 11.2.1.3.0 In My Application i have one main URL Invoked Bounded Task flow and i have declared few beans in Pageflowscope in Managed Beans section of Overview tab. in this main task flow i have dragged and dropped other task flows

  • Dynamic Memory Ownership

    Hi, I've been having an issue with allocating and freeing memory in an application I'm developing. Read Thread 1. "GlobalAlloc" a block of memory. 2. Read data from a high speed optical card into the allocated memory. 3. Pass the pointer to the memor