开发者

Opening modal window on "onclick" event in struts2 application

In my jsp page I have created form with one user input i.e. username. I have created submit button for that particular form. Now after pressing submit button I want to display modal window, which shows information about that particular user. I am going to fetch user Information f开发者_开发知识库rom action class.So basically execution flow would be like user.jsp ---> action.class ---> modal window ---> user.jsp.

I am not sure how to configure struts.xml to open modal window insted of modaless window. So please do the needfull to resolve my query.

Thanks !!!


I think you can not display a modal window only via config struts.xml. Because the modal window/dialog is the browser's behaviour. You can add some javascript codes in the user.jsp page's onload event to show a modal window/dialog.

For example, if the submit button is clicked and the action.class finish the save action you can add extra tag data in the request attributes and check the tag data in the user.jsp.


As YODA said you have to do a little javascript for that. It's not a struts issue. I would go with jQuery plugins like fancybox or shadowbox for making the modal.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜