Page 1 of 1

AJAX JS function like rich faces

Posted: 29 Jul 2010, 20:54
by smooth4me
Hi,

I am implementing tebView so I have 3 tabs when we switch tabs I want to get that particular tab form updated.

is there any way to do this?

I want to use different beans for different tabs because I will have too many fields in each tab so I want this implementation.

I was trying to implement onload function. How can I rerender the whole form when the AJAX call is completed.

I was able to do this in the following way by using rich faces
<a4j:jsFunction name="test" action="#{notificationSettingsBean.initialSetup}" reRender="notificationSettingsForm"/>

how can I implement the same kind of future using primefaces?

Thanks,

Re: AJAX JS function like rich faces

Posted: 29 Jul 2010, 21:23
by cagatay.civici
Have you looked at dynamic tabs?

http://www.primefaces.org:8080/prime-sh ... ewAjax.jsf

Also we have p:remoteCommand;

http://www.primefaces.org:8080/prime-sh ... ommand.jsf

Also tabview enhancements like tabChangeListener and onTabChangeUpdate are on the way for next release.

http://code.google.com/p/primefaces/iss ... ail?id=577

Re: AJAX JS function like rich faces

Posted: 29 Jul 2010, 21:50
by smooth4me
Hi,

Yes I have looked at Tab view dynamic. I have a question here we need to include tabView in h:form right? my problem here is I have three tabs and created three different forms each form submission has different beans how can I include this tabView in h:form in this situation.

With the h:cremoteCommand I tried in the following way
<p:remoteCommand name="test" action=#{myBean.initialSetup} update="@form">
</p:remoteCommand>

is this the correct way of doing this?

Thanks,

Re: AJAX JS function like rich faces

Posted: 30 Jul 2010, 23:34
by cagatay.civici
I see, so in this case you don't need dynamic tabs as you'll implement this behavior yourself. Right now it is not possible as tabView doesn't have tabChangeListener or onTabChangeUpdate options. These will added in 2.2 as I've linked the issue ticket in my previous post. When it's done, it'll be very easy without remoteCommand.

Re: AJAX JS function like rich faces

Posted: 31 Jul 2010, 03:04
by smooth4me
Hi,

Thanks for your support.

Have a good week end.