The best place to ask programming/development questions, imo. UPDATE: stackoverflow is the *worst* place to *ask* questions (if your first question/comment doesn't get any up-rating/response, then u can't ask anymore questions--ridiculously unrealistic), but a great reference for finding answers.

My Music (Nickleus)


[SOLVED] primefaces click on p:commandLink doesn't work, nothing happens. firebug helped me easily find the error.

In firefox, i clicked on the magnifying glass (top left in above image) icon link that seemed to not be working. When i clicked on the image, nothing happened.

I originally tried a (bad and risky) workaround for this by setting the p:commandLink's "immediate" attribute to "true":

    update=":growl :panelContent" immediate="true">
    <h:graphicImage value="/images/search.gif" style="border:0" />

this "worked", but simply hid the error, so this isn't a solution.

Eventually, I found out that it was a hidden error: java.lang.NullPointerException

Here's how i found that:

In firebug > Console > All
i expanded the POST line and could see a clue about the error in the Response tab:

<?xml version='1.0' encoding='UTF-8'?>
<partial-response><error><error-name>class javax.faces.component.UpdateModelException</error-name><error-message><![CDATA[/path/to/inplaceInputText.xhtml @16,60 value="#{inputValue}": /path/to/tripRow.xhtml @53,69 value="#{backingBean.description}": java.lang.NullPointerException]]></error-message></error></partial-response>

here's the problem code in "backingBean"


public void setDescription(String description) {
    this.description = description.toUpperCase();


the error was occurring when "description" was null--toUpperCase() will obviously throw an error.

to fix this, i changed the code to this:

public void setDescription(String description) {
    if(description != null)
    this.description = description.toUpperCase();
    else this.description = description;

Once that was fixed, the form submitted properly :)

No comments:

Post a Comment