struts2-jquery

Autocomplete a textbox using sj:autocompleter with a dynamic list

℡╲_俬逩灬. 提交于 2019-11-29 16:55:57
I am intending to display a list of suggestions for a textbox using sj:autocompleter . When I hard code the data in the jsp it works fine. <sj:autocompleter name="fruitNames" list="{'apple', 'banana', 'orange', 'apricot'}" label="Fruit Names"> </sj:autocompleter> But I want to get the list of suggestions dynamically from the action class. I tried doing this but it is not getting the values. <sj:autocompleter name="fruitNames" list="fruitslist" label="Fruit Names"> </sj:autocompleter> In my action class, public String execute() { fruitslist= new ArrayList<String>(); fruitslist.add("Apple");

Struts 2 Jquery tab navigation

独自空忆成欢 提交于 2019-11-29 16:45:58
When navigating from one tab to another, i.e, on clicking the submit button in a tab1 (which is jsp) the tab2 has to get loaded. My code is below. <sj:tabbedpanel id="remotetabs" onCompleteTopics="tabcomplete" onChangeTopics="tabchange"> <sj:tab id="tab1" href="test1.jsp" label="Tab One" /> <sj:tab id="tab2" href="test2.jsp" label="Tab Two" /> </sj:tabbedpanel><sj:submit></sj:submit> The jsp I have used is <s:url var="remoteurl1" action="ajax1" /> <s:url var="remoteurl2" action="ajax2" /> <sj:tabbedpanel id="tabpanel"> <sj:tab id="tab1" href="Test1.jsp" label="Tab One" /> <sj:tab id="tab2"

How to implement a pagination in Struts 2

喜你入骨 提交于 2019-11-29 15:01:48
问题 How can I implement paging in Struts 2 for the client side display and Hibernate as the persistence layer. Here is the code that I have done so far: <display:table id="students" name="students" pagesize="2" export="false" requestURI="/student"> <display:column property="studentRoll" title="Roll" paramId="studentRoll" sortable="true" /> <display:column property="studentName" title="Name" sortable="true" /> <display:column property="studentCourse" title="Course" sortable="true" /> <display

Struts 2 jquery sj:select and json result

被刻印的时光 ゝ 提交于 2019-11-29 12:43:22
I am using struts 2 jquery plugin select component. The action is: SampleAction { private List<SampleVO> samples; //With setters and getters private List<AnotherVO> anotherList; //With setters and getters private String anString; //With setters and getters @Action(value = "/loadSelect", results = { @Result(name = "success", type = "json")}) public String loadSomeSamples() { samples = new ArrayList<SampleVO>(); //Put some object in samples. return SUCCESS; } } The jsp is <sj:select list="samples" /> The problem is that the json plugin will serialize all the properties in action ( anotherList ,

struts2, ajax and injected jquery tag

纵饮孤独 提交于 2019-11-29 12:07:11
I am using Struts 2.3 with struts2-jQuery-plugin. I have to load dynamically with ajax a result from an action. In the JSP there is some normal html and a jQuery tag <sj:datepicker cssClass="dataScadenzaDiv" id="dataScadenzaDiv" name="dataScadenza" maxDate="-1d" label="data scadenza" theme="xhtml"/> All works OK and the code injected with ajax is: <!-- lotto dpi --> <tr> <td class="tdLabel"><label for="lotto" class="label">Lotto:</label></td> <td><input type="text" name="txtLotto" size="15" value="" id="lotto"/></td> </tr> <!-- tGestDataScadenza --> <div id="dataScadenzaAjax"></div> <input

struts2 jquery ajax and client side validatio not working toghether

*爱你&永不变心* 提交于 2019-11-29 05:20:35
I have used standard code snippet from http://struts.jgeppert.com/struts2-jquery-showcase/index.action and http://code.google.com/p/struts2-jquery/wiki/Validation . But the client side and ajax server side validations are not working together. The problem is form submission does not stop and action gets called even if we preventDefault or do anything else. <%@ taglib prefix="s" uri="/struts-tags"%> <%@ taglib prefix="sj" uri="/struts-jquery-tags"%> <html> <head> <sj:head jqueryui="true"/> </head> <body> <div id="result"> <s:actionerror/> <s:fielderror fieldName="name" value="eroor"></s

Autocomplete a textbox using sj:autocompleter with a dynamic list

牧云@^-^@ 提交于 2019-11-28 11:37:00
问题 I am intending to display a list of suggestions for a textbox using sj:autocompleter . When I hard code the data in the jsp it works fine. <sj:autocompleter name="fruitNames" list="{'apple', 'banana', 'orange', 'apricot'}" label="Fruit Names"> </sj:autocompleter> But I want to get the list of suggestions dynamically from the action class. I tried doing this but it is not getting the values. <sj:autocompleter name="fruitNames" list="fruitslist" label="Fruit Names"> </sj:autocompleter> In my

Struts 2 Jquery tab navigation

旧巷老猫 提交于 2019-11-28 10:39:32
问题 When navigating from one tab to another, i.e, on clicking the submit button in a tab1 (which is jsp) the tab2 has to get loaded. My code is below. <sj:tabbedpanel id="remotetabs" onCompleteTopics="tabcomplete" onChangeTopics="tabchange"> <sj:tab id="tab1" href="test1.jsp" label="Tab One" /> <sj:tab id="tab2" href="test2.jsp" label="Tab Two" /> </sj:tabbedpanel><sj:submit></sj:submit> The jsp I have used is <s:url var="remoteurl1" action="ajax1" /> <s:url var="remoteurl2" action="ajax2" /> <sj

struts2, ajax and injected jquery tag

房东的猫 提交于 2019-11-28 05:53:53
问题 I am using Struts 2.3 with struts2-jQuery-plugin. I have to load dynamically with ajax a result from an action. In the JSP there is some normal html and a jQuery tag <sj:datepicker cssClass="dataScadenzaDiv" id="dataScadenzaDiv" name="dataScadenza" maxDate="-1d" label="data scadenza" theme="xhtml"/> All works OK and the code injected with ajax is: <!-- lotto dpi --> <tr> <td class="tdLabel"><label for="lotto" class="label">Lotto:</label></td> <td><input type="text" name="txtLotto" size="15"

struts2 jquery ajax and client side validatio not working toghether

我的梦境 提交于 2019-11-27 23:01:42
问题 I have used standard code snippet from http://struts.jgeppert.com/struts2-jquery-showcase/index.action and http://code.google.com/p/struts2-jquery/wiki/Validation. But the client side and ajax server side validations are not working together. The problem is form submission does not stop and action gets called even if we preventDefault or do anything else. <%@ taglib prefix="s" uri="/struts-tags"%> <%@ taglib prefix="sj" uri="/struts-jquery-tags"%> <html> <head> <sj:head jqueryui="true"/> <