CommandButton and commandLink strange behaving

I use <h:commandButton value="ok" action="{#bean.method}"/>
bean.method returns null to stay on same page. when I run it on localhost everything is OK. when I deploy application on server, then action method is never called and nothing is happend (neither exception)
it same is happend with commandLink

I use <h:commandButton value="ok"
action="{#bean.method}"/> you misplaced '#'.. Try this..
action="#{bean.method}"Message was edited by:
w4c

Similar Messages

  • CommandButton and commandLink behaving differently for file download

    Hello there,
    Hopefully someone can help - I have looked through the existing queries and can't just find what I'm after.
    I have a main record with asociated files - the files are uploaded through my web app and are downloaded from the same page that lists the files in a dataTable. I have a series of commandLinks that display the file names - a user selects the file and it downloads.
    The problem I have is that when a user downloads a file then immediately trys to upload another, they are prompted to download the file that they have already previously downloaded. If however I replace the commandLinks for commandButtons the application behaves correctly.
    I have seen an associated link that mentions similar behaviour (http://blogs.sun.com/tor/entry/creating_downloadable_files), however I do not want to use the command buttons in this manner, and I use an actionListener rather than an action so I may retrieve information from the list of dynamically created files. I am not receiving any errors, just the strange behaviour with commandLinks.
    My code is as follows:
    public void downloadFile(ActionEvent ev) {
    UIData fileList = findParentHtmlDataTable(ev.getComponent());
    AssociatedFile associatedFile = (AssociatedFile) fileList.getRowData();
    String downloadPath = "download path retrieved here...";
    try {
    byte[] fileData = InternalUtil.readFile(downloadPath);
    HttpServletResponse response =
    (HttpServletResponse) getFacesContext().getExternalContext().getResponse();
    response.setHeader("Content-disposition", "attachment; filename=\"" +
    associatedFile.getName() +
    response.setContentLength(fileData.length);
    response.setContentType(associatedFile.getContentType());
    ServletOutputStream out = response.getOutputStream();
    out.write(fileData);
    getFacesContext().getApplication().getStateManager().saveSerializedView(getFacesContext());
    getFacesContext().responseComplete();
    } catch (FileSystemException e) {
    getFacesContext().addMessage("null", new FacesMessage("Error downloading file: " +
    e.getMessage()));
    } catch (IOException e) {
    getFacesContext().addMessage("null", new FacesMessage("Error downloading file: " +
    e.getMessage()));
    Any help would be greatly appreciated!
    Thanks in anticipation, Carl

    Which JSF version are you using? Try upgrading to newer version if needed. http://javaserverfaces.dev.java.net

  • JSF and commandlink, strange comportment (for a newbie)

    Hello everybody, and excuse me for my bad english...
    I am actually working (or learning) JSF. But i'm actually in front of a very strange thing:
    When I have got two commandlinks on a jsp page pointing to the same method bean, the second sems not to be active!
    Maybe my english is not clear, so the following code should be more clear:
    My home.jsp:
    <html>
         <head>
              <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
              <title>home</title>
         </head>
         <body>
              <f:view>
                   <f:subview id="header">
                        <jsp:include page="links.jsp"/>
                   </f:subview>
                   <f:subview id="login">
                        <h:outputText
                             value="A really simple test for login/logout
                                     and display products     for logged in poeple"
                             id="presentation"/>
                        <h:form id="loginForm" rendered="#{userBean.loggedIn=='false'}">
                             <h:outputText value="Username"/><br>
                             <h:inputText value="#{userBean.name}" id="username" required="true"/><br>
                             <h:outputText value="Password"/><br>
                             <h:inputSecret value="#{userBean.password}" id="userpassword" required="true"/><br>
                             <h:commandButton value="Login" action="#{userBean.loginAction}"  />
                             <br>
                        </h:form>
                   </f:subview>
                   <f:subview id="footer">
                        <h:form id="testlink" >
                             <h:outputText value="You can aloso see the user list here:"/>
                             <h:commandLink id="hometousers" action="#{userBean.getAllUserAction}" value="go" />
                           </h:form>
                   </f:subview>
              </f:view>
         </body>
    </html>my links.jsp:
    <f:subview id="header">
         <h:form id="linksform">
              <table>
                   <tr>
                        <td>
                             <h:outputLink id="headertohome"  value="home.jsf">
                                  <f:verbatim> home </f:verbatim>
                             </h:outputLink>
                             <h:commandLink id="headertoproducts"
                                               action="#{productListBean.productsAction}"
                                               rendered="#{userBean.loggedIn=='true'}">
                                  <h:outputText value=" products "/>
                             </h:commandLink>
                             <h:commandLink id="headertousers"
                                               action="#{userBean.getAllUserAction}"
                                               rendered="#{userBean.loggedIn=='true'}">
                                  <h:outputText value=" users "/>
                             </h:commandLink>
                        </td>
                   </tr>
              </table>
         </h:form>
    </f:subview>As you can see, home.jsp include links.jsp, and "idtousers" has the same action than "headertousers".
    When I logg in with the "loginForm", the links included are visible and works fine.
    But, always when I am logged in, the link at the bottom of home.jsp ("testlink") is unusable, it does absolutely nothing (just the # character appears in the url...).
    And when i'm not logged in, the include links does not appear (normal), and the link at the bottom functions well.
    I have tested several things like use several views, subviews, forms... but without results...
    I hope I am clear.
    Have you got any idea?
    Thanks by advance.

    Ok, this is the more simple example possible for this problem.
    I have only two jsp(jsf) files, the first file (just below) caontains two commandlinks used to go on the second (by using the navigation rules with a managed bean).
    The first commandlink works well, but the second doesn't do anything... (I just see the '#' character at the end of the url but nothing happens).
    I use the 1.1 jsf implementation.
    The first jsp file:
              <f:view>
                   <h:form>
                        <h:commandLink action="#{simpleBean.createMsgAction}" value="destination" />
                   </h:form>
                   <h:form>
                        <h:commandLink action="#{simpleBean.createMsgAction}" value="destination" />
                   </h:form>
              </f:view>The second jsp file:
              <f:view>
                   <h:dataTable value="#{simpleBean.msgs}" var="row">
                        <h:column>
                             <f:facet name="header" >
                                  <h:outputText value="string" />
                             </f:facet>
                             <h:outputText value="#{row.msg}"/>
                        </h:column>
                   </h:dataTable>
              </f:view>I was thinking it's maybe a bug of this JSF version, but i haven't had the time to test with the 1.2 .
    Thank you by advance for your help. (I always hope I am clear)

  • Subnit form with out commandButton or commandLink

    Hi
    I have simple form for quick search.
    <h:form >
        <h:inputText id="searchId" value="#{searchBean.searchText}"/>
    </h:form>When I put some text and press Enter then this form is submit. But where I can put submit action (for example action="#{searchBean.doSearch}" ) ? I don't want commandButton or commandLink in this form.
    Best regards

    Add one and hide it using CSS display:none;.

  • Strange behave of IE :(

    I've really a strange behave of IE after installing windows. Whenever I opened IE it only display the downloaded history instead of the browser.
    I want to seek your kind help in this regard.

    Hi,
    Here I give two suggestion, it will be helpful for you:
    Reset Internet Explorer.
    Close Internet Explorer or Windows Explorer that are currently open.
    Open Internet Explorer by clicking the Start button ,
    and then clicking Internet Explorer.
    Click the Tools button, and then click Internet Options.
    Click the Advanced tab, and then click Reset.
    Select the Delete personal settings check box if you would like to remove browsing history, search providers, Accelerators, home pages, and InPrivate Filtering data.
    In the Reset Internet Explorer Settings dialog box, click Reset.
    When Internet Explorer finishes applying default settings, click Close, and then click OK.
    Close Internet Explorer.
    Reinstall Internet Explorer.
    For uninstalling Internet Explorer, follow these steps:
    Click the Start button , type Programs and Features in the search box, and then
    click View installed updates in the left pane.
    Under Uninstall an update, scroll down to the Microsoft Windows section.
    Right-click Windows Internet Explorer 9, click Uninstall, and then, when prompted, click Yes.
    Restart your computer.
    For installing Internet Explorer, follow these steps:
    Go to  Microsoft homepage to download the Internet Explorer webpage.
    Select the language you want to install and your version of Windows, and then click Download.
    In the File Download dialog box, click Run, and then, in the User Account Control dialog box, click Continue.
    Restart your computer.
    Regards
    v-yamliu

  • I have a problem with color prints from photoshop elements 12. The pictures are too light and with strange colors. I have a Canon pixma mg615I0 printer and use mac os X yosemite. The pictures are taken with a coanon eos 550d in the color space sRGB. I hav

    Hi
    I have a problem with color prints from photoshop elements 12. The pictures are too light and with strange colors. I have a Canon pixma mg615I0 printer and use mac os X yosemite. The pictures are taken with a coanon eos 550d in the color space sRGB. I have followed adobes recommendations and have tried both letting the printer respektive photoshop manage the colors. But nothing works. I see that there are different opinions about which is best to do so I tried both. I have the latest printer driver installed. Can anyone help me with this?

    Do the following:
    Print a test page from the printer. Perhaps the print head needs cleaning via its maintenance facility.
    Let the printer manage colors, not PSE
    Calibrate the monitor

  • Html Iframe and CommandLink Target don't working...

    Hi,
    In my application, I have a PanelGrid with 2 columns. The first column have a form with one InputText and CommandLink to submit a form action. The second column have a Html IFrame only. The code is shown below:
    <h:panelGrid border="1" columns="2" columnClasses="main,menu">
            <h:panelGroup>
                <h:form target="body">
                    <h:outputLabel value="Name:" for="communityName"/>
                    <h:inputText id="communityName" value="#{community_searchBean.name}"/>
                    <h:commandLink type="submit" target="main" action="#{community_searchBean.search}" value="Search"/>
                </h:form>
            </h:panelGroup>
            <h:panelGroup>
                <iframe name="body" style="width:100%;height:100%;"></iframe>
            </h:panelGroup>
    </h:panelGrid>
    ...The CommandLink and Form targets point to Html IFrame, but it doesn�t show the action page. How can i resolve this problem? Any Idea?
    Thanks.

    That looks like a problem with the plugin-container process (OOPP).
    It works if I disable OOPP for the Flash plugin and close and restart Firefox.<br />
    I don't know what goes wrong though.
    See http://kb.mozillazine.org/Plugin-container_and_out-of-process_plugins

  • 15" Macbook Pro (Early 2008) Freezing and Acting Strange

    Hello All,
    I don't have the original disks, and cannot run a hardware test, so no idea what is wrong.  My computer will freeze frequently, often times when I am trying to do multiple things, watch video (flash like hulu), or try to access the items like wifi, battery, date/time or spotlight at the top of my screen. The computer also occassionaly will not respond to the trackpad or keyboard.  The sound icon also frequently X's out, and I cannot adjust the volume from my keyboard.
    I have tried an unsuccessful clean install of Lion, was able to recover from Time Capsule, and it was behaving like this even with snow leopard.  Actually, ever since getting a new Logic Board from apple on a previous service. (Sent in for a top case issue, and for some reason they replaced the top case and logic board...)
    I called Apple Care the other day, they reccomended the clean install, but the computer is out of warranty.  My only saving grace would be if this IS actually a logic board issue from there replacement and they were willing to service it again based on that.
    Anybody experience anything similar or have any ideas?
    Thanks.

    Please boot in safe mode and test. Same problems? After testing, reboot as usual (not in safe mode.)
    Mac OS X: Starting up in Safe Mode

  • I have just uploaded the new software and a strange app has appeared on my home screen ( a grey target, panorama thing without the man) there is no title under it and I can't seem to delete it. What is it? Do I need it? How do I delete it?

    I have just uploaded the new software and a strange app has appeared on my home screen ( a grey target, panorama thing without the man) there is no title under it and I can't seem to delete it. What is it? Do I need it? How do I delete it?

    Thanks for responding so quickly!I also tried that and it still didnt' work.I tried to take pictures while using the flash.I think my only option at this point is to go to Apple........

  • I traded my iphone in and now have a new one (iPhone 5) with the same SIM.  Since, I have had some iMessages meant for someone else and some strange things happening on my phone (applications opening by themselves, calls disappearing from log). Any ideas?

    I traded my iphone in and now have a new one (iPhone 5) with the same SIM.  Since, I have had some iMessages meant for someone else and some strange things happening on my phone (applications opening by themselves, calls disappearing from log). Any ideas?

    The answer is very simple: You were not the original owner of the phone. Target sold you a phone that had been returned. You can verify the date of the original sale here: Apple - Support - Check Your Service and Support Coverage. I suspect you will find that the warranty expiration date is not one year from the date that you bought it.

  • I'm affraid I lost my "Word" document of 30 pages. I can see only stars,squares and other strange figures. How can I recover this? Please I need help!!!

    I need help! My daughter is busy with her final studyprogram. Her "word" document changed into stars and other strange figures. Is there a possibility to recover this. I hope someone can help her!!!! thanks jvdharst

    Are you using the latest version of MS Word?  It’s possible you can restore the corrupt file from the last saved version or the automatically saved version.  Have you tried that?  MS Word uses a folder called Autorecover to store temporary versions of your file.  Hopefully there’s a good version in that folder.  Use Finder to search for Autorecover if needed.

  • 1280 dial call list empty and 2 strange sign ???

    1280 dial call list empty and 2 strange sign ???
    Already Tried
    full flash
    full reset
    write pm
    self test
    any solution plz
    also tell me about these 2 sign
    Attachments:
    1280unknownsign.png ‏162 KB
    dialempty.png ‏151 KB

    The second sign is of headset connected. If it is present without any headset connected then contact Nokia Care. The first sign is not that clear. Is it a lock? Also sice when is the dialled number shown as empty? If its recent you will have to contact Nokia care as you've done all that can be done by a user.
    Please mark the post as solution if it solves your problem.
    Current Device - Nokia Lumia 1020/920

  • My fan makes loud and very strange noises.

    Hi again,
    My fan makes loud and very strange noises. Is there any cure for that?
    Thank you!
    Markus

    Hmm... that is strange. There are a couple reasons that I can think of.
    First, go to System Preferences -> Energy Saver -> Processor Performance. See what its set to. If it is currently set to Highest, your fan could be going more often. Turn it down to Reduced or Automatic. Note if there is any difference.
    Secondly, are you all up to date on software updates? The last step was to see if it was a software issue. If it isn't, then you probably have a defective fan. AppleCare?
    Now, you would open your PowerBook. Look in the Apple docs (Support - Manuals) to find how to do it for yourself, or take it to a shop or Apple Store and have them do it. Safest option.
    Look at your fan. Has it come free of the anchor and is hitting against the wall or fan surround?
    Lastly, try keeping the PowerBook in a open, ventilated area. The fan will power up less if the computer stays cooler. For a possibly irritating but possibly helpful option, purchase a product that lifts the PowerBook off your lap or desk. I think Rain Design makes a good one.
    Good luck!

  • Difference between CommandButton and CommandToolbarButton? (Loading popup )

    Hi! I created popup and CommandButton to open it. But when I try to open popup then in Server log I have error:
    <PopupRenderer><encodeAll> Loading popup: pt1:uploadWindow during a full-page request is not supported.
    But when I tried to use CommandToolbarButton, not CommandButton, then the error was gone.
    What is difference between these two buttons?
    Best regards, Debuger!

    Default value of the attribute <tt>partialSubmit</tt> is <tt>false</tt> for <af:commandButton> and <tt>true</tt> for <af:commandToolbarButton> (see tag documentation). That's why you have succeeded by using <af:commandToolbarButton>.
    <af:commandToolbarButton> is intended for use mainly inside <af:toolbar> components. When used in a toolbar the border of the button renders only when you move the mouse cursor over it.
    If you set <tt>partialSubmit="true"</tt> you will be able to open the popup using <af:commandButton> too.

  • Differences between h:commandButton and h:commandLink

    I have a problem with h:commandButton. I want to send parameters when I execute a h:commandButton, but I don't receive anything. With h:commandLink I don't have any problems for receive parameters in the next page. I don't understand why?!?!? any ideas??

    I guess you want to pass some parameter
    which is a constant value defined by the page author,
    is not input by the end user.
    CommandButton can receive information only by the properties of the managed bean.
    Usually the properties are bound to the end user's input.
    But using faces-config.xml, the page author can specify some value
    as the property of a managed bean as follows:
    <faces-config>
        <managed-bean>
            <managed-bean-name>bean</managed-bean-name>
            <managed-bean-class>MyActionBean</managed-bean-class>
            <managed-bean-scope>request</managed-bean-scope>
            <managed-property>
                <property-name>param</property-name>
                <value>Any constant value for the parameter</value>
            </managed-property>
        </managed-bean>
    </faces-config>
    <h:commandButton value="go" action="bean.action"/>In the MyActionBean.action method,
    you can use getParam() to access the value specified in faces-config.xml.
    Otherwise, if you want to place several buttons which call a same action with
    different parameters, you should combine h:dataTable and h:commandButton.

Maybe you are looking for

  • Vendor Material No. and Vendor Batch field in MIGO for GR against Order

    HI,   I received a very specific requirment for one of our client: Client need the field Vendor Material No. and Vendor Batch in the detail data --> material and batch tab in MIGO transcation for A01 (Goods receipt ) against R08 (Order), this is for

  • All files vanished after update!!!!

    i erased all my contents after syncing my phone, then updated it and went to sync it again and all my stuff (more importantly hundreds of songs) have vanished!!!!  And its saying my brothers iphone on the computer when its connected instead of mines!

  • Can not open InDesign cs6 from the Adobe Master Collections CS6.

    I receive a window showing Confituration error: "Please uninstall and reinstall the products.  If this problem still occurs, please contact technical support for help, and mention the error code shown at the bottom of this screen.  Error: 15.  http:/

  • Direct printing of smartform

    hi evrybody How to avoid the print popup for smartform? I want to print directly without preview and popup I dnt know wats the error in my code see my code: Get the function module name of the smartform.     CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'  

  • Second request to a JSP page

    When a second request is made to the JSP page, is the request sent to the servlet directly or is it handled by the JSP page. The question comes bcos when the JSP page is requested for a second time, a copy of the .class file is already available in t