In XPages you can access the value(s) of an input control (e.g. xp:inputText
) on the server side in three (see answer of Sven Hasselbach) different ways:
- Use
javax.faces.component.UIComponent
to get the base object for a UI component in combination with an appropriate getter (e.g.getComponent("txtRootFolder") .getValueAsString()
)
- Use a Scope Variable (e.g.
requestScope.rootfolder
)
I know the usage/purpose of scope variables, that's not the questions here.
I want to know what are the main differences (advantages/ disadvantages, best practices, etc.) between this two possible solutions?