poll interval get change when the page get refresh in JSF - ajax

I used JSF poll tag to reload a data table in my JSP. And there is another
JSP in the footer. It has a button to reload the page with new data.
When I click on the button on the footer, it get change the frequency of the poll interval.
Bellow is the code sample;
Main.JSP
<et:partialTriggerGroup id="statusUpdatePoller">
<tr:poll interval="10000" id="statusUpdatePoller" pollListener="#{ServerSideClass.statusUpdate}"/>
<m:dataTable>
...
</m:dataTable>
</et:partialTriggerGroup>
Footer.jsp
<et:partialTriggerGroup id="pageControlTrigger">
...
<tr:commandLink action="#{ServerSideClass.statusUpdate}" partialSubmit="true" />
</et:partialTriggerGroup>
Both refresh button & poll tag calls to the same server side method (ServerSideClass.statusUpdate()) to load data.
If I don't press the button on the Footer.jsp, the poll intervals works correctly.
If that button press the interval frequency get change. (Page get refresh within 2,3 seconds)
Anything wrong with this implementation ?
TIA.

Related

Block ui except the correct record on primefaces

I am using primefaces 5.0 with spring webflow. I have the page with datatable which lists out the records and there is one record access from another page. As user request if I choose view one record which will redirect to the another page of datatable, she want to block the UI of other records and place a button at the bottom of the data table for admin to unblock the records or auto unblock after 10 seconds.
I have no idea on how to block the ui or unblock. Do you have any ideas??
Thanks for your help,

ClientSide RowSelect stops working after pagesize change in radgrid

I have many telerik rad grids in my project .
It initialize with ability to have client side row selection with
<clientsettings>
<Selecting AllowRowSelect="True" />
</clientsettings>
it is ok and in first load when my paging selector is on 10 object per grid selecting works fine , but when I change page size to 20 or 50 selecting suddenly stops working and I can not select row as before . Can anyone help me with this ?
RadGrid loses its current selection on postback - e.g. when the data is sorted, a new
group or filter is added, or when the current page changes.
You can try following approaches to implement a way to persist the client-side selection. (sample code snippet is in the attached link)
Using Web Storage
Using JavaScript array
The following logic is used to persist the selected rows:
Handle OnRowSelected and OnRowDeselected events for RadGrid. In the handlers you should update the collection of the selected items.
Handle OnRowCreated event. In this handler you should check if the current item is present in the selected rows collection and select
it if necessary.
For full details, please check this article - Persisting the Selected Rows Client-side on Sorting/Paging/Filtering/Grouping

Joomla modal popup target url does not get session value

I have a problem regarding modal popup and session.
I have two component name test and test1 respectively.
In test there is a form in view in which i put "Anchor" tag with "modal" class. has also class name "class1".
When i clicked on Anchor tag it call click function(on click "class1") in which i put ajax code for set data using "Session".
$('.test').click(function(){
// Ajax code here for set data using session
});
with above function it also called modal popup. here targer url is seted which is the view of 2nd component which is "test1".
Here in test1 there is a view.html , we are getting session data here and displaying in view.
PROBLEM
Problem is that , here in 2nd component , in view i am getting session data but i need to click on button two time , only after i getting data properly.
When i click on it give me a old session data. and when i click on it second time it will give me a proper data.
What is the solution for above problem. if anyone know please let me know.
Session data is altered only after we click on Anchor tag.
Both thing is done on Anchor click , one is for set data in session and second is for modal popup. in popup i am getting data which set in session.
when is the session data is being altered?
Is it altered by ajax call too?
In this case, javascript, is unsynchronous. It doesn't wait for something to happen in order to fire the next line of code. In that case there are several techniques you may find to do so.

f:ajax render becomes slower and slower

I have a performance issue with my JSF page and can not find an solution. I'm using JSF 2.0.
I click on an element to render another element :
<f:ajax event="click" listener="#{row.select}" render=":dataWrapper"/>
After click the data panel will be rendered. My problem is when I click on the element again. The data panel will be rendered too, but it will takes more time. If I click the third time the rendering needs again more time. And so on ...
What can be the reason for this?
I checked the request with the Firefox debugger and everything looks fine, except the reponse time.
The response time will grow up every request.

JSF 2.0 Ajax + Back button operation

I have a page1 with ajax operations and conditional rendering of components based on user activity on that page managed by a #ViewScoped bean .Now after moving to the next page say page2 which has a h:commandButton back button , the user on click should be able to access the previous page values in its final format .
The navigation is working fine but the ajax call since its done only based on the user activity on page1 iam not able to show it .so my question is how to rerender the component with ajax values + User selection in its final format .Any idea on how to implement this ? Thanks in advance

Resources