sjg:grid in modal window not getting displayed atall
I am trying to use sjg:grid in a modal window which is opened from a tabbed panel. Have the below code. Everything seams right to me. The modal window opens and displays other stuff but the grid is not getting displayed atall. The getJSON() in the action class is never getting called. I did similar code in another page and it worked fine. Only difference being now I am trying it on the modal window. Please need help with this. Not sure what am I missing here. jspCode . struts.xml .. Action class public class CreateDepartmentAction extends ActionSupport implements SessionAware { . private List searchResults = new ArrayList(); public String execute() { retrieveSearchDepartmentsResults(); return SUCCESS; } public String retrieveSearchDepartmentsResults() { try { setSearchResults(getSearchResultsBasedOnCriteria()); int to = (rows * page); int from = to - rows; records = getSearchResults().size(); searchResults = getSearchResults(); total =(int) Math.ceil((double)records / (double)rows); } catch (Exception e) { return ERROR; } return SUCCESS; } } ... getters and setters public String getJSON() { return retrieveSearchDepartmentsResults(); } }
RE: sjg:grid in modal window not getting displayed atall
Adding one more action configuration to this of struts.xml > From: zy...@hotmail.com > To: user@struts.apache.org > Subject: sjg:grid in modal window not getting displayed atall > Date: Fri, 4 Sep 2015 09:53:36 -0400 > > I am trying to use sjg:grid in a modal window which is opened from a tabbed > panel. > > > Have the below code. Everything seams right to me. The modal window opens and > displays other stuff but the grid is not getting displayed atall. The > getJSON() in the action class is never getting called. > > > I did similar code in another page and it worked fine. Only difference being > now I am trying it on the modal window. > > > > Please need help with this. Not sure what am I missing here. > > > > >searchDepartment.jspCode > > . > > > > > id="id" > > caption="Testing" > > dataType="json" > > href="%{searchResultsUrl}" > > pager="true" > > gridModel="searchResults" > > rowList="10,15,20" > > rowNum="15" > > rownumbers="true" > > viewrecords="true" > > autowidth="true" > > navigator="true" > > navigatorAdd="false" > > navigatorViewOptions="{height:280, width:500}" > > navigatorDelete="true" > > navigatorDeleteOptions="{height:280, > width:500,reloadAfterSubmit:true}" > > navigatorEdit="false" > > navigatorRefresh="true" > > navigatorSearch="false" > > multiselect="true" > > onSelectRowTopics="rowselect" > > loadonce="true" > > > > > title="Department Number" key="true" sortable="true"/> > > title="Department Description" sortable="false"/> > > > > > > > struts.xml /jsp/searchDepartment.jsp searchDepartment > > namespace="/grid"> > > .. > > > > > > > > > > > > > > > > > > > Action class > > public class CreateDepartmentAction extends ActionSupport implements > SessionAware { > > . > > > > private List searchResults = new ArrayList(); > > public String execute() { > > retrieveSearchDepartmentsResults(); > > > > return SUCCESS; > > } > > > public String retrieveSearchDepartmentsResults() { > > > > try { > > setSearchResults(getSearchResultsBasedOnCriteria()); > > int to = (rows * page); > > int from = to - rows; > > records = getSearchResults().size(); > > searchResults = getSearchResults(); > > total =(int) Math.ceil((double)records / (double)rows); > > } catch (Exception e) { > > return ERROR; > > } > > return SUCCESS; > > } > > > > } > > ... > > getters and setters > > > > public String getJSON() > > { > > return retrieveSearchDepartmentsResults(); > > } > > > } >
RE: sjg:grid in modal window not getting displayed atall
I got this working. Thanks. > From: zy...@hotmail.com > To: user@struts.apache.org > Subject: RE: sjg:grid in modal window not getting displayed atall > Date: Fri, 4 Sep 2015 10:25:32 -0400 > > Adding one more action configuration to this of struts.xml > > > From: zy...@hotmail.com > > To: user@struts.apache.org > > Subject: sjg:grid in modal window not getting displayed atall > > Date: Fri, 4 Sep 2015 09:53:36 -0400 > > > > I am trying to use sjg:grid in a modal window which is opened from a tabbed > > panel. > > > > > > Have the below code. Everything seams right to me. The modal window opens > > and displays other stuff but the grid is not getting displayed atall. The > > getJSON() in the action class is never getting called. > > > > > > I did similar code in another page and it worked fine. Only difference > > being now I am trying it on the modal window. > > > > > > > > Please need help with this. Not sure what am I missing here. > > > > > > > > > >searchDepartment.jspCode > > > > . > > > > > > > > > > > id="id" > > > > caption="Testing" > > > > dataType="json" > > > > href="%{searchResultsUrl}" > > > > pager="true" > > > > gridModel="searchResults" > > > > rowList="10,15,20" > > > > rowNum="15" > > > > rownumbers="true" > > > > viewrecords="true" > > > > autowidth="true" > > > > navigator="true" > > > > navigatorAdd="false" > > > > navigatorViewOptions="{height:280, width:500}" > > > > navigatorDelete="true" > > > > navigatorDeleteOptions="{height:280, > > width:500,reloadAfterSubmit:true}" > > > > navigatorEdit="false" > > > > navigatorRefresh="true" > > > > navigatorSearch="false" > > > > multiselect="true" > > > > onSelectRowTopics="rowselect" > > > > loadonce="true" > > > > > > > > > > title="Department Number" key="true" sortable="true"/> > > > > > title="Department Description" sortable="false"/> > > > > > > > > > > > > > > struts.xml > namespace="/"> > > > > /jsp/searchDepartment.jsp > >searchDepartment > > > > > > > > > > namespace="/grid"> > > > > .. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Action class > > > > public class CreateDepartmentAction extends ActionSupport implements > > SessionAware { > > > > . > > > > > > > > private List searchResults = new ArrayList(); > > > > public String execute() { > > > > retrieveSearchDepartmentsResults(); > > > > > > > > return SUCCESS; > > > > } > > > > > > public String retrieveSearchDepartmentsResults() { > > > > > > > > try { > > > > setSearchResults(getSearchResultsBasedOnCriteria()); > > > > int to = (rows * page); > > > > int from = to - rows; > > > > records = getSearchResults().size(); > > > > searchResults = getSearchResults(); > > > > total =(int) Math.ceil((double)records / (double)rows); > > > > } catch (Exception e) { > > > > return ERROR; > > > > } > > > > return SUCCESS; > > > > } > > > > > > > > } > > > > ... > > > > getters and setters > > > > > > > > public String getJSON() > > > > { > > > > return retrieveSearchDepartmentsResults(); > > > > } > > > > > > } > > >