Page 2 of 2

Re: Using <p:ajax> inside of <p:tree> generates error

Posted: 04 Jul 2011, 13:13
by ianwelch
I have recently updated to Primefaces 3.0.M2 as I wanted to try out some additional functions however I am getting the same errors as people in this post of:

Code: Select all

Parent not an instance of ClientBehaviorHolder: org.primefaces.component.datatable.DataTable
when I try and add
<p:ajax event="rowEdit" listener="#{usersController.rowEditListener}" update=":form:growl"/>
for the edit listener on a datatable code like so:

Code: Select all

<h:panelGroup rendered="#{usersController.items.rowCount > 0}">
                    
                    <p:dataTable value="#{usersController.items}" var="item"  style="width:70%" 
                                 paginator="true" rows="10"
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                                 rowsPerPageTemplate="5,10,15,20"  
                                 paginatorAlwaysVisible="false">
                       <p:ajax event="rowEdit" listener="#{usersController.rowEditListener}" update=":form:growl"/>
                        <p:column sortBy="#{item.userName}">
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListUsersTitle_userName}"/>
                            </f:facet>
                            <h:outputText value="#{item.userName}" />
                        </p:column>
Is this a known issue or is there a different version of 3.0.M2 to download?

Thanks

Re: Using <p:ajax> inside of <p:tree> generates error

Posted: 04 Jul 2011, 13:58
by ianwelch
Well I sorted out the issue:

I'm using Netbeans 7.0 and glassfish v 3.1 and somehwere in the glassfish domain it was storing a reference to 3.0.M2-snapshot. Once I emptied out everything from the domain1 folders that referenced my deployment the p:ajax function now works :)

Thanks

Re: Using <p:ajax> inside of <p:tree> generates error

Posted: 04 Jul 2011, 16:01
by jtrotman
Please to hear you got the problem sorted out! I'm sticking with M1 for the time being but will probably try M2 again once it has been officially released - it is probably possible to work around the issues I was having but I don't really have the time to spend wrestling with the technology at the moment.

Re: Using <p:ajax> inside of <p:tree> generates error

Posted: 05 Jul 2011, 11:04
by Matrium
tried with 3.0.M2 today, looks like this is no longer an issue. <p:ajax> within tree works great now!

however i have another <p:tree> problem: my tree is invisible in IE7. it is correctly placed, but invisible. if i hover the mouse over one of the invisible nodes i can see that node as long as the mouse stays hovered over it. i also can see selected nodes. but everything else is invisble. any suggestions?

Code: Select all

					<p:tree value="#{navigation.root}"
						selection="#{navigation.currentlySelectedNode}" var="node"
						selectionMode="single" styleClass="template_tree">
						<p:ajax event="select" update="form_center"
							listener="#{navigation.onNodeSelect}" />

						<p:treeNode type="custom">
							<h:outputText value="#{node.bezeichnung}" />
						</p:treeNode>
					</p:tree>

Re: Using <p:ajax> inside of <p:tree> generates error

Posted: 05 Jul 2011, 11:41
by tcnguyen
Try to set event with nodeSelect instead of "select". More information: http://cagataycivici.wordpress.com/2011 ... behaviors/

Code: Select all

<p:tree ...>
    <p:ajax event="nodeSelect" ... />
</p:tree>

Re: Using <p:ajax> inside of <p:tree> generates error

Posted: 05 Jul 2011, 11:58
by Matrium
hi, thanks for the tip, but "nodeSelect" doesn't seem to work at all for me, "select" does. my tree is very similar too the showcase. the listener works great, my real problem is that i can't SEE the tree with ie7

the labs-showase is displayed correctly and i can't explain why my tree is not. the tree is inside a layout/layoutunit, but i already tried to put it into an empty page which had the same effect

Re: Using <p:ajax> inside of <p:tree> generates error

Posted: 05 Jul 2011, 12:13
by Matrium
resolved!

looks like it was a theme-related problem (i use the Theme "start").

Adding the following css-lines resolved the problem for me, the tree is now correctly displayed in IE7 as well

.ui-tree-node-label {
color: black;
}