struts2:如何调出弹出窗口
我正在开发一个 Struts 2 应用程序。我有一个 JSP 页面,其中有一个普通的 html 表。在其中一列中,我有一个名为“更新”的链接。当我单击“更新”时,将打开一个新的弹出窗口,弹出窗口将包含当前行的许多其他详细信息(这意味着它必须通过一些操作并从数据库中获取数据)。
弹出窗口中有一个“提交”按钮,单击该按钮后,必须提交编辑后的数据。
如何在 struts 2 中创建这个弹出窗口?
它应该与父窗口采用相同的形式还是不同的形式?
如果您可以提供一些教程的链接,那将会有很大的帮助。我无法在谷歌搜索中找到它。
I am working on a Struts 2 application .I have a JSP page in which there is a normal html table. In one of the columns , I have a link called 'update' . When I click on the 'update' , a new popup window will open and the pop up will have many other details of the current row (which means it has to pass through some action and fetch data from database).
There is a Submit button in popup , which when clicked , must submit the edited data .
How do I create this popup in struts 2?
Should it be the same form as the parent window or a different one ?
It would be of great help , if you can give links to some tutorial . I am not able to find it in google search .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是与 javascript 而不是 struts2 相关的问题。我猜您必须在链接
update
的表定义中使用此语法。
其中
anyValueYouwantToSend
可能是您想要发送以标识特定行的一些标识符值然后在 Javascript 中
,其中
myAction
将是您要执行数据库操作的操作。在此操作的操作映射中,您需要将结果提供给 jsp,该 jsp 将成为您的 pop-当然,弹出窗口将有不同的表单来提交,但是您在这里执行的更新只有在刷新时才会反映在父窗口中。如果您想在不刷新父窗口的情况下反映这些更改,您需要写一些父子javascript,我可以帮助你如果你愿意的话就做Its a problem related to javascript not struts2.I guess you must be using this syntax in the table definition for link
update
.
where
anyValueYouwantToSend
may be some identifier value you want to send to identify the particular rowThen in Javascript
where
myAction
will be the action in which you are going to do your database stuff.In the action mapping of this action you need to give result to a jsp which is going to be your pop-up window.And of course popup window will have a different form to submit, however the update you perform here will be reflected in the parent window only when you refresh it.If you want to reflect these changes without refreshing the parent window you need to write some parent child javascript, which i can help you to do if you want