JSF problem on submit event

Hi to everyone and sorry for my english,
i've created a web form using jsf tecnology.
This form contain 2 combo (selectOneMenu) one of this combo contain the region of Italy, so when an user select a region in this combo, on the second combo i'm load the city of this region, for make this i've an onChange event on the first combo this event meke a submit of form, i've also setted the property "immediate" = true.
So when the first combo chenge value if i've in the form a inputText with property required = "true" the form show me the error message "field required", but i've set immediate = "true"?
How i can bypass this problem.
Thanxs a lot,
Fabio.

You should still use a value change listener. Putting db calls into your getters should be a last resort anyways. This is because JSF will call getters multiple times, thus causing you to make multiple DB calls.
Plus, if you don't call renderResponse(), you're going to continue seeing your error message. Setting the immediate attribute doesn't necessarily skip the validation phase, rather, it processes validation in the Apply Request Values phase.
Anyways, messing with the JSF phases can be a tricky concept for a newer person to understand. However, you should learn what you can about the standard JSF lifecycle.
Getting to your problem at hand... The quick version is that you need to create a value change listener, attach it to the first combo box (region1), configure the value change listener to retrieve the appropriate values from DB, then set the second combo box (city1) options, and then call renderResponse().
Here's some code to get you started.
In your jsp:
<h:selectOneMenu id="region1" value="#{userBean.selectedRegion1}"
    onchange="submit" immediate="true"
    valueChangeListener="#{userBean.regionSelected}">
</h:selectOneMenu >In your UserBean class, create the following method:
     public void regionSelected(ValueChangeEvent event)
          throws AbortProcessingException {
          //Get the selected region from the event
          String region = (String)event.getNewValue();
          //Set the selected region in your bean
          setSelectedRegion(region);
          //Call DB to retrieve the city list for the selected region
          //Build Select Items list from record set
          //Set the city list with the new select items
          setCityList(newCityList);
          //Force to render response phase so that any error messages DO NOT get
          //displayed. i.e. Skip update model phase. Use immediate="true" on the
          //component that calls this valueChangeListener so that it does not
          //run any validation.
          FacesContext.getCurrentInstance().renderResponse();
     }That should get you good and started.
CowKing

Similar Messages

  • Insertfrom.jsf problem on submit

    Hi Everyone,
    I appreciate if anyone can give me a clue on what could be the problem. I wasted few hours on this without any sign on resolving the problem. I have a form with data fields that are filled and submitted. There is validation check on each field if its empty or not. Most of the fields cannot be empty. The problem is that the script is not working on all the computers that are on the same LAN. When I click on submit the script simply times out and gives blank web page with error. Strangely on couple of computers it works and on three other computers it doesn't. All computers are on the same switch same LAN. I tried installing java for desktop but it did not make any difference. The problem persist on any browser that is used on those PCs. I disabled all firewalls and security programs and problem is still there. I appreciate if anyone can give me an idea what could be the problem, am I missing some add-on, is it a specific windows issue, dont know.
    Thanks
    Alex

    Sounds like it may be an issue with the network topology. Can machine X ping the server? Can it access other services on the same machine? If you run a simple web server on the same port can you get pages back? Etc., etc...

  • Interactive form - Submit event - NetWeaver 2004s

    I have problems with Submit event of UI element InteractiveForm in "SAP NetWeaver 2004s" box.
    The event doesn't get filred.
    I have no problems with the identical Webdynpro/Form in "SAP ECC 6.0" box. Submit event gets fired in ECC.
    Both wendynpro's has UI InteractiveForm properties:
    dispalyType = native
    Enables = checked
    Both forms have ZCI layout, ContainerFoundation_JS loaded and Submit button from WebDynproNative library.
    It seems like Webdynpro in Netweaver box doesn't understand UI Interactive.
    Webdynpro Support package is missing?
    Please advice.
    Thank you
    Tatyana

    Chris,
    From SPAM  I can tell about the component SAP_BASIS.
    in "ECC 6.0" box:
    Software C = 700,  SP-level = 0020, Support Package = SAPKB70020, Short Desc = "SAP Basis Component"
    in "SAP NetWeaver 2004s" box:
    Software C = 700,  SP-level = 0017, Support Package = SAPKB70017, Short Desc = "SAP Basis Component".
    ADS is a standalone server.  It talks to both "ECC 6.0" box and "SAP NetWeaver 2004s" box.
    I don't understand your question "Both are NW7.00 boxes? ".
    Both boxes have a component called SAP_BW. Here is info from SPAM:
    in "ECC 6.0" box:
    Software C = 700,  SP-level = 0020, Support Package = SAPKW70020, Short Desc = "SAP Netweaver BI 7.0"
    in "SAP NetWeaver 2004s" box:
    Software C = 700,  SP-level = 0019, Support Package = SAPKW70019, Short Desc = "SAP Netweaver BI 7.0"
    Tatyana

  • Jsf problem go from jsp page to another jsp in new window

    I’ve two jsp pages attendReport.jsp and printAttendReport.jsp
    attendReport.jsp contains inputs for attend duration and employee id and command button “view” to view attendance data entered employee during entered duration inside the same page(this work very good)
    the problem is the same page includes another command button “print” its job is to get the same data but view them in the second page printAttendReport.jsp in another window in order to print the data in some suitable format , but the print button opens attendReport.jsp instead of printAttendReport.jsp and does not hold the inputs else if I set <managed-bean-scope> to session not request which cause caching data , please help me if you to solve this problem
    and here the related lines of code
    <faces-config >
    <managed-bean>
    <managed-bean-name>attendReportBean</managed-bean-name>
    <managed-bean-class>csc.attend.bean.AttendReportBean</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    <navigation-rule>
    <from-view-id>/attend/attendReport.jsp</from-view-id>
    <navigation-case>
    <from-action>#{AttendReportBean.attendReport}</from-action>
    <from-outcome>attendReport</from-outcome>
    <to-view-id>/attend/attendReport.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    <navigation-rule>
    <from-view-id>/attend/attendReport.jsp</from-view-id>
    <navigation-case>
    <from-action>#{AttendReportBean.printAttendReportAction}</from-action>
    <from-outcome>printAttendReportAction</from-outcome>
    <to-view-id>/attend/printAttendReport.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    </faces-config> // here is managed bean code
    public class AttendReportBean {
    // data , getters and setters
    init();
    //Preload in initialization block.
    public void init() {
    // initialize data
    public String attendReport() {
    // code to get attend data to go to view page(same page) it is ok
    return "attendReport"; // Navigation case.
    public static String getRequestParameter(String name) {
    return (String) FacesContext.getCurrentInstance().getExternalContext()
    .getRequestParameterMap().get(name);
    public void printAttendReportListener(ActionEvent event) {
    String fromYearStr = getRequestParameter("fromYearAtt");
    System.out.println("fromYearStr = "+fromYearStr);
    // try to get inputs through ActionListener but it gives me null
    public String printAttendReportAction() {
    // code to get attend data to go to print page(another page in new //window) but inputs come in default values
    return "printAttendReportAction"; // Navigation case.
    }attendReport.jsp
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <f:view>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    //title . styles and validations //
    </head>
    <body>
    <h:form id="attendReportForm">/the form tag appear in running source as <form id="attendReportForm" method="post" action="/newdiwan/faces/attend/attendReport.jsp" enctype="application/x-www-form-urlencoded" >
    i.e. it always submit to attendReport.jsp page
    / some inputs and outputs /
    <h:commandButton onclick="return check();" id="view" action="#{attendReportBean.attendReport}" value="" styleClass="linksNumBlue" />//it works good/
    // some outputs to view data /
    <h:commandLink immediate="true" id="printLink" value="" action="#{attendReportBean.printAttendReportAction}" actionListener="#{attendReportBean.printAttendReportListener}" target="_blank" styleClass="linksNumBlue">
        <f:attribute  name="fromYearAtt" value="2009" />
        <f:attribute  name="fromMonth" value="01" />
       <f:attribute  name="toYear" value="2010" />
       <f:attribute  name="toMonth" value="06" />
    </h:commandLink>//this has two problems 1)submit to attendReport.jsp not printAttendReport.jsp which I want to go to.
    //2)does not get the inputs but return the default values only /
    </h:form></body></html></f:view>I use libraries { jsf-api.jar , jsf-impl.jar , jstl-1.1.0.jar and tomahawk-1.1.6.jar } and deploy on tomcat 6.0
    I’m sorry for the prolongation, please help me if you can
    Edited by: alynoor on Jul 8, 2010 1:51 AM
    Edited by: alynoor on Jul 8, 2010 1:55 AM

    my problem solved 1- i use 2 managed bean , one of request scope (used in attendReport.jsp ) and the other with session scope (used in printAttendReport.jsp)
    2 - add new jsp contains the h:commandLink of the print (attendReportPrintAction.jsp)
    3 - divide the view of attendReport.jsp to two subviews (each subview has its own form) one contains inputs and outputs of attend and the other contains include to (attendReportPrintAction.jsp)
    <%@ include file="attendReportPrintAction.jsp" %>
    4 - send and get parameters using two methods
                public static Object getSessionMapValue(String key) {
                   return FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get(key);
                public static void setSessionMapValue(String key, Object value) {
                   FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put(key, value);
                }faces-config.xml
       <managed-bean>
          <managed-bean-name>attendReportBean</managed-bean-name>
          <managed-bean-class>csc.attend.bean.AttendReportBean</managed-bean-class>
          <managed-bean-scope>request</managed-bean-scope>
       </managed-bean>
        <managed-bean>
          <managed-bean-name>print_attendReportBean</managed-bean-name>
          <managed-bean-class>csc.attend.bean.AttendReportBean</managed-bean-class>
          <managed-bean-scope>session</managed-bean-scope>
       </managed-bean>
    <navigation-rule>  
        <display-name>viewReport</display-name>  
        <from-view-id>/attend/attendReport.jsp</from-view-id>  
        <navigation-case>  
            <from-action>#{AttendReportBean.attendReport}</from-action>
            <from-outcome>attendReport</from-outcome>  
            <to-view-id>/attend/attendReport.jsp</to-view-id>  
        </navigation-case>  
    </navigation-rule>
    <navigation-rule>  
        <display-name>printReport</display-name>
        <from-view-id>/attend/attendReport.jsp</from-view-id>  
        <navigation-case>  
            <from-outcome>printAttendReportAction</from-outcome>  
            <to-view-id>/attend/printAttendReport.jsp</to-view-id>  
        </navigation-case>  
    </navigation-rule>attendReportPrintAction.jsp
    <f:subview id="printAttendReportSubView" >
    <h:form id="printAttendReportForm" onsubmit="return check222();" >
                                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                  <tr>
                                    <td width="11%">
                                    <table width="70" border="0" cellpadding="0" cellspacing="0">
                                        <tr>
                                          <td width="7" height="28"><img src="../images/B-left.gif" width="7" height="28" /></td>
                                          <td align="center" background="../images/B-bg.gif">
                                            <!--a href="printAttendReport.jsp" class="linksNumBlue" target="_blank" >&#1591;&#1576;&#1575;&#1593;&#1577;</a-->
    <h:commandLink id="printLink" value="&#1591;&#1576;&#1575;&#1593;&#1577;" title="&#1591;&#1576;&#1575;&#1593;&#1577;"  action="#{print_attendReportBean.printAttendReportAction}"   target="_blank"  styleClass="linksNumBlue">
                                        </h:commandLink>
                                            </td>
                                          <td width="7" height="28"><img src="../images/B-right.gif" width="7" height="28" /></td>
                                        </tr>
                                      </table>
                                      </td>
                                    <td align="right"> </td>
                                  </tr>
                                </table>
    </h:form>
    </f:subview>i hope this helps someone

  • Problem with submit button in wweb dynpro abap

    hi all,
                we have problem in submit of our interactive form in web dynpro abap.
    my scenario.
                             on event submit we have to fetch data from database table and display the same.
    On click of the SUBMIT button for the first time it fetches data but when we change the input field and submit again it dsnt trigger the event(We need to double click only then event is triggered).
    Can anyone guide us on how to fetch the data at single click.
    Thanks and Regards
    Vinoth

    The form is open. I should have mentioned that I made sure to check that first.  The form was created by uploading an existing PDF file that I created from a MS Word file to Adobe FormsCentral. Once the form was completed, I had a coworker test it & it worked.  We sent the form out & I have received some back, but have also received reports of the form not working.  I downloaded the form to my computer & tested it using Adobe Acrobat 9.0 Standard.  I use a Windows environment on a Dell laptop.  The form does not work for me.

  • At event calendering site, getting message "There was a problem with your event submission. If you have disabled JavaScript please enable it and try your submission again." Javascript is ENABLED on my computer.

    I'm trying to submit an event to the events calendar at http://calendar.jtnews.net/events/index.php?com=submit. After I enter the Authentication words and press Enter, I get the message, "There was a problem with your event submission. If you have disabled JavaScript please enable it and try your submission again." According to my Firefox/Tools, etc., button, Javascript is enabled. I

    Hello mjswooosh,
    I'm very disheartened to hear that you've had ongoing problems when attempting to order from BestBuy.com. Our goal is ever to provide a fun and efficient shopping environment! Certainly creating aggravation serves neither you nor us and I apologize sincerely for this having been your experience.
    We recommend the troubleshooting steps you mentioned (i.e., clearing the browser cache, deleting temporary internet files and cookies) because this is the most common cause of this type of problem. I too have encountered this issue from time to time and these steps have almost always resolved the problem. I say almost always because there's one further step you can try: ensure that you have signed out of BestBuy.com, then perform the browser maintenance steps we've recommended. Afterward, before signing in to BestBuy.com, add your desired items to your cart and sign in as part of the checkout process. When the standard steps have not netted a resolution for me, this has solved the problem each time.
    I hope this helps. I'm very grateful that you took the time to write to us with your concerns and for sharing your very valuable feedback about your online experience.
    Sincerely,
    John|Social Media Specialist | Best Buy® Corporate
     Private Message

  • Submit event raised automatically

    Hello,
    In my model, I have, in order, one form view , one java web service , and a table view. When I click on submit button from the form view, it sends parameters to web service which returns data in the table view.
    My problem is, when I open the form view from the portal, a submit event is raised automatically even if I don't click on the submit button.
    I would like to know if there is a solution to disable this auto submit.
    Thank you.

    Hi Marcel,
    I use system action "Submit form" and also custom action and I have the same thing. When I execute remote debugging with NWDS and when  I reach my model from portal, my web service is executed automatically and stopped at my breakpoint in java code enven if I don't click on submit button.
    Regards.

  • On Submit event processing

    Hi all,
    I'm facing a problem to make a plsql process start only when I insert a row in a tabular form.
    I created a tabular form and a after submit plsql process, as well.
    The problem is that plsql process start every submit event. I want it to start only after insert a new row and submit it.
    Is this possible ?
    thanks in advance.

    Yes I have.
    But it triggers event every submit pressure. I'd like to avoid triggering when no really actions occurs.

  • I have no problems copying iMovie Events from one Mac to another, however, how can I copy iMovie Projects from one Mac to another?

    I have no problems copying iMovie Events from one Mac to another, however, how can I copy iMovie Projects from one Mac to another?  Any help will be appreciated.  Thank you.

    This should give you some good insight, I'd probably store them on an External HD on the old machine and then just drag and drop to the new machine.
    https://discussions.apple.com/docs/DOC-4141

  • How can I navigate to a specific tab from a portlet submit event?

    I have a page with two tabs on it. Each tab contains a region with two portlets, a simple parameter form and an OmniPortlet containing some PL/SQL code for a database query.
    The first tab is used to search by name - users enter a name, click the Submit button and the page parameter is passed to the database query. The Submit event is set up to "Go to page:" and passes the output of the parameter form back into the page when it is redisplayed.
    The second tab has been setup to search by department and has a simple parameter form containing a LOV for departments. However I can find no way to target the second tab in the Submit event for this parameter form.

    I think the unfortunate answer is to create your own Portlet(Java/PL/SQL) to do this. You can then specify the URL for the submit. This will then allow you to set the page parameters that the event is doing for you.
    Another option, don't use tabs. Just create seperate pages with a JavaScript / HTML banner that would mimic the TAB functionality.
    I am a bit disappointed that this does not work out of the box. But, regardless, I will be needing dynamic parameters anyways as static just does not cut it.

  • ICal error "There was a problem receiving this event invitation"

    Whenever I try accepting an event invitation I get a dialog prompt that says
    *There was a problem receiving this event invitation*
    Someone invited you to an event using an email address that isnt on your "me" card in Address Book. Find your email address in the following list and add it to your card in Address Book
    Problem is I've done that, my vCard is up to date. It was working fine, I cant recieve any invites anymore, wether they come from OSX or Windows. Can anyone help?

    I ran into this same issue. To resolve this, go into the Address Book application. Select the vCard that is "your" card. Now in the menu bar, go to "Card". On the drop down menu, select "Make this my card". You should now be able to accept iCal invitations without any issues. When I upgraded to 10.5.1 the issue came back and this method seemed to resolve it.

  • How do I identify a problem in an event?

    Friends,
    I've updated to FCP X 10.1.  An event that I created after updating and for which I created a project suddenly displayed a yellow hazard symbol next to the name of the event.  This suggests that there is some sort of problem with the event or project.  How can I identify more specifically what the problem is?  Everything looks good when I look at the event and enclosed project.
    Thanks!
    Steve

    It means at least one peice of media is offline, and needs to be relinked.
    Select the Event, go to File > Relink Files, then swith from All to Missing Files.  You can then relink anything that is offline.

  • Submit event doesn't raised while creating vc application

    Hi Masters,
    I am developing a web service based visual composer application. Here iam making a connection from output port of a form to two input ports of data service. While deploying application ,it shows warnings like "event submit is declared but cannot be raised.
    Even here if i try to click on the arrow link at the end of output port ,in the event selector it is not showing event submit.Also in the layout tab, it is not showing submit button.
    Please help me.

    1. Make sure you have a "submit" event on the line connecting the form to the data service.
    2. Make sure that you have a submit button in your form with the action specified as "submit".
    The second step is probably what you're missing.

  • Submit event in Interactive Form element

    I have WDA with Interactive Form element.
    I put a code onSubmit event of InteractiveForm element.
    I tried several Submit buttons in Live Cycle Designer:
    type Button with Submit option from Standard library and  type Submit to SAP from Native library.
    None of them generates Submit event
    Ehat kind of special "special Adobe Web Dynpro submit button" the Help is talking about?
    Here is an excerpt from WDA help:
    onSubmit
    Describes the action to be executed when the user selects the Submit pushbutton.
    Note that the submit event is only evaluated when there a submit button is selected
    within the form. "Within" means that the special Adobe Web Dynpro submit button has
    been included in the Adobe Designer.
    Thanks,
    Tatyana

    Hello Siva,
    In Interactive Form ,you can place as much submit buttons as you want.
    You are creating a simple calculator in adobe...Right..?
    For this purpose ,
    1. In Adobe Interactive Form, Go to WebDynproActiveX  field and from this ,select 4 submit buttons in sequence
    2.In Caption property label them as Add, Sub, Mul & Div respectively.
    Reply if these steps work for you.
    Best Regards,
    Shital.

  • Problems with close event scripts and closing Photoshop

    Hi!
    We are having problems with close event scripts ("Cls ") when closing/quitting Photoshop.
    The close event scripts are working without problem when closing an image. But when quitting Photoshop without having closed all images we are observing the following behaviour:
    with CS2 the close event scripts are not triggered at all
    with CS4  the close event scripts are triggered and executed correctly. But after that the Photshop process freezes. No visible GUI, you have to kill the process with the task manager.
    I can reproduce this behaviour even with a small script consisting of a single alert('hello') and even an empty script. Is this an known bug or am I doing something wrong?
    Thanks for your help!
      Eric

    Check your energy saver settings under system preferences. That is where you set sleep setting.

Maybe you are looking for

  • Text in Table - changing size in table

    Hi, I've migrated from go-live to DWCS3. http://www.mnuzzo.com/routing.html Is the page I've been editing. I added a row - the one that appears shifted (nebraska) The old table editor is different in DW - as compared to GoLive. (is there a way to see

  • Apple Configurator Wi-Fi password bug? or just need to RTFM?

    I've been playing around with the new Apple Configurator for a few days now and have run into a problem when creating profiles that I want to install on a few iPad 2s.  I'm either doing something fundamentally wrong and need to RTFM more closely, or

  • How to handle double click in a table control?

    Hi, Can any one let me how to handle double click event in a table control in dialog programming? here i need to navigate to another screen when user double click on the table contols (emp number column). thanks in advance, PrasadBabu.

  • Oc4j with xerces

    Hi, i have to use xerces with oc4j but i get such an error when starting the application server: org.apache.commons.digester.Digester - Digester.getParser: org.xml.sax.SAXNotRecognizedException: http://apache.org/xml/features/validation/dynamic at or

  • Sharing large [3.5 gb] videos for viewing on other computers [for sending overseas on flashdrives]

    I've made a video of my tour of Andalucia, and I'd like to share it with my companions on the tour. I've convinced PE 12 to burn a BluRay disc that looks excellent for viewing at home. Now I'd like to make a HD version that I can copy to flashdrives