inputText update not working

UI Components for JSF
Post Reply
chrisbad
Posts: 3
Joined: 24 Aug 2011, 10:37

24 Aug 2011, 10:48

Hi folks,

i have a strange problem with a simple <h:inputText> which is not updating after the commandButton is pressed.
Below i have posted my simple testcode which i used trying to pinpoint the problem. Behind this XHTML is a simple ManagedBean with just the property name. Getters and setters are implemented.

The realy funny thing is that it is working perfect if the inputText is set to disabled="true" - but as you can imagine that is no solution for my problem ,-)
There is no difference in using the standard JSF 2.0 inputText or the primefaces-inputText

I tried PF 2.1.1 and 3 and i'm using Mojarra 2.0.2 on Glassfish. Can please someone help me to get this simple thing working?
Many thanx in advance...

Chris

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <h:head>
        <title>test</title>
        <link type="text/css" rel="stylesheet" href="css/main.css" />
    </h:head>
    <h:body>

        <f:view contentType="text/html">
            <h:form>
                <p:inputText value="#{testBean.name}"/>
                <p:commandButton value="test" update="ausgabe"/>
                <h:inputText id="ausgabe" value="#{testBean.name}" disabled="false"/>
            </h:form>
        </f:view>
        
    </h:body>
</html>

chrisbad
Posts: 3
Joined: 24 Aug 2011, 10:37

24 Aug 2011, 11:38

found another interesting thing.

I added some console-outputs to my backing bean. The string "content" is the word i typed in to test the app.
I did two tests, one with enabled and one with disabled inputText. The output below shows some interesting difference.

Situation 1, input disabled="false":

INFO: Getting null
INFO: Getting null
INFO: Setting String to content
INFO: Setting String to
INFO: Getting

Situation 2, input disabled="false":

INFO: Getting null
INFO: Setting String to content
INFO: Getting content

Many thanx in advance...Chris

chrisbad
Posts: 3
Joined: 24 Aug 2011, 10:37

24 Aug 2011, 11:57

ok, found the solution to get this example to work.
The problem was that both inputs where connected to the same property in the bean.
As i added a second property for the second input it worked.

Unfortunately in my real case i have just one inputfield to update

sorry, for bothering...

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Charlestecak and 37 guests