You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by nani2ratna <na...@gmail.com> on 2010/03/04 13:29:15 UTC

Struts2 JQuery select box

Hi,

I am trying to use http://code.google.com/p/struts2-jquery/ for loading
select box.
I just followed this link
http://www.weinfreund.de/struts2-jquery-showcase/index.action#.

Every thing is executing fine.
But the list not loading properly.
I am new to JSON.

I changed below jsp page which was working fine with normal select box.

my code is 

JSP
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<html>
	<head>
	  <sj:head jqueryui="true" locale="za" jquerytheme="smoothness"/>
	</head>
	<body>
<div class="loginmodules">
<s:form action="updatePMDetails" id="updatePMDetails" namespace="/secure"
theme="simple" cssClass="form1">
	<fieldset class="form1bg">		
 	<legend>Product Master Description Details</legend>
 		<dl>
			<dt><s:actionerror cssClass="error"/> </dt>
			<dd><s:fielderror cssClass="error"/> </dd>
		</dl>
	 	<dl>
	 		<dt><s:label id="label_skuid" key="pminfo.skuid"/></dt>
			<dd><s:textfield title="SKUID tooltip" id="skuid" name="prodmDatPm.skuid"
readonly="true"/></dd>
		</dl>
		<dl>
			<dt><s:label id="label_prodcat" key="pminfo.prodcat"/></dt>
			<dd><s:textfield id="prodcat" name="prodmDatPm.prodcat"
readonly="true"/></dd>
		</dl>
		<dl>
			<dt><s:label id="label_websitecate" key="pminfo.website_category"/></dt>
			<dd>
				<s:url id="remoteurl" action="JsonAction"/> 
				<sj:select href="%{remoteurl}" cssClass="category" list="prodCatList"
listKey="prodcat" listValue="prodcat_desc"
				key="prodmDatPm.website_category"
value="prodmDatPm.website_category"></sj:select>
			</dd>
		</dl>
<s:form>
</body>
</html>


Above jsp got almost 100 fields. I just trancated it.


Action:


import java.util.ArrayList;
import java.util.List;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Actions;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;

import co.za.xxx.ecm.actions.EcmAction;
import co.za.xxx.ecm.business.vo.masterFile.PmProdCat;
import co.za.xxx.ecm.service.productmaster.ProdmDatPmService;

@ParentPackage(value = "pm-json")
public class JsonAction extends EcmAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3858830120549401006L;
	
	private List<PmProdCat> prodCatList;
	private ProdmDatPmService prodmDatPmService;

	public List<PmProdCat> getProdCatList() {
		return prodCatList;
	}
	public void setProdCatList(List<PmProdCat> prodCatList) {
		this.prodCatList = prodCatList;
	}
	public ProdmDatPmService getProdmDatPmService() {
		return prodmDatPmService;
	}
	public void setProdmDatPmService(ProdmDatPmService prodmDatPmService) {
		this.prodmDatPmService = prodmDatPmService;
	}
	
	@Actions( {
	    @Action(value = "/JsonAction", results = {
	      @Result(name = "success", type = "json")
	    })
	  })
	public String execute(){
		System.out.println("This is execute method in json action calss");
		prodCatList = new ArrayList<PmProdCat>();
		prodCatList = prodmDatPmService.getProdCatList();
		System.out.println(prodCatList);
		return SUCCESS;
	}
	
	public String getJSON()
	  {
		System.out.println("This is getJSon method in json action calss");
	    return execute();
	  }
}

Struts.xml

<package name="pm-json" extends="json-default">
    
    </package>



When jsp loading, its calling my action class.
Action class calling service class and loading list into prodcatList.
But its not getting into list box.

Can anybody please explain whats the problem is.

Thanks in advance
RS
-- 
View this message in context: http://old.nabble.com/Struts2-JQuery-select-box-tp27780125p27780125.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts2 JQuery select box

Posted by Johannes Geppert <jo...@web.de>.
did you work with hibernate?

I found this post that maybe helps you out.

http://www.codeweblog.com/solution-struts2-hibernate-integration-with-jsonpulugin-an-exception-when/


Best Regards

Johannes Geppert.


nani2ratna wrote:
> 
> HI,
> 
> I am trying to get this object 
> List<ProdmProdcat> prodcatList = new ArrayList<prodmProdcat>();
> ProdmProdcat is a java bean which got two properties.
> they are String prodcat_code;
> and String prodcat_desc;
> 
> Is this object fine.
> 
> Thanks and Regards
> RS
> 
> 
> nani2ratna wrote:
>> 
>> HI,
>> 
>> Thank you.
>> I executed the action.
>> It gave me the following exception
>> 
>> java.lang.IllegalAccessException: Class
>> org.apache.struts2.json.JSONWriter can not access a member of class
>> org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper with
>> modifiers "public"
>> 	sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
>> 	java.lang.reflect.Method.invoke(Method.java:588)
>> 	org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:227)
>> 	org.apache.struts2.json.JSONWriter.process(JSONWriter.java:165)
>> 	org.apache.struts2.json.JSONWriter.value(JSONWriter.java:131)
>> 
>> Thanks and Regards
>> RS
>> 
>> 
>> 
>> Johannes Geppert wrote:
>>> 
>>> you can just execute your action like a normal action.
>>> 
>>> http://localhost:8080/app/json.action 
>>> 
>>> The result should be a normal textfile which you can open 
>>> with notepad or whatever you want.
>>> 
>>> Also you can use Firebug "Network/XHR" to see your action response
>>> 
>>> Best Regards
>>> 
>>> Johannes Geppert
>>> 
>>> 
>>> nani2ratna wrote:
>>>> 
>>>> Hi Johanes,
>>>> 
>>>> Thanks for reply.
>>>> Actually I am very new to JSON.
>>>> Action is working fine.
>>>> 
>>>> I went through your code and redid the same type stuff in my app.
>>>> I don't know about JSON reponse.
>>>> Since in your action class there no result(jsp) mapped.
>>>> So I too did the same. I am just executing the action method. And I
>>>> don't know how to send response.
>>>> 
>>>> Can you please explain or send me some links.
>>>> So i can read and do that.
>>>> 
>>>> Thanks in advance
>>>> RS
>>>> 
>>>> 
>>>> 
>>>> Johannes Geppert wrote:
>>>>> 
>>>>> Hello,
>>>>> 
>>>>> did your JSON Actions works fine? 
>>>>> 
>>>>> Check if you really get an JSON response and the 
>>>>> variables inside the result have the same name.
>>>>> 
>>>>> Can you please POST your result with sample data?
>>>>> 
>>>>> Best Regards
>>>>> 
>>>>> Johannes Geppert
>>>>> 
>>>>> 
>>>>> nani2ratna wrote:
>>>>>> 
>>>>>> Hi,
>>>>>> 
>>>>>> I am trying to use http://code.google.com/p/struts2-jquery/ for
>>>>>> loading select box.
>>>>>> I just followed this link
>>>>>> http://www.weinfreund.de/struts2-jquery-showcase/index.action#.
>>>>>> 
>>>>>> Every thing is executing fine.
>>>>>> But the list not loading properly.
>>>>>> I am new to JSON.
>>>>>> 
>>>>>> I changed below jsp page which was working fine with normal select
>>>>>> box.
>>>>>> 
>>>>>> my code is 
>>>>>> 
>>>>> 
>>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 


-----
---
web: http://www.jgeppert.com
twitter: http://twitter.com/jogep

-- 
View this message in context: http://old.nabble.com/Struts2-JQuery-select-box-tp27780125p27782325.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts2 JQuery select box

Posted by Yoshi <ro...@gmail.com>.
Hi,

to exclude a property from be serialized just use the annotation on get
method of the property.

@JSON(serialize=false)





2010/3/4 nani2ratna <na...@gmail.com>

>
> Hi Johannes,
> I saw that one earlier.
> I found the bug.
> I have another property in my action class which is service class.
>
> So i excluded that service class from json.
> Now its working fine.
> I did this one,
> @Actions( {
>            @Action(value = "/JsonAction", results = {
>               @Result(name = "success", type = "json", params =
> {"excludeProperties", "prodmDatPmService"} )
>            })
>          })
>
> But how to exclude more than one property.
>
> Thanks and Regards
> RS
>
>
> nani2ratna wrote:
> >
> > HI,
> >
> > I am trying to get this object
> > List<ProdmProdcat> prodcatList = new ArrayList<prodmProdcat>();
> > ProdmProdcat is a java bean which got two properties.
> > they are String prodcat_code;
> > and String prodcat_desc;
> >
> > Is this object fine.
> >
> > Thanks and Regards
> > RS
> >
> >
> > nani2ratna wrote:
> >>
> >> HI,
> >>
> >> Thank you.
> >> I executed the action.
> >> It gave me the following exception
> >>
> >> java.lang.IllegalAccessException: Class
> >> org.apache.struts2.json.JSONWriter can not access a member of class
> >> org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper
> with
> >> modifiers "public"
> >>      sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
> >>      java.lang.reflect.Method.invoke(Method.java:588)
> >>      org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:227)
> >>      org.apache.struts2.json.JSONWriter.process(JSONWriter.java:165)
> >>      org.apache.struts2.json.JSONWriter.value(JSONWriter.java:131)
> >>
> >> Thanks and Regards
> >> RS
> >>
> >>
> >>
> >> Johannes Geppert wrote:
> >>>
> >>> you can just execute your action like a normal action.
> >>>
> >>> http://localhost:8080/app/json.action
> >>>
> >>> The result should be a normal textfile which you can open
> >>> with notepad or whatever you want.
> >>>
> >>> Also you can use Firebug "Network/XHR" to see your action response
> >>>
> >>> Best Regards
> >>>
> >>> Johannes Geppert
> >>>
> >>>
> >>> nani2ratna wrote:
> >>>>
> >>>> Hi Johanes,
> >>>>
> >>>> Thanks for reply.
> >>>> Actually I am very new to JSON.
> >>>> Action is working fine.
> >>>>
> >>>> I went through your code and redid the same type stuff in my app.
> >>>> I don't know about JSON reponse.
> >>>> Since in your action class there no result(jsp) mapped.
> >>>> So I too did the same. I am just executing the action method. And I
> >>>> don't know how to send response.
> >>>>
> >>>> Can you please explain or send me some links.
> >>>> So i can read and do that.
> >>>>
> >>>> Thanks in advance
> >>>> RS
> >>>>
> >>>>
> >>>>
> >>>> Johannes Geppert wrote:
> >>>>>
> >>>>> Hello,
> >>>>>
> >>>>> did your JSON Actions works fine?
> >>>>>
> >>>>> Check if you really get an JSON response and the
> >>>>> variables inside the result have the same name.
> >>>>>
> >>>>> Can you please POST your result with sample data?
> >>>>>
> >>>>> Best Regards
> >>>>>
> >>>>> Johannes Geppert
> >>>>>
> >>>>>
> >>>>> nani2ratna wrote:
> >>>>>>
> >>>>>> Hi,
> >>>>>>
> >>>>>> I am trying to use http://code.google.com/p/struts2-jquery/ for
> >>>>>> loading select box.
> >>>>>> I just followed this link
> >>>>>> http://www.weinfreund.de/struts2-jquery-showcase/index.action#.
> >>>>>>
> >>>>>> Every thing is executing fine.
> >>>>>> But the list not loading properly.
> >>>>>> I am new to JSON.
> >>>>>>
> >>>>>> I changed below jsp page which was working fine with normal select
> >>>>>> box.
> >>>>>>
> >>>>>> my code is
> >>>>>>
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>>
> >>>
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/Struts2-JQuery-select-box-tp27780125p27782386.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Struts2 JQuery select box

Posted by Johannes Geppert <jo...@web.de>.
some days after jquery UI 1.8 is final.

Best Regards

Johannes Geppert


nani2ratna wrote:
> 
> Thanks you very much Johannes.
> Can you tell me when the next version might be released.
> 


-----
---
web: http://www.jgeppert.com
twitter: http://twitter.com/jogep

-- 
View this message in context: http://old.nabble.com/Struts2-JQuery-select-box-tp27780125p27795725.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts2 JQuery select box

Posted by nani2ratna <na...@gmail.com>.
Thanks you very much Johannes.
Can you tell me when the next version might be released.


Thanks and Regards
RS



Johannes Geppert wrote:
> 
> 
> nani2ratna wrote:
>> 
>> But sj:select is not working like s:select.
>> If i use normal struts 2 select, values are loading normally.
>> But sj:select loading after all the elements in the jsp page rendered
>> completely.
>> 
> The Content is loaded via AJAX, and this was executed when the DOM is
> ready.
> 
> 
> nani2ratna wrote:
>> 
>> Another one, while loading the elements I am presetting the value of list
>> to some value using value attribute.
>> This one working is fine in s:select.
>> But not working with sj:select.
>> 
> http://code.google.com/p/struts2-jquery/issues/detail?id=107
> 
> This should be fixed in next version.
> 
> Best Regards
> 
> Johannes Geppert
> 

-- 
View this message in context: http://old.nabble.com/Struts2-JQuery-select-box-tp27780125p27795255.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts2 JQuery select box

Posted by Johannes Geppert <jo...@web.de>.

nani2ratna wrote:
> 
> But sj:select is not working like s:select.
> If i use normal struts 2 select, values are loading normally.
> But sj:select loading after all the elements in the jsp page rendered
> completely.
> 
The Content is loaded via AJAX, and this was executed when the DOM is ready.


nani2ratna wrote:
> 
> Another one, while loading the elements I am presetting the value of list
> to some value using value attribute.
> This one working is fine in s:select.
> But not working with sj:select.
> 
http://code.google.com/p/struts2-jquery/issues/detail?id=107

This should be fixed in next version.

Best Regards

Johannes Geppert

-----
---
web: http://www.jgeppert.com
twitter: http://twitter.com/jogep

-- 
View this message in context: http://old.nabble.com/Struts2-JQuery-select-box-tp27780125p27795175.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts2 JQuery select box

Posted by nani2ratna <na...@gmail.com>.
Hi,

I just came to work and saw your email.
Once again Thanks for replies.

But sj:select is not working like s:select.
If i use normal struts 2 select, its loading normally.
But sj:select loading after all the elements in the jsp page rendered
completely.

Another one, while loading the elements I am presetting the value of list to
some value using value attribute.
This one working is fine in s:select.
But not working with sj:select.

Did you work with value/ key attribute earlier.
Do i need to set any other attribute

Thanks and Regards
Ratna



Johannes Geppert wrote:
> 
> i think comma seperated, but i'am not sure.
> so your select box runs now??
> 
> Best Regards
> 
> Johannes Geppert
> 
> 
> nani2ratna wrote:
>> 
>> Hi Johannes,
>> I saw that one earlier.
>> I found the bug.
>> I have another property in my action class which is service class.
>> 
>> So i excluded that service class from json.
>> Now its working fine.
>> I did this one, 
>> @Actions( {
>> 	    @Action(value = "/JsonAction", results = {
>> 	      @Result(name = "success", type = "json", params =
>> {"excludeProperties", "prodmDatPmService"} )
>> 	    })
>> 	  })
>> 
>> But how to exclude more than one property.
>> 
>> Thanks and Regards
>> RS
>> 
>> 
>> nani2ratna wrote:
>>> 
>>> HI,
>>> 
>>> I am trying to get this object 
>>> List<ProdmProdcat> prodcatList = new ArrayList<prodmProdcat>();
>>> ProdmProdcat is a java bean which got two properties.
>>> they are String prodcat_code;
>>> and String prodcat_desc;
>>> 
>>> Is this object fine.
>>> 
>>> Thanks and Regards
>>> RS
>>> 
>>> 
>>> nani2ratna wrote:
>>>> 
>>>> HI,
>>>> 
>>>> Thank you.
>>>> I executed the action.
>>>> It gave me the following exception
>>>> 
>>>> java.lang.IllegalAccessException: Class
>>>> org.apache.struts2.json.JSONWriter can not access a member of class
>>>> org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper
>>>> with modifiers "public"
>>>> 	sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
>>>> 	java.lang.reflect.Method.invoke(Method.java:588)
>>>> 	org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:227)
>>>> 	org.apache.struts2.json.JSONWriter.process(JSONWriter.java:165)
>>>> 	org.apache.struts2.json.JSONWriter.value(JSONWriter.java:131)
>>>> 
>>>> Thanks and Regards
>>>> RS
>>>> 
>>>> 
>>>> 
>>>> Johannes Geppert wrote:
>>>>> 
>>>>> you can just execute your action like a normal action.
>>>>> 
>>>>> http://localhost:8080/app/json.action 
>>>>> 
>>>>> The result should be a normal textfile which you can open 
>>>>> with notepad or whatever you want.
>>>>> 
>>>>> Also you can use Firebug "Network/XHR" to see your action response
>>>>> 
>>>>> Best Regards
>>>>> 
>>>>> Johannes Geppert
>>>>> 
>>>>> 
>>>>> nani2ratna wrote:
>>>>>> 
>>>>>> Hi Johanes,
>>>>>> 
>>>>>> Thanks for reply.
>>>>>> Actually I am very new to JSON.
>>>>>> Action is working fine.
>>>>>> 
>>>>>> I went through your code and redid the same type stuff in my app.
>>>>>> I don't know about JSON reponse.
>>>>>> Since in your action class there no result(jsp) mapped.
>>>>>> So I too did the same. I am just executing the action method. And I
>>>>>> don't know how to send response.
>>>>>> 
>>>>>> Can you please explain or send me some links.
>>>>>> So i can read and do that.
>>>>>> 
>>>>>> Thanks in advance
>>>>>> RS
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> Johannes Geppert wrote:
>>>>>>> 
>>>>>>> Hello,
>>>>>>> 
>>>>>>> did your JSON Actions works fine? 
>>>>>>> 
>>>>>>> Check if you really get an JSON response and the 
>>>>>>> variables inside the result have the same name.
>>>>>>> 
>>>>>>> Can you please POST your result with sample data?
>>>>>>> 
>>>>>>> Best Regards
>>>>>>> 
>>>>>>> Johannes Geppert
>>>>>>> 
>>>>>>> 
>>>>>>> nani2ratna wrote:
>>>>>>>> 
>>>>>>>> Hi,
>>>>>>>> 
>>>>>>>> I am trying to use http://code.google.com/p/struts2-jquery/ for
>>>>>>>> loading select box.
>>>>>>>> I just followed this link
>>>>>>>> http://www.weinfreund.de/struts2-jquery-showcase/index.action#.
>>>>>>>> 
>>>>>>>> Every thing is executing fine.
>>>>>>>> But the list not loading properly.
>>>>>>>> I am new to JSON.
>>>>>>>> 
>>>>>>>> I changed below jsp page which was working fine with normal select
>>>>>>>> box.
>>>>>>>> 
>>>>>>>> my code is 
>>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>>> 
>>>>> 
>>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Struts2-JQuery-select-box-tp27780125p27791296.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts2 JQuery select box

Posted by Johannes Geppert <jo...@web.de>.
i think comma seperated, but i'am not sure.
so your select box runs now??

Best Regards

Johannes Geppert


nani2ratna wrote:
> 
> Hi Johannes,
> I saw that one earlier.
> I found the bug.
> I have another property in my action class which is service class.
> 
> So i excluded that service class from json.
> Now its working fine.
> I did this one, 
> @Actions( {
> 	    @Action(value = "/JsonAction", results = {
> 	      @Result(name = "success", type = "json", params =
> {"excludeProperties", "prodmDatPmService"} )
> 	    })
> 	  })
> 
> But how to exclude more than one property.
> 
> Thanks and Regards
> RS
> 
> 
> nani2ratna wrote:
>> 
>> HI,
>> 
>> I am trying to get this object 
>> List<ProdmProdcat> prodcatList = new ArrayList<prodmProdcat>();
>> ProdmProdcat is a java bean which got two properties.
>> they are String prodcat_code;
>> and String prodcat_desc;
>> 
>> Is this object fine.
>> 
>> Thanks and Regards
>> RS
>> 
>> 
>> nani2ratna wrote:
>>> 
>>> HI,
>>> 
>>> Thank you.
>>> I executed the action.
>>> It gave me the following exception
>>> 
>>> java.lang.IllegalAccessException: Class
>>> org.apache.struts2.json.JSONWriter can not access a member of class
>>> org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper
>>> with modifiers "public"
>>> 	sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
>>> 	java.lang.reflect.Method.invoke(Method.java:588)
>>> 	org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:227)
>>> 	org.apache.struts2.json.JSONWriter.process(JSONWriter.java:165)
>>> 	org.apache.struts2.json.JSONWriter.value(JSONWriter.java:131)
>>> 
>>> Thanks and Regards
>>> RS
>>> 
>>> 
>>> 
>>> Johannes Geppert wrote:
>>>> 
>>>> you can just execute your action like a normal action.
>>>> 
>>>> http://localhost:8080/app/json.action 
>>>> 
>>>> The result should be a normal textfile which you can open 
>>>> with notepad or whatever you want.
>>>> 
>>>> Also you can use Firebug "Network/XHR" to see your action response
>>>> 
>>>> Best Regards
>>>> 
>>>> Johannes Geppert
>>>> 
>>>> 
>>>> nani2ratna wrote:
>>>>> 
>>>>> Hi Johanes,
>>>>> 
>>>>> Thanks for reply.
>>>>> Actually I am very new to JSON.
>>>>> Action is working fine.
>>>>> 
>>>>> I went through your code and redid the same type stuff in my app.
>>>>> I don't know about JSON reponse.
>>>>> Since in your action class there no result(jsp) mapped.
>>>>> So I too did the same. I am just executing the action method. And I
>>>>> don't know how to send response.
>>>>> 
>>>>> Can you please explain or send me some links.
>>>>> So i can read and do that.
>>>>> 
>>>>> Thanks in advance
>>>>> RS
>>>>> 
>>>>> 
>>>>> 
>>>>> Johannes Geppert wrote:
>>>>>> 
>>>>>> Hello,
>>>>>> 
>>>>>> did your JSON Actions works fine? 
>>>>>> 
>>>>>> Check if you really get an JSON response and the 
>>>>>> variables inside the result have the same name.
>>>>>> 
>>>>>> Can you please POST your result with sample data?
>>>>>> 
>>>>>> Best Regards
>>>>>> 
>>>>>> Johannes Geppert
>>>>>> 
>>>>>> 
>>>>>> nani2ratna wrote:
>>>>>>> 
>>>>>>> Hi,
>>>>>>> 
>>>>>>> I am trying to use http://code.google.com/p/struts2-jquery/ for
>>>>>>> loading select box.
>>>>>>> I just followed this link
>>>>>>> http://www.weinfreund.de/struts2-jquery-showcase/index.action#.
>>>>>>> 
>>>>>>> Every thing is executing fine.
>>>>>>> But the list not loading properly.
>>>>>>> I am new to JSON.
>>>>>>> 
>>>>>>> I changed below jsp page which was working fine with normal select
>>>>>>> box.
>>>>>>> 
>>>>>>> my code is 
>>>>>>> 
>>>>>> 
>>>>>> 
>>>>> 
>>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 


-----
---
web: http://www.jgeppert.com
twitter: http://twitter.com/jogep

-- 
View this message in context: http://old.nabble.com/Struts2-JQuery-select-box-tp27780125p27782448.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts2 JQuery select box

Posted by nani2ratna <na...@gmail.com>.
Hi Johannes,
I saw that one earlier.
I found the bug.
I have another property in my action class which is service class.

So i excluded that service class from json.
Now its working fine.
I did this one, 
@Actions( {
	    @Action(value = "/JsonAction", results = {
	      @Result(name = "success", type = "json", params =
{"excludeProperties", "prodmDatPmService"} )
	    })
	  })

But how to exclude more than one property.

Thanks and Regards
RS


nani2ratna wrote:
> 
> HI,
> 
> I am trying to get this object 
> List<ProdmProdcat> prodcatList = new ArrayList<prodmProdcat>();
> ProdmProdcat is a java bean which got two properties.
> they are String prodcat_code;
> and String prodcat_desc;
> 
> Is this object fine.
> 
> Thanks and Regards
> RS
> 
> 
> nani2ratna wrote:
>> 
>> HI,
>> 
>> Thank you.
>> I executed the action.
>> It gave me the following exception
>> 
>> java.lang.IllegalAccessException: Class
>> org.apache.struts2.json.JSONWriter can not access a member of class
>> org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper with
>> modifiers "public"
>> 	sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
>> 	java.lang.reflect.Method.invoke(Method.java:588)
>> 	org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:227)
>> 	org.apache.struts2.json.JSONWriter.process(JSONWriter.java:165)
>> 	org.apache.struts2.json.JSONWriter.value(JSONWriter.java:131)
>> 
>> Thanks and Regards
>> RS
>> 
>> 
>> 
>> Johannes Geppert wrote:
>>> 
>>> you can just execute your action like a normal action.
>>> 
>>> http://localhost:8080/app/json.action 
>>> 
>>> The result should be a normal textfile which you can open 
>>> with notepad or whatever you want.
>>> 
>>> Also you can use Firebug "Network/XHR" to see your action response
>>> 
>>> Best Regards
>>> 
>>> Johannes Geppert
>>> 
>>> 
>>> nani2ratna wrote:
>>>> 
>>>> Hi Johanes,
>>>> 
>>>> Thanks for reply.
>>>> Actually I am very new to JSON.
>>>> Action is working fine.
>>>> 
>>>> I went through your code and redid the same type stuff in my app.
>>>> I don't know about JSON reponse.
>>>> Since in your action class there no result(jsp) mapped.
>>>> So I too did the same. I am just executing the action method. And I
>>>> don't know how to send response.
>>>> 
>>>> Can you please explain or send me some links.
>>>> So i can read and do that.
>>>> 
>>>> Thanks in advance
>>>> RS
>>>> 
>>>> 
>>>> 
>>>> Johannes Geppert wrote:
>>>>> 
>>>>> Hello,
>>>>> 
>>>>> did your JSON Actions works fine? 
>>>>> 
>>>>> Check if you really get an JSON response and the 
>>>>> variables inside the result have the same name.
>>>>> 
>>>>> Can you please POST your result with sample data?
>>>>> 
>>>>> Best Regards
>>>>> 
>>>>> Johannes Geppert
>>>>> 
>>>>> 
>>>>> nani2ratna wrote:
>>>>>> 
>>>>>> Hi,
>>>>>> 
>>>>>> I am trying to use http://code.google.com/p/struts2-jquery/ for
>>>>>> loading select box.
>>>>>> I just followed this link
>>>>>> http://www.weinfreund.de/struts2-jquery-showcase/index.action#.
>>>>>> 
>>>>>> Every thing is executing fine.
>>>>>> But the list not loading properly.
>>>>>> I am new to JSON.
>>>>>> 
>>>>>> I changed below jsp page which was working fine with normal select
>>>>>> box.
>>>>>> 
>>>>>> my code is 
>>>>>> 
>>>>> 
>>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Struts2-JQuery-select-box-tp27780125p27782386.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts2 JQuery select box

Posted by nani2ratna <na...@gmail.com>.
HI,

I am trying to get this object 
List<ProdmProdcat> prodcatList = new ArrayList<prodmProdcat>();
ProdmProdcat is a java bean which got two properties.
they are String prodcat_code;
and String prodcat_desc;

Is this object fine.

Thanks and Regards
RS


nani2ratna wrote:
> 
> HI,
> 
> Thank you.
> I executed the action.
> It gave me the following exception
> 
> java.lang.IllegalAccessException: Class org.apache.struts2.json.JSONWriter
> can not access a member of class
> org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper with
> modifiers "public"
> 	sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
> 	java.lang.reflect.Method.invoke(Method.java:588)
> 	org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:227)
> 	org.apache.struts2.json.JSONWriter.process(JSONWriter.java:165)
> 	org.apache.struts2.json.JSONWriter.value(JSONWriter.java:131)
> 
> Thanks and Regards
> RS
> 
> 
> 
> Johannes Geppert wrote:
>> 
>> you can just execute your action like a normal action.
>> 
>> http://localhost:8080/app/json.action 
>> 
>> The result should be a normal textfile which you can open 
>> with notepad or whatever you want.
>> 
>> Also you can use Firebug "Network/XHR" to see your action response
>> 
>> Best Regards
>> 
>> Johannes Geppert
>> 
>> 
>> nani2ratna wrote:
>>> 
>>> Hi Johanes,
>>> 
>>> Thanks for reply.
>>> Actually I am very new to JSON.
>>> Action is working fine.
>>> 
>>> I went through your code and redid the same type stuff in my app.
>>> I don't know about JSON reponse.
>>> Since in your action class there no result(jsp) mapped.
>>> So I too did the same. I am just executing the action method. And I
>>> don't know how to send response.
>>> 
>>> Can you please explain or send me some links.
>>> So i can read and do that.
>>> 
>>> Thanks in advance
>>> RS
>>> 
>>> 
>>> 
>>> Johannes Geppert wrote:
>>>> 
>>>> Hello,
>>>> 
>>>> did your JSON Actions works fine? 
>>>> 
>>>> Check if you really get an JSON response and the 
>>>> variables inside the result have the same name.
>>>> 
>>>> Can you please POST your result with sample data?
>>>> 
>>>> Best Regards
>>>> 
>>>> Johannes Geppert
>>>> 
>>>> 
>>>> nani2ratna wrote:
>>>>> 
>>>>> Hi,
>>>>> 
>>>>> I am trying to use http://code.google.com/p/struts2-jquery/ for
>>>>> loading select box.
>>>>> I just followed this link
>>>>> http://www.weinfreund.de/struts2-jquery-showcase/index.action#.
>>>>> 
>>>>> Every thing is executing fine.
>>>>> But the list not loading properly.
>>>>> I am new to JSON.
>>>>> 
>>>>> I changed below jsp page which was working fine with normal select
>>>>> box.
>>>>> 
>>>>> my code is 
>>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Struts2-JQuery-select-box-tp27780125p27782120.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts2 JQuery select box

Posted by Johannes Geppert <jo...@web.de>.
looks like the json plugin has a problem while accessing a member.
you can try to exclude it, when you know which it is.

Best Regards

Johannes Geppert


nani2ratna wrote:
> 
> HI,
> 
> Thank you.
> I executed the action.
> It gave me the following exception
> 
> java.lang.IllegalAccessException: Class org.apache.struts2.json.JSONWriter
> can not access a member of class
> org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper with
> modifiers "public"
> 	sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
> 	java.lang.reflect.Method.invoke(Method.java:588)
> 	org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:227)
> 	org.apache.struts2.json.JSONWriter.process(JSONWriter.java:165)
> 	org.apache.struts2.json.JSONWriter.value(JSONWriter.java:131)
> 
> Thanks and Regards
> RS
> 
> 


-----
---
web: http://www.jgeppert.com
twitter: http://twitter.com/jogep

-- 
View this message in context: http://old.nabble.com/Struts2-JQuery-select-box-tp27780125p27782105.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts2 JQuery select box

Posted by nani2ratna <na...@gmail.com>.
HI,

Thank you.
I executed the action.
It gave me the following exception

java.lang.IllegalAccessException: Class org.apache.struts2.json.JSONWriter
can not access a member of class
org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper with
modifiers "public"
	sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
	java.lang.reflect.Method.invoke(Method.java:588)
	org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:227)
	org.apache.struts2.json.JSONWriter.process(JSONWriter.java:165)
	org.apache.struts2.json.JSONWriter.value(JSONWriter.java:131)

Thanks and Regards
RS



Johannes Geppert wrote:
> 
> you can just execute your action like a normal action.
> 
> http://localhost:8080/app/json.action 
> 
> The result should be a normal textfile which you can open 
> with notepad or whatever you want.
> 
> Also you can use Firebug "Network/XHR" to see your action response
> 
> Best Regards
> 
> Johannes Geppert
> 
> 
> nani2ratna wrote:
>> 
>> Hi Johanes,
>> 
>> Thanks for reply.
>> Actually I am very new to JSON.
>> Action is working fine.
>> 
>> I went through your code and redid the same type stuff in my app.
>> I don't know about JSON reponse.
>> Since in your action class there no result(jsp) mapped.
>> So I too did the same. I am just executing the action method. And I don't
>> know how to send response.
>> 
>> Can you please explain or send me some links.
>> So i can read and do that.
>> 
>> Thanks in advance
>> RS
>> 
>> 
>> 
>> Johannes Geppert wrote:
>>> 
>>> Hello,
>>> 
>>> did your JSON Actions works fine? 
>>> 
>>> Check if you really get an JSON response and the 
>>> variables inside the result have the same name.
>>> 
>>> Can you please POST your result with sample data?
>>> 
>>> Best Regards
>>> 
>>> Johannes Geppert
>>> 
>>> 
>>> nani2ratna wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> I am trying to use http://code.google.com/p/struts2-jquery/ for loading
>>>> select box.
>>>> I just followed this link
>>>> http://www.weinfreund.de/struts2-jquery-showcase/index.action#.
>>>> 
>>>> Every thing is executing fine.
>>>> But the list not loading properly.
>>>> I am new to JSON.
>>>> 
>>>> I changed below jsp page which was working fine with normal select box.
>>>> 
>>>> my code is 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Struts2-JQuery-select-box-tp27780125p27782047.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts2 JQuery select box

Posted by Johannes Geppert <jo...@web.de>.
you can just execute your action like a normal action.

http://localhost:8080/app/json.action 

The result should be a normal textfile which you can open 
with notepad or whatever you want.

Also you can use Firebug "Network/XHR" to see your action response

Best Regards

Johannes Geppert


nani2ratna wrote:
> 
> Hi Johanes,
> 
> Thanks for reply.
> Actually I am very new to JSON.
> Action is working fine.
> 
> I went through your code and redid the same type stuff in my app.
> I don't know about JSON reponse.
> Since in your action class there no result(jsp) mapped.
> So I too did the same. I am just executing the action method. And I don't
> know how to send response.
> 
> Can you please explain or send me some links.
> So i can read and do that.
> 
> Thanks in advance
> RS
> 
> 
> 
> Johannes Geppert wrote:
>> 
>> Hello,
>> 
>> did your JSON Actions works fine? 
>> 
>> Check if you really get an JSON response and the 
>> variables inside the result have the same name.
>> 
>> Can you please POST your result with sample data?
>> 
>> Best Regards
>> 
>> Johannes Geppert
>> 
>> 
>> nani2ratna wrote:
>>> 
>>> Hi,
>>> 
>>> I am trying to use http://code.google.com/p/struts2-jquery/ for loading
>>> select box.
>>> I just followed this link
>>> http://www.weinfreund.de/struts2-jquery-showcase/index.action#.
>>> 
>>> Every thing is executing fine.
>>> But the list not loading properly.
>>> I am new to JSON.
>>> 
>>> I changed below jsp page which was working fine with normal select box.
>>> 
>>> my code is 
>>> 
>> 
>> 
> 
> 


-----
---
web: http://www.jgeppert.com
twitter: http://twitter.com/jogep

-- 
View this message in context: http://old.nabble.com/Struts2-JQuery-select-box-tp27780125p27781967.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts2 JQuery select box

Posted by nani2ratna <na...@gmail.com>.
Hi Johanes,

Thanks for reply.
Actually I am very new to JSON.
Action is working fine.

I went through your code and redid the same type stuff in my app.
I don't know about JSON reponse.
Since in your action class there no result(jsp) mapped.
So I too did the same. I am just executing the action method. And I don't
know how to send response.

Can you please explain or send me some links.
So i can read and do that.

Thanks in advance
RS



Johannes Geppert wrote:
> 
> Hello,
> 
> did your JSON Actions works fine? 
> 
> Check if you really get an JSON response and the 
> variables inside the result have the same name.
> 
> Can you please POST your result with sample data?
> 
> Best Regards
> 
> Johannes Geppert
> 
> 
> nani2ratna wrote:
>> 
>> Hi,
>> 
>> I am trying to use http://code.google.com/p/struts2-jquery/ for loading
>> select box.
>> I just followed this link
>> http://www.weinfreund.de/struts2-jquery-showcase/index.action#.
>> 
>> Every thing is executing fine.
>> But the list not loading properly.
>> I am new to JSON.
>> 
>> I changed below jsp page which was working fine with normal select box.
>> 
>> my code is 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Struts2-JQuery-select-box-tp27780125p27781855.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts2 JQuery select box

Posted by Johannes Geppert <jo...@web.de>.
Hello,

did your JSON Actions works fine? 

Check if you really get an JSON response and the 
variables inside the result have the same name.

Can you please POST your result with sample data?

Best Regards

Johannes Geppert


nani2ratna wrote:
> 
> Hi,
> 
> I am trying to use http://code.google.com/p/struts2-jquery/ for loading
> select box.
> I just followed this link
> http://www.weinfreund.de/struts2-jquery-showcase/index.action#.
> 
> Every thing is executing fine.
> But the list not loading properly.
> I am new to JSON.
> 
> I changed below jsp page which was working fine with normal select box.
> 
> my code is 
> 


-----
---
web: http://www.jgeppert.com
twitter: http://twitter.com/jogep

-- 
View this message in context: http://old.nabble.com/Struts2-JQuery-select-box-tp27780125p27781696.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Struts2 JQuery select box

Posted by nani2ratna <na...@gmail.com>.
I can do that very easily.
I already got experience doing that stuff.
But I am the only one person in this project.
It is growing day by day.
If i get jquery up and running then code will look neat and for future i can
use the same.

Thanks and regards
RS



adam pinder wrote:
> 
> 
>  
> 
> can you not call javascript with an onchange and do ajax call in
> javascript to action class ... i guess it depends on what ajax stuff
> you're doing but i have done it that way.
> 
>  
> 
> good luck
> 
>  
> 
> adam
> 
> 
>  
>> Date: Thu, 4 Mar 2010 05:18:09 -0800
>> From: nani2ratna@gmail.com
>> To: user@struts.apache.org
>> Subject: RE: Struts2 JQuery select box
>> 
>> 
>> I was using normal select only.
>> But now i need to do ajax stuff when user change the select box.
>> So jquery is doing this stuff.First i tried with two select boxes.
>> Then i tried to do atleast on select box.
>> Even one select box also not working.
>> Now I have to use this jquery select box to complete this task fast.
>> or else i need to write so much code to do this task.
>> 
>> Thanks
>> RS
>> 
>> 
>> adam pinder wrote:
>> > 
>> > 
>> > 
>> > why did you choose to use jquery rather than just normal struts select
>> and
>> > let the action class create an array of objects (i use an object that
>> has
>> > a key/value pair)
>> > 
>> > i haven't used jquery but not sure what extra it adds.
>> > 
>> > adam
>> > 
>> > 
>> > ----------------------------------------
>> >> Date: Thu, 4 Mar 2010 04:29:15 -0800
>> >> From: nani2ratna@gmail.com
>> >> To: user@struts.apache.org
>> >> Subject: Struts2 JQuery select box
>> >>
>> >>
>> >> Hi,
>> >>
>> >> I am trying to use http://code.google.com/p/struts2-jquery/ for
>> loading
>> >> select box.
>> >> I just followed this link
>> >> http://www.weinfreund.de/struts2-jquery-showcase/index.action#.
>> >>
>> >> Every thing is executing fine.
>> >> But the list not loading properly.
>> >> I am new to JSON.
>> >>
>> >> I changed below jsp page which was working fine with normal select
>> box.
>> >>
>> >> my code is
>> >>
>> >> JSP
>> >> 
>> >> 
>> >> 
>> >> 
>> >> 
>> >> 
>> >> 
>> >> 
>> > 
>> >>> theme="simple" cssClass="form1">
>> >> 
>> > 
>> >> Product Master Description Details
>> >> 
>> > 
>> > 
>> >> 
>> > 
>> > 
>> >> 
>> > 
>> > 
>> >> 
>> > 
>> >> 
>> > 
>> > 
>> >> 
>> > 
>> > 
>> >> 
>> > 
>> >> readonly="true"/>
>> > 
>> >> 
>> > 
>> >> 
>> > 
>> > 
>> >> 
>> > 
>> > 
>> >> 
>> > 
>> >> readonly="true"/>
>> > 
>> >> 
>> > 
>> >> 
>> > 
>> > 
>> >> 
>> > 
>> > 
>> >> 
>> > 
>> > 
>> >> 
>> >>> listKey="prodcat" listValue="prodcat_desc"
>> >> key="prodmDatPm.website_category"
>> >> value="prodmDatPm.website_category">
>> >> 
>> > 
>> >> 
>> > 
>> >> 
>> >> 
>> >> 
>> >>
>> >>
>> >> Above jsp got almost 100 fields. I just trancated it.
>> >>
>> >>
>> >> Action:
>> >>
>> >>
>> >> import java.util.ArrayList;
>> >> import java.util.List;
>> >>
>> >> import org.apache.struts2.convention.annotation.Action;
>> >> import org.apache.struts2.convention.annotation.Actions;
>> >> import org.apache.struts2.convention.annotation.ParentPackage;
>> >> import org.apache.struts2.convention.annotation.Result;
>> >>
>> >> import co.za.xxx.ecm.actions.EcmAction;
>> >> import co.za.xxx.ecm.business.vo.masterFile.PmProdCat;
>> >> import co.za.xxx.ecm.service.productmaster.ProdmDatPmService;
>> >>
>> >> @ParentPackage(value = "pm-json")
>> >> public class JsonAction extends EcmAction {
>> >>
>> >> /**
>> >> *
>> >> */
>> >> private static final long serialVersionUID = -3858830120549401006L;
>> >>
>> >> private List prodCatList;
>> >> private ProdmDatPmService prodmDatPmService;
>> >>
>> >> public List getProdCatList() {
>> >> return prodCatList;
>> >> }
>> >> public void setProdCatList(List prodCatList) {
>> >> this.prodCatList = prodCatList;
>> >> }
>> >> public ProdmDatPmService getProdmDatPmService() {
>> >> return prodmDatPmService;
>> >> }
>> >> public void setProdmDatPmService(ProdmDatPmService prodmDatPmService)
>> {
>> >> this.prodmDatPmService = prodmDatPmService;
>> >> }
>> >>
>> >> @Actions( {
>> >> @Action(value = "/JsonAction", results = {
>> >> @Result(name = "success", type = "json")
>> >> })
>> >> })
>> >> public String execute(){
>> >> System.out.println("This is execute method in json action calss");
>> >> prodCatList = new ArrayList();
>> >> prodCatList = prodmDatPmService.getProdCatList();
>> >> System.out.println(prodCatList);
>> >> return SUCCESS;
>> >> }
>> >>
>> >> public String getJSON()
>> >> {
>> >> System.out.println("This is getJSon method in json action calss");
>> >> return execute();
>> >> }
>> >> }
>> >>
>> >> Struts.xml
>> >>
>> >> 
>> >>
>> >> 
>> >>
>> >>
>> >>
>> >> When jsp loading, its calling my action class.
>> >> Action class calling service class and loading list into prodcatList.
>> >> But its not getting into list box.
>> >>
>> >> Can anybody please explain whats the problem is.
>> >>
>> >> Thanks in advance
>> >> RS
>> >> --
>> >> View this message in context:
>> >>
>> http://old.nabble.com/Struts2-JQuery-select-box-tp27780125p27780125.html
>> >> Sent from the Struts - User mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >> For additional commands, e-mail: user-help@struts.apache.org
>> >> 
>> > _________________________________________________________________
>> > Do you have a story that started on Hotmail? Tell us now
>> > http://clk.atdmt.com/UKM/go/195013117/direct/01/
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail: user-help@struts.apache.org
>> > 
>> > 
>> > 
>> 
>> -- 
>> View this message in context:
>> http://old.nabble.com/Struts2-JQuery-select-box-tp27780125p27780606.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
>  		 	   		  
> _________________________________________________________________
> Got a cool Hotmail story? Tell us now
> http://clk.atdmt.com/UKM/go/195013117/direct/01/
> 

-- 
View this message in context: http://old.nabble.com/Struts2-JQuery-select-box-tp27780125p27781221.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Struts2 JQuery select box

Posted by adam pinder <ap...@hotmail.co.uk>.
 

can you not call javascript with an onchange and do ajax call in javascript to action class ... i guess it depends on what ajax stuff you're doing but i have done it that way.

 

good luck

 

adam


 
> Date: Thu, 4 Mar 2010 05:18:09 -0800
> From: nani2ratna@gmail.com
> To: user@struts.apache.org
> Subject: RE: Struts2 JQuery select box
> 
> 
> I was using normal select only.
> But now i need to do ajax stuff when user change the select box.
> So jquery is doing this stuff.First i tried with two select boxes.
> Then i tried to do atleast on select box.
> Even one select box also not working.
> Now I have to use this jquery select box to complete this task fast.
> or else i need to write so much code to do this task.
> 
> Thanks
> RS
> 
> 
> adam pinder wrote:
> > 
> > 
> > 
> > why did you choose to use jquery rather than just normal struts select and
> > let the action class create an array of objects (i use an object that has
> > a key/value pair)
> > 
> > i haven't used jquery but not sure what extra it adds.
> > 
> > adam
> > 
> > 
> > ----------------------------------------
> >> Date: Thu, 4 Mar 2010 04:29:15 -0800
> >> From: nani2ratna@gmail.com
> >> To: user@struts.apache.org
> >> Subject: Struts2 JQuery select box
> >>
> >>
> >> Hi,
> >>
> >> I am trying to use http://code.google.com/p/struts2-jquery/ for loading
> >> select box.
> >> I just followed this link
> >> http://www.weinfreund.de/struts2-jquery-showcase/index.action#.
> >>
> >> Every thing is executing fine.
> >> But the list not loading properly.
> >> I am new to JSON.
> >>
> >> I changed below jsp page which was working fine with normal select box.
> >>
> >> my code is
> >>
> >> JSP
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> > 
> >>> theme="simple" cssClass="form1">
> >> 
> > 
> >> Product Master Description Details
> >> 
> > 
> > 
> >> 
> > 
> > 
> >> 
> > 
> > 
> >> 
> > 
> >> 
> > 
> > 
> >> 
> > 
> > 
> >> 
> > 
> >> readonly="true"/>
> > 
> >> 
> > 
> >> 
> > 
> > 
> >> 
> > 
> > 
> >> 
> > 
> >> readonly="true"/>
> > 
> >> 
> > 
> >> 
> > 
> > 
> >> 
> > 
> > 
> >> 
> > 
> > 
> >> 
> >>> listKey="prodcat" listValue="prodcat_desc"
> >> key="prodmDatPm.website_category"
> >> value="prodmDatPm.website_category">
> >> 
> > 
> >> 
> > 
> >> 
> >> 
> >> 
> >>
> >>
> >> Above jsp got almost 100 fields. I just trancated it.
> >>
> >>
> >> Action:
> >>
> >>
> >> import java.util.ArrayList;
> >> import java.util.List;
> >>
> >> import org.apache.struts2.convention.annotation.Action;
> >> import org.apache.struts2.convention.annotation.Actions;
> >> import org.apache.struts2.convention.annotation.ParentPackage;
> >> import org.apache.struts2.convention.annotation.Result;
> >>
> >> import co.za.xxx.ecm.actions.EcmAction;
> >> import co.za.xxx.ecm.business.vo.masterFile.PmProdCat;
> >> import co.za.xxx.ecm.service.productmaster.ProdmDatPmService;
> >>
> >> @ParentPackage(value = "pm-json")
> >> public class JsonAction extends EcmAction {
> >>
> >> /**
> >> *
> >> */
> >> private static final long serialVersionUID = -3858830120549401006L;
> >>
> >> private List prodCatList;
> >> private ProdmDatPmService prodmDatPmService;
> >>
> >> public List getProdCatList() {
> >> return prodCatList;
> >> }
> >> public void setProdCatList(List prodCatList) {
> >> this.prodCatList = prodCatList;
> >> }
> >> public ProdmDatPmService getProdmDatPmService() {
> >> return prodmDatPmService;
> >> }
> >> public void setProdmDatPmService(ProdmDatPmService prodmDatPmService) {
> >> this.prodmDatPmService = prodmDatPmService;
> >> }
> >>
> >> @Actions( {
> >> @Action(value = "/JsonAction", results = {
> >> @Result(name = "success", type = "json")
> >> })
> >> })
> >> public String execute(){
> >> System.out.println("This is execute method in json action calss");
> >> prodCatList = new ArrayList();
> >> prodCatList = prodmDatPmService.getProdCatList();
> >> System.out.println(prodCatList);
> >> return SUCCESS;
> >> }
> >>
> >> public String getJSON()
> >> {
> >> System.out.println("This is getJSon method in json action calss");
> >> return execute();
> >> }
> >> }
> >>
> >> Struts.xml
> >>
> >> 
> >>
> >> 
> >>
> >>
> >>
> >> When jsp loading, its calling my action class.
> >> Action class calling service class and loading list into prodcatList.
> >> But its not getting into list box.
> >>
> >> Can anybody please explain whats the problem is.
> >>
> >> Thanks in advance
> >> RS
> >> --
> >> View this message in context:
> >> http://old.nabble.com/Struts2-JQuery-select-box-tp27780125p27780125.html
> >> Sent from the Struts - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >> 
> > _________________________________________________________________
> > Do you have a story that started on Hotmail? Tell us now
> > http://clk.atdmt.com/UKM/go/195013117/direct/01/
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> > 
> > 
> > 
> 
> -- 
> View this message in context: http://old.nabble.com/Struts2-JQuery-select-box-tp27780125p27780606.html
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
 		 	   		  
_________________________________________________________________
Got a cool Hotmail story? Tell us now
http://clk.atdmt.com/UKM/go/195013117/direct/01/

RE: Struts2 JQuery select box

Posted by nani2ratna <na...@gmail.com>.
I was using normal select only.
But now i need to do ajax stuff when user change the select box.
So jquery is doing this stuff.First i tried with two select boxes.
Then i tried to do atleast on select box.
Even one select box also not working.
Now I have to use this jquery select box to complete this task fast.
or else i need to write so much code to do this task.

Thanks
RS


adam pinder wrote:
> 
> 
>  
> why did you choose to use jquery rather than just normal struts select and
> let the action class create an array of objects (i use an object that has
> a key/value pair)
>  
> i haven't used jquery but not sure what extra it adds.
>  
> adam
> 
> 
> ----------------------------------------
>> Date: Thu, 4 Mar 2010 04:29:15 -0800
>> From: nani2ratna@gmail.com
>> To: user@struts.apache.org
>> Subject: Struts2 JQuery select box
>>
>>
>> Hi,
>>
>> I am trying to use http://code.google.com/p/struts2-jquery/ for loading
>> select box.
>> I just followed this link
>> http://www.weinfreund.de/struts2-jquery-showcase/index.action#.
>>
>> Every thing is executing fine.
>> But the list not loading properly.
>> I am new to JSON.
>>
>> I changed below jsp page which was working fine with normal select box.
>>
>> my code is
>>
>> JSP
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
> 
>>> theme="simple" cssClass="form1">
>> 
> 
>> Product Master Description Details
>> 
> 
> 
>> 
> 
> 
>> 
> 
> 
>> 
> 
>> 
> 
> 
>> 
> 
> 
>> 
> 
>> readonly="true"/>
> 
>> 
> 
>> 
> 
> 
>> 
> 
> 
>> 
> 
>> readonly="true"/>
> 
>> 
> 
>> 
> 
> 
>> 
> 
> 
>> 
> 
> 
>> 
>>> listKey="prodcat" listValue="prodcat_desc"
>> key="prodmDatPm.website_category"
>> value="prodmDatPm.website_category">
>> 
> 
>> 
> 
>> 
>> 
>> 
>>
>>
>> Above jsp got almost 100 fields. I just trancated it.
>>
>>
>> Action:
>>
>>
>> import java.util.ArrayList;
>> import java.util.List;
>>
>> import org.apache.struts2.convention.annotation.Action;
>> import org.apache.struts2.convention.annotation.Actions;
>> import org.apache.struts2.convention.annotation.ParentPackage;
>> import org.apache.struts2.convention.annotation.Result;
>>
>> import co.za.xxx.ecm.actions.EcmAction;
>> import co.za.xxx.ecm.business.vo.masterFile.PmProdCat;
>> import co.za.xxx.ecm.service.productmaster.ProdmDatPmService;
>>
>> @ParentPackage(value = "pm-json")
>> public class JsonAction extends EcmAction {
>>
>> /**
>> *
>> */
>> private static final long serialVersionUID = -3858830120549401006L;
>>
>> private List prodCatList;
>> private ProdmDatPmService prodmDatPmService;
>>
>> public List getProdCatList() {
>> return prodCatList;
>> }
>> public void setProdCatList(List prodCatList) {
>> this.prodCatList = prodCatList;
>> }
>> public ProdmDatPmService getProdmDatPmService() {
>> return prodmDatPmService;
>> }
>> public void setProdmDatPmService(ProdmDatPmService prodmDatPmService) {
>> this.prodmDatPmService = prodmDatPmService;
>> }
>>
>> @Actions( {
>> @Action(value = "/JsonAction", results = {
>> @Result(name = "success", type = "json")
>> })
>> })
>> public String execute(){
>> System.out.println("This is execute method in json action calss");
>> prodCatList = new ArrayList();
>> prodCatList = prodmDatPmService.getProdCatList();
>> System.out.println(prodCatList);
>> return SUCCESS;
>> }
>>
>> public String getJSON()
>> {
>> System.out.println("This is getJSon method in json action calss");
>> return execute();
>> }
>> }
>>
>> Struts.xml
>>
>> 
>>
>> 
>>
>>
>>
>> When jsp loading, its calling my action class.
>> Action class calling service class and loading list into prodcatList.
>> But its not getting into list box.
>>
>> Can anybody please explain whats the problem is.
>>
>> Thanks in advance
>> RS
>> --
>> View this message in context:
>> http://old.nabble.com/Struts2-JQuery-select-box-tp27780125p27780125.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 		 	   		  
> _________________________________________________________________
> Do you have a story that started on Hotmail? Tell us now
> http://clk.atdmt.com/UKM/go/195013117/direct/01/
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Struts2-JQuery-select-box-tp27780125p27780606.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Struts2 JQuery select box

Posted by adam pinder <ap...@hotmail.co.uk>.
 
why did you choose to use jquery rather than just normal struts select and let the action class create an array of objects (i use an object that has a key/value pair)
 
i haven't used jquery but not sure what extra it adds.
 
adam


----------------------------------------
> Date: Thu, 4 Mar 2010 04:29:15 -0800
> From: nani2ratna@gmail.com
> To: user@struts.apache.org
> Subject: Struts2 JQuery select box
>
>
> Hi,
>
> I am trying to use http://code.google.com/p/struts2-jquery/ for loading
> select box.
> I just followed this link
> http://www.weinfreund.de/struts2-jquery-showcase/index.action#.
>
> Every thing is executing fine.
> But the list not loading properly.
> I am new to JSON.
>
> I changed below jsp page which was working fine with normal select box.
>
> my code is
>
> JSP
> 
> 
> 
> 
> 
> 
> 
> 

>> theme="simple" cssClass="form1">
> 

> Product Master Description Details
> 


> 


> 


> 

> 


> 


> 

> readonly="true"/>

> 

> 


> 


> 

> readonly="true"/>

> 

> 


> 


> 


> 
>> listKey="prodcat" listValue="prodcat_desc"
> key="prodmDatPm.website_category"
> value="prodmDatPm.website_category">
> 

> 

> 
> 
> 
>
>
> Above jsp got almost 100 fields. I just trancated it.
>
>
> Action:
>
>
> import java.util.ArrayList;
> import java.util.List;
>
> import org.apache.struts2.convention.annotation.Action;
> import org.apache.struts2.convention.annotation.Actions;
> import org.apache.struts2.convention.annotation.ParentPackage;
> import org.apache.struts2.convention.annotation.Result;
>
> import co.za.xxx.ecm.actions.EcmAction;
> import co.za.xxx.ecm.business.vo.masterFile.PmProdCat;
> import co.za.xxx.ecm.service.productmaster.ProdmDatPmService;
>
> @ParentPackage(value = "pm-json")
> public class JsonAction extends EcmAction {
>
> /**
> *
> */
> private static final long serialVersionUID = -3858830120549401006L;
>
> private List prodCatList;
> private ProdmDatPmService prodmDatPmService;
>
> public List getProdCatList() {
> return prodCatList;
> }
> public void setProdCatList(List prodCatList) {
> this.prodCatList = prodCatList;
> }
> public ProdmDatPmService getProdmDatPmService() {
> return prodmDatPmService;
> }
> public void setProdmDatPmService(ProdmDatPmService prodmDatPmService) {
> this.prodmDatPmService = prodmDatPmService;
> }
>
> @Actions( {
> @Action(value = "/JsonAction", results = {
> @Result(name = "success", type = "json")
> })
> })
> public String execute(){
> System.out.println("This is execute method in json action calss");
> prodCatList = new ArrayList();
> prodCatList = prodmDatPmService.getProdCatList();
> System.out.println(prodCatList);
> return SUCCESS;
> }
>
> public String getJSON()
> {
> System.out.println("This is getJSon method in json action calss");
> return execute();
> }
> }
>
> Struts.xml
>
> 
>
> 
>
>
>
> When jsp loading, its calling my action class.
> Action class calling service class and loading list into prodcatList.
> But its not getting into list box.
>
> Can anybody please explain whats the problem is.
>
> Thanks in advance
> RS
> --
> View this message in context: http://old.nabble.com/Struts2-JQuery-select-box-tp27780125p27780125.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 		 	   		  
_________________________________________________________________
Do you have a story that started on Hotmail? Tell us now
http://clk.atdmt.com/UKM/go/195013117/direct/01/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org