CommandLink doesn't work with rendered-attribute

Hello,
I have quite a strange problem.
I have a commanLink, which has a rendered attribute. The link is rendered conditionally, so the rendered-value comes from a bean.
<h:commandLink rendered="#{Bean.canEdit}" action="#{Bean.selectDocumentToEdit}" >
           <h:outputText value="Edit doc" />
                          <f:param name="param" value="#{Bean.doc.id}"/>
</h:commandLink>Showing the link is working like it should, but commandLink is not working with this. When I change rendered="true", commandLink works ok. But now it doesn't call the commandLink action at all.
Any help would be appreciated

rendered="true", commandLink works ok. But now it
doesn't call the commandLink action at all.I meant it doesn't call the commandLink action method when retrieving rendered-value from bean.
I'm using RI 1.1.01

Similar Messages

  • Value binding not working with rendered attribute

    In my jsf page i'm encountering problem with value binding it is not working for a h:inputText with rendered condition even when the rendered condition evaluates to true & the component is rendered.While trying to retrieve the value of the components with conditional rendering on submit i'm unable to retreive the value while on removing rendered condition the value binding is working perfectly
    <h:selectOneMenu id="DropDown" value="#pc_GeneralRequestInfo.objInfoDTO.State}" rendered="#pc_GeneralRequestInfo.objAddressRequestDetailsDTO.selectedAddressType == 'HOME'}">                    
    <f:selectItems value="#{pc_GeneralRequestInfo.statesList}" />
    </h:selectOneMenu>

    There is a { missing from the value attribute in the code you posted.                                                                                                                                                                                           

  • One reason why commandLink doesn't work in dataTable

    Ok, so I think I've got an explanation why commandLink doesn't work in dataTable when the model bean is request scoped. Maybe somebody can tell me if I'm wrong.
    I have a model bean that generates table rows based on some input criteria (request parameters).
    So, we validate the inputs, apply them to the bean and render the page. Once the inputs have been applied to the bean, a request for table rows returns rows, no problem.
    However, we put a commandLink in each row, so we can expand the details. Maybe we even get smart and repeat the input row-generating criteria as a hidden field in the page.
    Unfortunately, when the user hits the commandLink, the list page simply refreshes, maybe even w/out table rows. The user doesn't get the details page as expected.
    Why not?
    Because: in the DECODE phase (even before validation and before "immediate" values have had their valueChangeListeners called), we ask the model bean for the table rows, so we can decode the commandLinks. Unfortunately, in "decode" phase, the request-scoped model bean has not had its row-generating criteria updated (that happens in the "update model" normally, or at the END of the decode phase if we got cute by (1) setting the "immediate" attribute on the row-generating criteria to "true" AND (2) set a valueChangeListener to allow us to update the model bean early. The END of the decode phase isn't good enough -- in the middle of that phase, when we're attempting to deocde commandLinks, the model bean has no citeria, so there's no row data. No row data means no iteration over commandLinks to decode them and queue ActionEvents. So, we march through the rest of the phases, process no events, and return to the screen of origin (the list screen) with no errors.
    So, what's the solution?
    One solution is to make the model bean session-scoped. Fine, maybe we can store a tiny bit of data in it (the search criteria), so it's not such a memory drag to have it live in the session forever. How do we get that data in? A managed property in faces-config.xml with value #{param.PARENT_KEY} won't work because it's assigning request-scoped data to a session-scoped holder. JBoss balks, and rightly so. Do we write code in the model bean that pulls the request parameter out of thin air? (FacesContext.getExternalContext()....) I don't really like to code the name of a specific http request parameter into the bean, I think it's the job of the JSP or faces-config.xml to achieve that binding (request parameter to model propery). Plus, I'd be sad to introduce a dependency on Faces in what was previously just a bean.
    Is there a better way?
    In my particular situation, we're grafting some Faces pages onto an already-existing non-Faces application. I don't get the luxury of presenting the user an input field and binding it to a bean. All I've got to work with is a request parameter.
    Hmm, I guess I just answered my own question. if all I've got to work with is a request parameter, some ugliness is inevitable, I guess.
    I guess the best fix is to cheat and have the bean constructor look for a request parameter. If it finds it, it initializes the criteria field (which, in my case, is the key of an object that has a bunch of associated objects (the rows data), but could be more-general d/b search criteria).
    (I looked at the "repeater" example code in the RI, but it basically statically-generates its data and then uses 100% Faces (of course) to manage the paging (where "page number" is essentially the "criteria").
    Comments? Did I miss something obvious?
    John.

    ...or I could just break down and do the thing I was hoping to avoid (outputLink instead of commandLink):
    <h:outputLink value="/faces/Detail.jsp">
      <f:param name="PARENT_KEY" value="#{bean.parentKey}"/>
      <h:outputText value="#{bean.label}"/>
    </h:outputLink>It's still a "hardcoded" parameter name, but at least the binding is in the JSP and faces-config.xml, not the bean Java code.

  • Why EL doesn't work with custom tags ?!

    I don't know why expression lang. doesn't work with me.
    here's an example, and please tell me why :
    --- the jsp page with EL ==> doesn't work :
    <%-- In the name of ALLAH most gacious most merciful --%>
    <%@ page language="java" %>
    <%@ taglib uri="/cartlib" prefix="cart" %>
    <html>
    <jsp:useBean id="product" class="ch16.cart.ProductCatalog" scope="application" />
    <cart:showCatalog productCatalog="${product}" addToShoppingCartUri="<%= response.encodeURL("AddToShoppingCart.jsp") %>" />
    </html>
    when using expressions instead, the page works .
    the new page is :
    <%-- In the name of ALLAH most gacious most merciful --%>
    <%@ page language="java" %>
    <%@ taglib uri="/cartlib" prefix="cart" %>
    <html>
    <jsp:useBean id="product" class="ch16.cart.ProductCatalog" scope="application" />
    <cart:showCatalog productCatalog="<%= product %>"
    addToShoppingCartUri="<%=
    response.encodeURL("AddToShoppingCart.jsp") %>" />
    </html>
    The error was :
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: jsp.error.beans.property.conversion
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper
    .java:512)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    org.apache.jasper.JasperException: jsp.error.beans.property.conversion
    org.apache.jasper.runtime.JspRuntimeLibrary.getValueFromPropertyEditorManager(Js
    pRuntimeLibrary.java:885)
    org.apache.jsp.ShowProductCatalog_jsp._jspService(ShowProductCatalog_jsp.java:77
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.

    Regarding setup, see this post reply #6
    http://forum.java.sun.com/thread.jspa?threadID=629437&tstart=0
    Other potential things to check: make sure you are getting the right value passed in
    productCatalog="${applicationScope.product}"
    ${product} by preference would take a pageContext, request or session attribute before the application level one (it uses pageContext.findAttribute).
    What do you get if you just print out ${product} on the screen?
    It should call a toString() on it for rendering purposes.

  • Problem with rerendering h:panelGrid with rendered attribute

    Hi,
    I am new to jsf and trying to learn its features as I find it easy and fast for development purpose.I have been developing with jsf for past few weeks and got myself stuck with a problem, tired of which I had to take the forum's help :). My problem is that I need to show/hide h:panelGrid using any of the options below:
    I tried putting the grid in the div and show/hide that div using javascript..works fine but the problem with this is, even when the div is hidden the components (h:inputText ) within the grid are submitted with the form, which should not be the case since its hidden (as with normal jsps).
    I worked around with rendered attribute of the grid, and show/hide this grid using the backing bean method which is actually a valueChangeListener of h:selectOneMenu and set the boolean for the rendered to true/false as required, the grid is hide/shown correctly, but this isn't giving me any solution because when I submit the form with this grid shown on the view, its components values are still not submitted :( I dont know whats the reason behind this or what clue am I missing here. I dont know why when the grid is shown correclty, its components values are not submitted.. hence not validated too..
    Any help will be highly appreciable.
    Regards
    srehman

    >
    gimbal2 wrote:
    No, in "normal jsps" you'll get the same thing - even though you
    visibly hide a component, it is still there and thus will still be part
    of a form submit. If you don't want form fields to submit, you'll have
    to make sure they are physically not there, or the fields are disabled.Well thanks alot for correcting me on this mate.
    Don't know either, it should work if you did everything correctly. Are
    you sure the databinding (to a JSF backing bean field) of the grid is
    correct? When you create a similar setup but without any of the
    show/hide logic, does it work then?I guess I have done it correctly but let me tell you, I have no direct binding to the grid itself, instead I have h:inputText fields in the grid that are bound to the backing bean's properties, which I need to submit and validate too. e.g{color:#800000}<h:panelGrid id="myPanel" columns="3" rendered="Bean.renderStatus">
    <h:outputText value="variable"/>
    <h:inputText id="v" value="Bean.property" required="true">
    <a4j:support ......... />
    </h:inputText>
    </h:panelGrid>{color}
    {color:#800000}<rich:message for="v"/>{color}
    Here I am able to hide and show the grid but I am unable to submit the field in any case whether its hidden or shown :( At first the grid is hidden and then on the valueChangeListener of h:selectOneMenu rendered value is set to either true or false.( renderStatus is set in the value change listener ).
    And yeah without this logic of hide/show its working fine with me. Any guess or idea what am I doing wrong here.
    Thanks for your time by the way.
    Regards,
    Shoaib

  • Trying to load illustrator 6cs onto new mac and the old activation code for my ill cs doesn't work with it

    Trying to load a downloaded version of illustrator 6cs onto new mac and the old activation code for my illustrator cs doesn't work with it.  Do I need a new code or am I missing something?  Same goes for my Photoshop cs.

    you need your serial number.
    if you purchased from or registered with adobe check your account, https://www.adobe.com/account.html

  • Cinema Display (clear) with DVI/ADC box doesn't work with MacBook Pro

    Cinema Display (clear) with DVI/ADC box doesn't work with MacBook Pro when plugged in with a dvi to mini dvi cable. Any ideas what to do to make it work? I lugged the 23" 2500 miles into the wilderness and I need help

    Okay, here's an update: the DVI to ADC adapter does work with the Apple displays that I have tried, but it won't work with the Formac. I have tried multiple time to contact them, but to no avail... they don't even respond to threats of posting my opinion of them, which is this:
    DON'T BUY ANYTHING FROM FORMAC! They make quality products, but their customer service is a big time joke! They won't take care of you.

  • HT201210 hi everyone, i have a problem about my iphone 4S, doesn't work with wifi connection and bluetooth since upgrade to the IOS 7.0.3. Can anyone can help me tosolve this problem?????Thank's regards paulus

    hi everyone, i have a problem about my iphone 4S, doesn't work with wifi connection and bluetooth since upgrade to the IOS 7.0.3. Can anyone can help me tosolve this problem?????Thank's regards paulus

    Try the suggestions here to see if they resolve your problem:
    http://support.apple.com/kb/ts1559
    If these don't work you may have a hardware problem. Visit an Apple store for an evaluation or contact Apple Support.

  • TS1253 I have a printer epson TX210, but it doesn't work with my time-capsule. What need to do?

    I have a printer epson TX210, but it doesn't work with my time-capsule. What need to do?

    What have you tried?
    You are going to get nowhere quick with the 6.1 utility in Mountain Lion if this is the only OS you have available.
    Look up how to install 5.6 utility under ML. At least then you can see printers. That is assuming you are trying to use USB.
    Has this worked ever on Mountain Lion? Did you download the drivers for that printer for ML?
    Plug it into a computer directly.. does it work? If it doesn't work locally it sure will not work via the network.

  • My i pod nano first generation doesn't work with windows 8

    My i pod nano first generation doesn't work with windows 8

    Howdy yvesmd,
    Thanks for using the Apple Support Communities.
    If your iPod nano is not being recognized in iTunes on your Windows computer, then I'd like you to please follow the directions in the link below.
    Apple - Support - iPod - iPod nano Troubleshooting
    Cheers,
    Alex H.

  • Quicklook doesn't work with .avi files

    Hello, i've got a little problem right here on my mac. The thing is that I used to have Snow Leopard as a OS and quicklook used to work great, it opened all the extensions I used to work with. The thing change when I format my HDD and installed a clean copy of Lion OS. Now quicklook works fine as it used to but not any more with .avi files. I remember that this feature was working great on my previous OS, and it's really important for me to find a solution because quicklook is an absolutely amazing feature of our Macs.
    I've tryed to download plugins, restoring permissions or even trying it with a guest user, but no success.
    Please help me. If you need more info about specs or something i'll be glad to give them to you.
    Thank you!!!

    Also doesn't work with Grapher (.gcx) documents (an Apple format).

  • The Bluetooth on my 2012 Lexus doesn't work with my iPhone 5.  My old android phone worked perfectly with my car.  Even the tech guy at Lexus couldn't get it to work.  What is apple doing to fix this.

    The Bluetooth on my 2012 Lexus doesn't work with my iPhone 5.  My old android worked perfectly with my car.  Even the tech specialist at Lexus couldn't get it to work.  Lexus said that other iPhone 5s were having the same problem.  What is apple doing to fix this?

    Going to the local Apple store this morning...
    My problem is not uncommon as the board is showing signs of this happening to many others as well. That is where I found the restore and reboot information to try to solve the issue of crashing apps.
    I understand that Apple will not "give away the cow", but letting iPhone users know that the problems they are having are being addressed by Apple is a little more comforting than nothing at all. Other wise, all the apps in world are useless and even more importantly worthless, if a person has to reset/reboot/reload just to get them to work.
    IF Apple can not address the basic problems with todays iPhone apps, why should one believe that the iPhone 3.0 OS is any better? Using a PC comparison, which is better, XP or Vista. If the current iPhone OS of 2.2. what ever is not working that well (as related to down loaded apps and iTunes), will OS 3.0 be any better?
    The waste of time I refer to is in going to the apps store and downloading the apps... Again why by apps if the free version does not work?

  • Satellite M40-129: PCMCIA Card doesn't work with Linux

    I have D-Link DWL-G650 with Atheros Chipset which is good supported under linux (madwifi). But if I boot Linux the card is not found. I tested the card with an Fujitsu Siemens Notebook and it worked out of the box!
    Any idea why it doesn't work with my M40-129 ?

    Hi
    Like you know Toshiba doesnt support the Linux and there are no Toshiba drivers for the Linux OS but I was able to find this useful Toshiba page about the notebook configuration with Linux:
    http://newsletter.toshiba-tro.de/main/
    You should check the OS machine compatibility and the other areas.
    Im sure you will find many useful tips.
    Good luck

  • HT5706 I am trying to set up Apple TV with my Uverse WiFi, but I get errors when entering my password.  One site said that Apple TV doesn't work with WPA which Uverse uses.  Is there anyway around this or will Uverse and Apple TV just not work together.

    Trying to set up Apple TV with ATT Uverse.  I get errors when trying to enter my WiFi password.  One site says that Apple TV doesn't work with Uverse because it uses WPA for encryption.  If true, does that mean Uverse subscribers cannot use Apple TV?

    Spurs63 wrote:
    does that mean Uverse subscribers cannot use Apple TV?
    No, that's a rather silly conclusion.
    There are two options:
    stop using the crappy router provided by the ISP.
    Physically connect the ATV to the router via Ethernet.

  • My cellcom line doesn't work with my iPhone here in Israel, why? Is there any way I can solve this issue?

    My cellcom line doesn't work with my iPhone here in Israel, why? Is there any way I can solve this issue?

    Please explain.
    What does "cellcom line doesn't work with my iPhone" mean?
    What are you trying?  What is happening?
    Where did you buy the iphone?
    Any info abnout your issue at all?

Maybe you are looking for