开发者

How to reset a portlet parameter on a button click?

I have a Liferay portlet param "cmd" in my JSP page, which is initialized to a value "update". I need this value to be get changed to "delete", when a user clicks on the delete button of the form. How I can go about it?

开发者_如何学运维
<liferay-portlet:actionURL varImpl="edit_survey_form_action">   
<portlet:param name="cmd" value="update" />

<input class="optsurvey-submit" type="submit" name="submitButton" value="Delete" onclick="??????"/>


  1. Open the page in webbrowser.
  2. Rightclick page and choose View Source (or something similar, depending on browser used).
  3. Investigate the generated HTML code.
  4. Write JavaScript code accordingly based/targeted on the generated HTML code.

You should and must now realize that JavaScript knows nothing about the server side code :) It runs at the client side only. The JSP code is thus pretty irrelevant when writing JavaScript code (unless you can tell from top of head how the final HTML output will look like). Just concentrate on the generated HTML code, simply because that's the only what JavaScript actually can see and access. For more background information and hints you may find this artcile useful.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜