Is it possible to calculate the variable name for the ViewScpe of a EditBox control?
The Edit Box control resides in a custom control that is re-used several times on an XPage.
<xp:inputText id="inpValidDate"
value="#{viewScope.valid}">
</xp:inputText>
I would like to use something as followed:
value="${viewScope[#{'compositeData.type'}]}"
viewScope is just a variable that is a Java Map. You can use the viewScope.get("name of entry like compositeData.whatever") method to get the value stored in the map entry. (Jesse's code does the same thing without using the get). https://docs.oracle.com/javase/8/docs/api/java/util/Map.html
However, you will need to make sure it is initialized maybe in the beforePageLoad? That is probably why you see a null.