RequestContext and callback for table onselectComplete

UI Components for JSF
User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

06 Apr 2010, 17:41

Hello Cagatay,

I read the post about using oncomplete callback like handleComplete(xhr, status, args) in Tree component. You wrote that it's not possible at the moment. I need something like in DataTable component. I intend to update a menubar per JavaScript with each row selection because an update via DataTable "update" attribute causes an ugly flicker of menubar (have we do an issue ticket?). I have tried this approach:

Page:

Code: Select all

			<p:dataTable id="dtSocs" var="soc" value="#{socsBean.socs}" dynamic="false" selection="#{socsBean.selectedSocs}" update="@none" 
				selectionMode="multiple" emptyMessage="#{msgSocs['overview.socs.norecords']}" widgetVar="dtSocsWidget" rowIndexVar="rowIdxVar"
				onselectComplete="handleTableSelectionComplete(xhr, status, args)">
JS:

Code: Select all

function handleSocsTableSelectionComplete(xhr, status, args)
{
	if (args) {
		var isEditDisabled = args.isEditDisabled;
		......
	}
}
But I get an JS error:
xhr is not defined
<?xml version="1.0" encoding="UTF-8"?>...am></callbackParams></partialResponse>


Is it not possible too? :-( Do you have an idea how we can get any data client-side from server-side action?

Thanks in advance.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

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

07 Apr 2010, 02:34

That should be possible for sure, I'll test this and let you know soon.

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

07 Apr 2010, 10:31

cagatay.civici wrote:That should be possible for sure, I'll test this and let you know soon.
Thanks Cagatay, I'm waiting then and hope it will be working. The hope dies at last :-)

P.S. Congratulation yet to Barca win yesterday (although I'm Arsenal fan) :-)
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

09 Apr 2010, 14:25

Hello Cagatay,

Do you have any news? I have found as always a workaround :-) It's not important for me any more. But if it's a bug I can create a ticket.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

02 Jun 2010, 12:04

Hello Cagatay,

I have found it doesn't work for tree as well. See this issue http://code.google.com/p/primefaces/iss ... ail?id=712

What are your plans regarding this issue? Just a question of pure curiosity.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

rahul_dm
Posts: 53
Joined: 12 Mar 2010, 19:02
Contact:

02 Jun 2010, 12:29

for tree onselectComplete callback i am using workaround with p:remoteCommand to get callback.

Code: Select all

<p:tree value="#{bean.treeRoot}" id="mytree" widgetVar="mytreeV" var="node" dynamic="true" 
onselectComplete="callme();" selectionMode="single" selection="#{bean.selectedNodes}"
nodeSelectListener="#{bean.onTreeNodeSelect}">

...

<p:remoteCommand  name="callme" id="callme" process="@this" update="@none"
actionListener="#{bean.remoteaction}" oncomplete="handleComplete(xhr, status, args);" />

Last edited by rahul_dm on 02 Jun 2010, 12:32, edited 1 time in total.

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

02 Jun 2010, 12:32

Yes, I use the same workaround for datatable :-) The second workaround I sometimes use is to place datatable and JS <script> ... </script> within h:panelGroup and update the panel group instead of datatable. The script is executed with each update.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

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

03 Jun 2010, 12:02

Ok, do we have issues for these at tracker? these should be easy to fix.

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

03 Jun 2010, 12:11

cagatay.civici wrote:Ok, do we have issues for these at tracker? these should be easy to fix.
Yes. A composed issue (tree + datatable) http://code.google.com/p/primefaces/iss ... ail?id=712.
Thanks!
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

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

04 Jun 2010, 11:38

Thanks, I took ownership on the issue and set target milestone to upcoming release.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 69 guests