1、案例
后台传参:
public void goAddOrEdit()
{
String code = this.getPageData().getParams().get("code");
String name = this.getPageData().getParams().get("name");
String qty = this.getPageData().getParams().get("qty");
// type:add为新增,edit为编辑
String type = this.getPageData().getParams().get("type");
if (type == "add")
{
this.returnData.toPage(this.getPageData().getParams().get("topage"));
}
else
{
this.addParameter("code", code);
this.addParameter("name", name);
this.addParameter("qty", qty);
}
this.returnData.toPage(this.getPageData().getParams().get("topage"));
}
前台接参:
var url = "umppExtendRecordController!goAddOrEdit.m?topage=unimaxmes.pplan.umppExtendRecord-list-ySZ-inputEdit.jsp&type=edit&code="
+ code+"&name="+name+"&qty="+qty;
openTab(url, window.i18nMsg.modify, "umppExtendRecord-list-ySZ-inputEdit");
本文通过一个具体的案例,详细解析了前后端如何进行参数传递与接收。在后端,通过获取页面数据中的参数如code、name和qty,并判断操作类型(新增或编辑),进行相应的业务逻辑处理。在前端,构造URL并携带参数,使用openTab方法打开新的页面进行编辑操作。此案例展示了前后端交互的基本流程和技术细节。
1370

被折叠的 条评论
为什么被折叠?



