In JSF, there are several ways to pass data from the client (browser) to the server.
1. value binding
Which is the default in JSF
eg
2. f:param
eg,
to retrieve the value in managedBean, write the following codes.
3. f:setPropertyActionListener
eg,
in managedBean,
with setPropertyActionListener, setter of the property is invoked before action method (myAction), thus we can get the property value in the action method.
the disadvantage of f:setPropertyActionListener, it passed in value must be String type.
4. a4j:param (Richfaces 4 ONLY)
eg,
in managedBean
the usage of a4j:param is similar with f:setPropertyActionListener. But the advantage of a4j:param is, value other than String still can be passed.
5. JSF2 action
eg,
in managedBean,
Done!!
1. value binding
Which is the default in JSF
eg
2. f:param
eg,
to retrieve the value in managedBean, write the following codes.
3. f:setPropertyActionListener
eg,
in managedBean,
with setPropertyActionListener, setter of the property is invoked before action method (myAction), thus we can get the property value in the action method.
the disadvantage of f:setPropertyActionListener, it passed in value must be String type.
4. a4j:param (Richfaces 4 ONLY)
eg,
in managedBean
the usage of a4j:param is similar with f:setPropertyActionListener. But the advantage of a4j:param is, value other than String still can be passed.
5. JSF2 action
eg,
in managedBean,
Similar topics:
- Passing parameter with <p:remoteCommand />
- Passing parameters with <a4j:jsFunction />
- Passing parameter with <p:remoteCommand />
- Passing parameters with <a4j:jsFunction />
Done!!
No comments:
Post a Comment