Can anybody tell me how can we call doEdit method? Is it used to edit entire portlet or Elements of portlet. If possible try to give me demo application. Thanks.
2 Answers
doEdit method gets called when you open Preferences screen of portlet.
If you use edit mode in your portlet.xml and provide edit-jsp init paramter, you will able to see Preferences as option on clicking on wrench icon. When you click on that icon at that time doEdit method gets called jsp mentioned as edit-jsp will be rendered.

- 4,210
- 2
- 19
- 26
-
In
tag provide mode by – Pankaj Kathiriya Oct 22 '13 at 12:06edit and `edit-jsp /jsps/edit.jsp
Let me start with a statement that EDIT mode is a mode in which portlet configuration is done (e.g. in a weather portlet, this mode would be used to configure city for which a weather would be shown).
Now, doEdit() method is invoked when you request portlet in EDIT mode, just like doView() is invoked when requesting it in VIEW mode or doHelp() in HELP mode. This is nothing Liferay specific, but comes from Portlet specification (JSR-168). So just invoke your portlet in EDIT mode to have doEdit() called.
For a complete demo sample you may check Liferay's official guide:
Just download sources and take a look at their Hello World portlet which includes calling and overriding doEdit().

- 216
- 3
- 11