-
1. Re: Search grid is not refreshing on change of right side bar
kragoth May 31, 2011 7:57 PM (in response to asc)Please post your code to give us a better idea of what you are doing.
-
2. Re: Search grid is not refreshing on change of right side bar
asc Jun 1, 2011 3:27 AM (in response to asc)I have a right side bar having code as:
rightbar.xhtml<h:form id="selectSchool" style="margin: 0px 0px 0px 10px;" rendered="#{identity.loggedIn and !(identity.hasRole('admin') or identity.hasRole('site-admin'))}"> <h:panelGrid columns="2" styleClass="none" width="100%"> <h:selectOneListbox id="schoolList" size="1" class="smallSelect" style="border-color: grey; float:left;" value="#{navigation.schoolId}" rendered="#{identity.loggedIn}"> <f:selectItems value="#{databaseBackedList.schoolMasterList}" /> </h:selectOneListbox> <h:commandButton id="selectSchoolButton" style="float:right;" action="#{navigation.setSchoolIdToSession}" value="#{messages.btnSave}"> <s:conversationPropagation value="none"></s:conversationPropagation> </h:commandButton> </h:panelGrid> </h:form>
and the action method which is called when i click on save button .
@Stateful @Name("navigation") @Scope(ScopeType.SESSION) public class NavigationAction implements Navigation { @Logger private Log log; @In FacesMessages facesMessages; private int schoolId; public String setSchoolIdToSession() { Contexts.getSessionContext().set("schoolId", schoolId); redirectionInPage="students.xhtml"; return redirectionInPage; } @Destroy @Remove public void destroy() { log.info(":::::::::: Destroying Navigation Action ::::::::::"); } public int getSchoolId() { return schoolId; } public void setSchoolId(int schoolId) { this.schoolId = schoolId; } }
and finally the component which we want with the refreshed data is manageStudent having method search
@SuppressWarnings("unchecked") @Create public void search() { log.info("Enter into serach method of manage School"); StringBuffer searchQuery = new StringBuffer( "select spsl from Student spsl where spsl.flgDeleted='0' "); searchQuery.append(" and spsl.school.ischoolId="); searchQuery.append(Contexts.getSessionContext().get("schoolId")); // Check if name is filled studentList = tenantEntityManager.createQuery( searchQuery.toString()).getResultList(); log.info("Exit from serach method"); }
and one more point that when i click on the manageStudents link which i have put in left side bar then the grid gets refreshed.
the Code for left side bar is:<s:link view="/students.xhtml" propagation="none"> <div class="nonSelectedSideLink" id="schoolId"> Manage School</div> </s:link>
My main problem is fron right side bar the search grid is not refreshing.
Thanks in advance.
-
3. Re: Search grid is not refreshing on change of right side bar
vikram.vikram.chhetry.gmail.com Jun 2, 2011 3:30 AM (in response to asc)Ankita,
Do you see same cid on the URL query string after saving the school in session?
I think if you can add a new non existing cid like '0' with the redirection url, if should work. Something like below:
redirectionInPage="students.xhtml?cid=0"; return redirectionInPage;
--
Vikram
-
4. Re: Search grid is not refreshing on change of right side bar
asc Jun 8, 2011 2:00 AM (in response to asc)Thanks Vikram.
My issue has been resolved by implementing the solution given by you.