nagivation using ajax components dont work

UI Components for JSF
Post Reply
ale0790
Posts: 7
Joined: 22 Mar 2011, 16:21

23 Apr 2011, 17:00

Hello,im new user primefaces, im have one problem , need help, pls :?
sorry bad english ^^

im have one pag for nagivation in my site, NAVIGATION WORK, no work components in page,but only works components of the first page that loads when I click Guerapa Desprotetor components of this page do not work.

topo.xhtml

Code: Select all

<ui:fragment xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                >


    <h:form prependId="false">

        <table width="100%" style="  font-size: 12px;">
            <tr>

                <td width="50%">
            <h:outputText value="GUERAPA.COM" style="font-size:36px; text-align: center"/>
            </td>
            <td>
                <a href="http://twitter.com/share" class="twitter-share-button" data-url="www.guerrapa.com" data-text="Protetores de link nunca mais, www.guerapa.com tem a solução. Tbem possui uma ferramenta para encontrar musicas,filmes,games etc." data-count="horizontal" data-via="guerapasite">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
            </td>
            <td>

                <h:panelGroup>
                    <p:commandLink action="#{paginasBean.paginaDesprotetor}" update="#{p:component('centro')}" ajax="false">


                    <p:graphicImage value="/images/cadeado.png" style="width: 50px; height: 50px;"/>
                    Guerapa Desprotetor
            </p:commandLink>
                </h:panelGroup>
            </td>
            <td>
                <h:panelGroup>
                    <p:commandLink action="#{paginasBean.paginaDownloads}" update="#{p:component('centro')}" ajax="false">
                    <p:graphicImage value="/images/download.png" style="width: 50px; height: 50px;"/>
                    Guerapa Downloads
            </p:commandLink>
                </h:panelGroup>
            </td>
            <td>
            <h:panelGroup>
                <p:graphicImage value="/images/tutorial.png" style="width: 50px; height: 50px;"/>
                Guerapa Tutoriais
            </h:panelGroup>
            </td>
            </tr>
        </table>
</h:form>


</ui:fragment>
index.html

Code: Select all

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                template="template.xhtml">

 
        <ui:define name="topo">
           
            <ui:include src="topo.xhtml"/>
          
        </ui:define>

   
    <ui:define name="centro">
 <h:form id="formCentro">
        <p:outputPanel id="centro">
            <ui:include src="#{paginasBean.paginaPrincipal}"/>
        </p:outputPanel>
 </h:form>
    </ui:define>
desprotetor.xhtml

Code: Select all

<ui:fragment
    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">

                                   
                                    <p:commandButton value="Converter" action="#{desprotetorBean.faz}">
                                    
                                    </p:commandButton>
   
</ui:fragment>
downloads.xhtml

Code: Select all

<ui:fragment
    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">

    <table align="center">
        <tr>
            <td align="center">
            
  
            <h:panelGrid columns="3" style="">
           
                
                <h:outputLabel value="Filtro: "/>
                <h:inputText id="textoBusca" value="#{buscaPost.textoBusca}" size="100">
                <p:ajax event="keyup" process="textoBusca" listener="#{buscaPost.Busca}" update="resultado" />
                 
                </h:inputText>


                <p:ajaxStatus style="width:16px;height:16px;">
                    <f:facet name="start">
                        <h:graphicImage value="/ajaxloading.gif" style="width: 16px; height: 16px;" />
                    </f:facet>

                    <f:facet name="complete">
                        <h:outputText value="" />
                    </f:facet>
                </p:ajaxStatus>


    </h:panelGrid>
             

     

     <h:panelGrid id="resultado">
         <p:dataGrid id="listaArquivos" var="arq" value="#{buscaPost.listArquivos}" columns="2" >


                <p:column>

                    <p:panel style="width: 100%;">


                            <h:panelGrid columns="2" style="text-align: left;">

                                <p:graphicImage value="#{arq.urlImage}" style="width: 120px; height: 120px;"/>
                                <h:panelGrid>
                                    <h:outputLabel value="#{arq.nome}" style="font-weight: bold; font-size: 12px; color: red;"/>
                                <h:outputText value="#{arq.dataPost}" style="font-weight: bold;"/>
                                <h:outputLink value="http://www.guerapa.com/paginas/#{arq.urlArquivo}.html" target="_blank" style="font-size: 20px;">Mais info</h:outputLink>
                                </h:panelGrid>
                                
                            </h:panelGrid>




                    </p:panel>
                </p:column>
          </p:dataGrid>

    </h:panelGrid>
      
    </td>
    </tr>
           
    </table>
</ui:fragment>
IMAGE WORK COMPONENT PAGE downloads.xhtml
[img=http://img31.imageshack.us/img31/589/workia.th.jpg]

IMAGE DONT WORK COMPONENT PAGE desprotetor.xhtml
[img=http://img845.imageshack.us/img845/4864/dontwork.th.jpg]


Help plss, 2 day and no search solution :/

ale0790
Posts: 7
Joined: 22 Mar 2011, 16:21

24 Apr 2011, 06:31

any??? pls :(

giberius
Posts: 42
Joined: 08 Jan 2011, 14:20

24 Apr 2011, 08:30

Try ajax=false in the command button.

From a bean you can naviate by <new page>?faces-redirect=true

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

24 Apr 2011, 12:17


ale0790
Posts: 7
Joined: 22 Mar 2011, 16:21

24 Apr 2011, 13:53

hello, thx for reply..
Re: nagivation using ajax components dont work
Try ajax=false in the command button.

From a bean you can naviate by <new page>?faces-redirect=true
man, look topo.xhtml im set ajax="false"

man im test using p:menu and p:menuItem and dont work :/


im dont need redirect page need show page in index.html

Code: Select all

<ui:define name="centro">
<h:form id="formCentro">
        <p:outputPanel id="centro">
            <ui:include src="#{paginasBean.paginaPrincipal}"/>
        </p:outputPanel>
</h:form>
any help me??? Thx all

ale0790
Posts: 7
Joined: 22 Mar 2011, 16:21

25 Apr 2011, 13:08

any ?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 40 guests