Portletfaces bridge + Primefaces

UI Components for JSF
Post Reply
tomtom
Posts: 10
Joined: 22 Aug 2011, 09:35

22 Aug 2011, 10:09

Hello,

I'm using Portletfaces bridge 2.0 in combination with Primefaces 3.M3. Everythings looks good except the partial processsing of the dom tree e.g.:

Code: Select all

<h:form prependId="false" id="form1">
    <p:commandButton value="Assign to me"
                     process="form1:testinform1"
                     update="form1:testinform1"
                     ajax="true"
                     actionListener="#{workflowBean.assignTaskToUser}">
    </p:commandButton>

    <h:outputText id="testinform1"/>
</h:form>

<h:form prependId="false" id="form2">
  

    <h:outputText value="#{workflowBean.getSomeValue}" id="testinform2"/>
</h:form>
=> A submit of the commandbutton triggers "testinform2" everytime, anyone with the same problem ?

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

22 Aug 2011, 10:11

Does it happen as well when you are not running a portlet?

tomtom
Posts: 10
Joined: 22 Aug 2011, 09:35

22 Aug 2011, 11:35

Well,

The partial processing is working in standalone mode with this simple example, and I now got it working in portlet mode. But,on the attached jsf page I still have the problem .It is a page with a tabview and on each tab is a datatable. Whenever I push the button : "Assign to Me" in the first tab, the other datatables are also refreshed. And this causes a delay...

Code: Select all

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


    <h:head>
        <h:outputStylesheet library="css" name="portlet.css"/>
    </h:head>

    <h:form>
        <fieldset>
            <legend class="legend">My Workflows
                <h:outputLink value="#{navigationBean.userWorkflowURL}" >[full view]</h:outputLink>
            </legend>

            <p:messages id="messages" />
            <p:tabView id="workflows">

                <p:tab title="Unassigned Tasks">
                    <p:dataTable id="unassignedwf" value="#{workflowBean.unassignedWorkflowTask}" var="task">
                        <p:column>
                            <f:facet name="header">Name</f:facet>
                            <h:outputText value="#{task.workflowTask.name}"/>
                        </p:column>

                        <p:column>
                            <f:facet name="header">Created</f:facet>
                            <h:outputText value="#{task.workflowTask.createDate}"/>
                        </p:column>

                        <p:column>
                            <f:facet name="header">Actions</f:facet>

                            <p:commandButton
                                    value="Asign to Me"
                                    update="unassignedwf"
                                    actionListener="#{workflowBean.assignTaskToUser}"/>
                        </p:column>

                    </p:dataTable>

                </p:tab>

                <p:tab title="My Tasks">

                    <p:accordionPanel>

                        <p:tab title="Awaiting Action">
                            <p:dataTable value="#{workflowBean.pendingWorkflowTask}" var="task">
                                <p:column>
                                    <f:facet name="header">Name</f:facet>
                                    <h:outputText value="#{task.workflowTask.name}"/>
                                </p:column>

                                <p:column>
                                    <f:facet name="header">Created</f:facet>
                                    <h:outputText value="#{task.workflowTask.createDate}"/>
                                </p:column>



                                <p:column>
                                    <f:facet name="header">Actions</f:facet>

                                    <ui:repeat value="#{task.actions}" var="action">
                                        <p:commandButton value="#{action}"
                                                         update="workflows"
                                                         oncomplete="confirmation.show()">
                                            <f:setPropertyActionListener value="#{action}"
                                                                         target="#{workflowBean.currentAction}"/>
                                            <f:setPropertyActionListener value="#{task.workflowTask}"
                                                                         target="#{workflowBean.currentTask}"/>
                                        </p:commandButton>


                                    </ui:repeat>
                                </p:column>

                            </p:dataTable>

                        </p:tab>

                        <p:tab title="Completed">
                            <p:dataTable value="#{workflowBean.completedWorkflowTask}" var="task">
                                <p:column>
                                    <f:facet name="header">Name</f:facet>
                                    <h:outputText value="#{task.workflowTask.name}"/>
                                </p:column>

                                <p:column>
                                    <f:facet name="header">Started</f:facet>
                                    <h:outputText value="#{task.workflowTask.createDate}"/>
                                </p:column>

                                <p:column>
                                    <f:facet name="header">Completed</f:facet>
                                    <h:outputText value="#{task.workflowTask.completionDate}"/>
                                </p:column>


                            </p:dataTable>
                        </p:tab>
                    </p:accordionPanel>

                </p:tab>

                <p:tab title="My Submissions">

                    <p:accordionPanel>
                        <p:tab title="Pending">
                            <p:dataTable value="#{workflowBean.myPendingSubmissions}" var="wf">
                                <p:column>
                                    <f:facet name="header">Name</f:facet>
                                    <h:outputText value="#{wf.workflowDefinitionName}"/>
                                </p:column>

                                <p:column>
                                    <f:facet name="header">Started</f:facet>
                                    <h:outputText value="#{wf.startDate}"/>
                                </p:column>

                                <p:column>
                                    <f:facet name="header">Status</f:facet>
                                    <h:outputText value="#{wf.state}"/>
                                </p:column>


                            </p:dataTable>
                        </p:tab>

                        <p:tab title="Completed">
                            <p:dataTable value="#{workflowBean.myCompletedSubmissions}" var="wf">
                                <p:column>
                                    <f:facet name="header">Name</f:facet>
                                    <h:outputText value="#{wf.workflowDefinitionName}"/>
                                </p:column>

                                <p:column>
                                    <f:facet name="header">Started</f:facet>
                                    <h:outputText value="#{wf.startDate}"/>
                                </p:column>

                                <p:column>
                                    <f:facet name="header">Status</f:facet>
                                    <h:outputText value="#{wf.state}"/>
                                </p:column>
                            </p:dataTable>
                        </p:tab>

                    </p:accordionPanel>

                </p:tab>

            </p:tabView>


        </fieldset>


        <p:dialog
                header="Perform Workflow Ation"
                severity="alert" widgetVar="confirmation">
            <p:outputPanel autoUpdate="true">
                <h:panelGrid
                        rowClasses="rows"
                        columnClasses="vtop"
                        columns="2" style="margin-bottom: 5px;" >
                    <h:outputText style="font-weight: bold;"  value="Action :"/>
                    <h:outputText  value="#{workflowBean.currentAction}"/>

                    <h:outputText style="font-weight: bold;"  value="Comments :"/>
                    <p:inputTextarea>

                    </p:inputTextarea>
                </h:panelGrid>

                <h:panelGrid columns="2">
                    <p:commandButton value="Yes " update="messages" oncomplete="confirmation.hide()"
                                     actionListener="#{workflowBean.doTransition}" />
                    <p:commandButton value="No " onclick="confirmation.hide()" type="button" />
                </h:panelGrid>
            </p:outputPanel>


        </p:dialog>

    </h:form>
</f:view>

baspet
Posts: 37
Joined: 18 Jan 2011, 14:53

22 Aug 2011, 13:10

Hi,

I had same problems

See viewtopic.php?f=3&t=8771&p=40723#p40723

Primefaces 3.0.M3, Mozarra 2.0.6, liferay 6.0.5

tomtom
Posts: 10
Joined: 22 Aug 2011, 09:35

22 Aug 2011, 13:49

Thanks a lot :D this is the solution to my problem :) !

But why is this required? This makes the use of process and update meaningless....

baspet
Posts: 37
Joined: 18 Jan 2011, 14:53

23 Aug 2011, 17:50

Hi,

switching to latest PM version (3.0.M3), ajax updates stop working.
The problem seems to be in line 321 in core.js:
portlet: portletContainer
If i remove the above code everything works fine. Debugging firefox, portletContainer variable is an empty array.
BTW, what form.parents('section.portlet:first') do?
a
Please, advice
TIA
Vassilis

Primefaces 3.0.M3, Mozarra 2.0.6, liferay 6.0.5

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 27 guests