extjs 进来,。。。。。

帅狗 发布于 2013/11/22 09:32
阅读 310
收藏 0
buttons:[
									 {
									   text:"确认修改",
								       handler:function(){
										 alert("点击率")
										 var username = Ext.getCmp('from').getValues().username;
											var password = Ext.getCmp('from').getValues().password;
											var realname = Ext.getCmp('from').getValues().realName;
											var telephone = Ext.getCmp('from').getValues().telephone;
											var description = Ext.getCmp('from').getValues().description;
											var email = Ext.getCmp('from').getValues().email;
											//alert("username: "+username+" password:"+password+" realname:"+realname+" telephone:"+telephone+" description:"+description+" email:"+email);
											Ext.Ajax.request({
												url:'update/UpdateUserAction_update.action',
												method:'post',
												params:{username:username,password:password,realname:realName,telephone:telephone,description:description,email:email},
												success:function(response){
//													window.location="index.jsp";
													alert(11111);
													store_user.load();
												},
												failure: function(response) {
							                        
							                    }
											});
								       }
									 },
									 {
									   text:"重置按钮",
								       handler:function(){
								         Ext.getCmp('from').getForm().reset();
								        // f.form.reset();
									  }
									 }
									]

上面这段是我的extjs 按钮提交的代码


<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE struts PUBLIC
	"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
	"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
	<package name="update" namespace="/update" extends="json-default">		
		<action name="UpdateUserAction_*" class="UpdateUserAction" method="{1}">
			<result name="SUCCESS">
			<param name="root"></param>
			</result>
		</action>
	</package>
</struts>
上面这段是我的struts。xml


package com.twinflag.mms.web.action;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.opensymphony.xwork2.ActionSupport;
import com.twinflag.mms.entity.TUser;
import com.twinflag.mms.service.UserService;
@SuppressWarnings("serial")
@Controller("UpdateUserAction")
@Scope(value="prototype")
public class UpdateUserAction extends ActionSupport {

	@Resource(name=UserService.SERVICE_NAME)
	private UserService  userService;
	
	private TUser user = new TUser();
	
	private String username;
	private String password;
	private String realname;
	private int telephone;
	private String email;
	private String description;


	public UserService getUserService() {
		return userService;
	}


	public void setUserService(UserService userService) {
		this.userService = userService;
	}


	public TUser getUser() {
		return user;
	}


	public void setUser(TUser user) {
		this.user = user;
	}


	public String getUsername() {
		return username;
	}


	public void setUsername(String username) {
		this.username = username;
	}


	public String getPassword() {
		return password;
	}


	public void setPassword(String password) {
		this.password = password;
	}


	public String getRealname() {
		return realname;
	}


	public void setRealname(String realname) {
		this.realname = realname;
	}


	public int getTelephone() {
		return telephone;
	}


	public void setTelephone(int telephone) {
		this.telephone = telephone;
	}


	public String getEmail() {
		return email;
	}


	public void setEmail(String email) {
		this.email = email;
	}


	public String getDescription() {
		return description;
	}


	public void setDescription(String description) {
		this.description = description;
	}


	public String update(){
	System.out.println("564864564564154");
//	   user.setIsDeleted(Short.parseShort("0")); //设置isDelete的值
		   userService.update(user);
		   return SUCCESS;
	   }
}



这是我的ation   为啥
System.out.println("564864564564154"); 就是不打印呢


加载中
0
我是潮汐
我是潮汐

<action name="UpdateUserAction_update"  class="UpdateUserAction" method=" update">


跟extjs没什么关系.

0
我是潮汐
我是潮汐

你这又是注解 又xml的,,  多看看struts方面的资料吧..

0
去哪儿了
去哪儿了
ExtJS 交流群QQ:476533701    大家一起讨论
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部