Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

new to liferay and jsf 2.0

prashant rathod
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am new to liferay and jsf 2.0.
i have one managebean class having id and name as parameters. and one submit button.
i am taking the name and the id from the user using the xhtml page like {}.
i want to call the add method which is in managebean class after clicking the submit button.
how can i do it.?
i tried many things but it didnt worked.
i have also implemented actionlistener in managebean class.
how to call add method after the click of the submit button?
Tim Holloway
Posts: 18420
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ManagedBeans don't have "parameters", they have properties. According to the JavaBean convention, these properties are normally private and accessed via get/set methods whose names consist of the prefix "get" or "set" followed by the property name, whose first character has been folded to upper-case.

You don't "call" beans. You fire actions on them. These actions are fired when the client submits a Request, usually by clicking a commandLink or commandButton control.

JSF will then process the request by pipelining it through the JSF lifecycle. The lifecycle is a series of processing phases, and for more info on them, I recommend you read the manual.

The important thing to note is that if a request successfully passes through the validation phase, all of the properties referenced by input controls on the submitted JSF form will be updated by the JSF framework to whatever values were entered in that form, then ActionListeners will be invoked, followed by the Action Method.

Most of the time, Action Listeners are not recommended, since the Action Method can do everything that's needed and, unlike the Listeners, it can do it using POJO code.

Finally, a note on your EL: The form "{}" is not correct. It should be "#{}".
Politics is a circus designed to distract you from what is really going on. So is this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!