Weird problem primefaces

UI Components for JSF
the_avatar
Posts: 57
Joined: 04 Feb 2013, 03:37

09 Apr 2013, 20:27

I have made another test and it's very curious. If I change the original <p:commandButton> from this:

Code: Select all

<p:commandButton id="elboton" action="altaaupair" value="Siguiente" icon="ui-icon-arrowthick-1-e" style="float: right;"/>
To this:

Code: Select all

<p:commandButton id="elboton" action="altaaupair_vista" value="Siguiente" icon="ui-icon-arrowthick-1-e" style="float: right;"/>
It also works!!!
Is there any problem with templates and primefaces?

rikup
Posts: 459
Joined: 29 Jan 2013, 14:27

09 Apr 2013, 20:44

Do you have navigation rules defined? If yes, then it might be that h:commandButton works because of that. But the

Code: Select all

action="altaaupair_vista"
works because it uses xhtml name directly. But I'm not sure because I don't use navigation rules anywhere :D
PrimeNG 2.0.0
Angular 2.4.5

the_avatar
Posts: 57
Joined: 04 Feb 2013, 03:37

10 Apr 2013, 11:17

Hi.
I don't use navigation rules (if for that you are refering to navigation in faces-config.xml) This is my faces-config:

Code: Select all

<faces-config version="2.1"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_1.xsd">

    <application>  
        <resource-bundle>
            <base-name>controladores.mensajes</base-name> 
            <var>msjs</var>       
        </resource-bundle>
        <message-bundle>controladores.mensajes</message-bundle>
        
        <locale-config>
            <default-locale>es</default-locale>
            <suported-locale>es</suported-locale>
            <suported-locale>en</suported-locale>
        </locale-config>
    </application>
</faces-config>
This is my glassfish-web.xml:

Code: Select all

<glassfish-web-app error-url="">
  <class-loader delegate="true"/>
  <jsp-config>
    <property name="keepgenerated" value="true">
      <description>Keep a copy of the generated servlet class' java code.</description>
    </property>
  </jsp-config>
  <property name="alternatedocroot_1" value="from=/upload/* dir=/var/webapp/" />
  <parameter-encoding default-charset="UTF-8"/>
</glassfish-web-app>
This is my web.xml:

Code: Select all

<context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Production</param-value>
    </context-param>
    <context-param>
        <param-name>primefaces.THEME</param-name>
        <param-value>redmond</param-value>
    </context-param>
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>faces/index.xhtml</welcome-file>
    </welcome-file-list>
    
    <error-page>
        <error-code>500</error-code>
        <location>/error.xhtml</location>
    </error-page>
    <error-page>
        <error-code>404</error-code>
        <location>/error.xhtml</location>
    </error-page>
    <error-page>
        <error-code>403</error-code>
        <location>/error.xhtml</location>
    </error-page>
    
    <filter>
        <filter-name>PrimeFaces FileUpload Filter</filter-name>
        <filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
        <init-param>
            <param-name>thresholdSize</param-name>
            <param-value>1500000</param-value>
        </init-param>
        <init-param>
            <param-name>uploadDirectory</param-name>
            <param-value>/upload</param-value>
        </init-param>        
    </filter>
    <filter-mapping>
        <filter-name>PrimeFaces FileUpload Filter</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>
I'm not sure about what is happening...
Any idea?

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

10 Apr 2013, 11:25

Stop doing what you do, and you know what I mean...

You have been asked to not do this on a previous occasion and you start doing it again. If you continue to do this, I (personally) see this as a deliberate attempt to circumvent te posting rules. In that case I'll ask for a temporary block of your account.

the_avatar
Posts: 57
Joined: 04 Feb 2013, 03:37

10 Apr 2013, 13:59

Don't worry, I won't do that again.
By the way, I made a testcase as you said, any idea about it?
Thank you!

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

10 Apr 2013, 14:32

the_avatar wrote:Don't worry, I won't do that again.
By the way, I made a testcase as you said, any idea about it?
Thank you!
Let's hope you won't...

And about the testcase... i cannot run it since it contains db stuff... That is not a minimal testcase... But you know the major difference between h:commandButton and p: commandButton I assume...

the_avatar
Posts: 57
Joined: 04 Feb 2013, 03:37

10 Apr 2013, 15:52

Ummmm... Extended options as for example the "update"? Im not sure what you are reffering to. Can you explain me, please?
By the way, I know that the case I used has DB stuff, but the error Im describing HAS DB stuff.
Thanks for your help.

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

10 Apr 2013, 16:10

p: is ajax by deault, h: is not ajax... And where do you describe a database error?

the_avatar
Posts: 57
Joined: 04 Feb 2013, 03:37

10 Apr 2013, 17:11

Well, ok, you are right. It is not a DB error. But it happens using dynamic data from database.
If fact it too happens with static data as for example in the "sex selection" field. If you want to use the testcase just remove all components using database and change the Hibernate object with a String. What is left is a very short example because there is just one component with static data but you will be able to see the error.
What do you mean by refering to the ajax behaviour of the buttons? I knew that, but the problem is why most of the primefaces components "freeze".

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 74 guests