Action of commandButton in facet in timeline not working

Community Driven Extensions Project
Post Reply
Lord Firlefanz
Posts: 3
Joined: 15 Oct 2014, 08:09

15 Oct 2014, 09:25

Hi @ all!

I searched in the forum but found nothing; hope I don't miss it. :)
At first I apologize for my possibly bad english, I do not write often in that language.

Okay, here I go:

We use the timeline of PrimefacesExtensions in our project, which is great! Thank you for that!
In the facet which to use for grouping the events, I wanted to use p:commandButtons.
The actions of these buttons unfortunately aren't working properly, or I miss smt.
Here's the code of the xhtml:

Code: Select all

<p:tab id="dispoTab" title="Disposition">
	<pe:timeline id="timeline" 
			 value="#{dispoBeanPF.timelineModel}" 
			 var="order" 
			 varGroup="group"
			 editable="true"  
			 ...
			 widgetVar="timelineWdgt"
			 ...>
		<p:ajax .../>  
		...

		<f:facet name="group">  
			<h:panelGrid columns="2">				
				<h:panelGrid columns="1" style="border-collapse: collapse;">
					<p:commandButton icon="ui-icon-power" id="toggleVisibilityButton"
									 action="#{dispoBeanPF.toggleVehicleVisibility(group)}"
									 update=":main-form:tabs:timeline"
									 process="@this">
					</p:commandButton>
					<p:commandButton icon="ui-icon-wrench" id="toggleAvailabilityButton"
									 action="#{dispoBeanPF.toggleVehicleAvailability(group)}"
									 update=":main-form:tabs:timeline"
									 process="@this">                                        
					</p:commandButton>
				</h:panelGrid>

				<h:panelGrid columns="2">
					<h:outputText value="LKW:" style="font-weight:bold;"/>
					<h:outputText value="#{group.licenceTag}" />
					<h:outputText value="ID:" style="font-weight:bold;"/>  
					<h:outputText value="#{group.id}"/>  
				</h:panelGrid>
			</h:panelGrid>
		</f:facet>  

		<h:panelGrid id="timelineEventTextGrid">
			<h:outputText .../> 
			...
		</h:panelGrid>
	</pe:timeline>  
	...	
</p:tab>
The question/problem is:
Everywhere the "group" (=varGroup) is used, it works. But not as parameter in the action of the commandButtons.
(action="#{dispoBeanPF.toggleVehicleVisibility(group)}" And action="#{dispoBeanPF.toggleVehicleAvailability(group)}")
Oh, I also tried to pass not the group itself but group.id, which is a String like in the showcase, also don't worked.
However when I hardcode the passing argument in the action, like a fixed id ("123" for example), it works!

I don't understand why the id of the group is shown correctly in the h:outputText, where I use it as value.
But when i pass it in the method of the action, it is always null (or empty String when using group.id) in the Bean.

I tested that with PF 5.0 and 5.1, Extensions 2.0 and 2.1, same problem.
"Unfortunately" I still have to use Glassfish 3.1.1.

Having a glance at Firebug, the XML-Section of the Post says:
XML-Verarbeitungsfehler: nicht wohlgeformt Adresse: moz-nullprincipal:{4ad69840-e567-4857-82ce-7f2b7278ca29} Zeile Nr. 2, Spalte 1770:

...form_tabs_toggleVisibilityButton\"});\n\/\/]]>\n<\/script><\/td>\n<\/tr>\n<tr...
...-------------------------------------------------^
So the XML isn't well-formed...

Any ideas where the problem is?
Or do only I don't get it?
Greetings! :)

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

22 Oct 2014, 21:53

Thanks for reporting.

Well, actions are a little bit complicated within f:facet name="group". Timeline should have a visit callback but it doesn't have it. Groups should be evaluated in some JSF phases. e.g. during INVOKE_APPLICATION. Currenlty they are only evaluted during RENDER_RESPONSE.

You can create an issue in our bug tracker if you want. But I can not give a guarantee when I will fix this issue. Better to use PrimeFaces PRO for Extensions http://www.primefaces.org/support.html
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

Lord Firlefanz
Posts: 3
Joined: 15 Oct 2014, 08:09

28 Oct 2014, 10:18

Hi Oleg!

Thank you for your reply!

So, f:facet, eh?!
Think it's something special, eh??!
But also cooking only with water....

Humor aside: It makes sense what you say.
Ok, then I think I have two options:
a) Simply put the buttons elsewhere. Not that cool but okay.
b) Go Pro. Already alluded that to my employer, we'll see...

Thank's again and have a nice day! 8)

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

28 Oct 2014, 11:03

Lord Firlefanz wrote:Hi Oleg!

Thank you for your reply!

So, f:facet, eh?!
Think it's something special, eh??!
But also cooking only with water....

Humor aside: It makes sense what you say.
Maybe because I'm not a native English speaker, but I mis the humor ;-)
Lord Firlefanz wrote:Ok, then I think I have two options:
a) Simply put the buttons elsewhere. Not that cool but okay.
b) Go Pro. Already alluded that to my employer, we'll see...

Thank's again and have a nice day! 8)
What about a+: Create them somewhere else and move them inside the timeline facet on the client with jquery dom manipulations?

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

28 Oct 2014, 11:08

This other post might be related: http://forum.primefaces.org/viewtopic.php?f=3&t=40055. Would be a real miss if things like this won't work. It is natural to expect it to work. Can PF/PFE do something generic to make this work? And what would be the PRO costs for it. I may have a sponsor

Lord Firlefanz
Posts: 3
Joined: 15 Oct 2014, 08:09

30 Oct 2014, 12:57

kukeltje wrote: Maybe because I'm not a native English speaker, but I mis the humor ;-)
This "only cooking with water"-thing is a German phrase which underlines the equality of every human, no matter what one think about himself.
(So f:facet is not better then other components, so y is it not evaluated in some JSF phases... perhaps a performance-thing/it was never thought to be used that way..)
kukeltje wrote:
Lord Firlefanz wrote:Ok, then I think I have two options:
a) Simply put the buttons elsewhere. Not that cool but okay.
b) Go Pro. Already alluded that to my employer, we'll see...

Thank's again and have a nice day! 8)
What about a+: Create them somewhere else and move them inside the timeline facet on the client with jquery dom manipulations?
Okay, good idea. But i have to admin that I never dived deep into that client-side scripts and there is no time to do so at the moment.
So I solved the issue (for the moment) with a dialog, showing the buttons for each vehicle (=timeline-group) in a grid.
This also has the advantage of making the main-page a little bit cleaner and gives me the possibility to show all timeline-groups (visible and hidden ones) so I can make hidden groups visible again without wasting space on the main-page. (hm.. hope that was described clearly enough.. :) )
kukeltje wrote: This other post might be related: viewtopic.php?f=3&t=40055. Would be a real miss if things like this won't work. It is natural to expect it to work. Can PF/PFE do something generic to make this work? And what would be the PRO costs for it. I may have a sponsor
Yes, seems to be about the same.
Well, for me it's not _that_ important at the moment, but sure: in principle this really should work!
And i fear that this issue might came up in the future again, so a clean solution would be very nice.

Bye, Firlefanz 8-)

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

03 Nov 2014, 01:25

This other post might be related: viewtopic.php?f=3&t=40055. Would be a real miss if things like this won't work. It is natural to expect it to work. Can PF/PFE do something generic to make this work? And what would be the PRO costs for it. I may have a sponsor
About PRO - please ask Cagatay. The process runs through Cagatay.

Sorry, I don't really have free time now due to book writing (2. edition PrimeFaces Cookbook).
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

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests