I have a JSF page code snippet like below:
<h:inputText value="#{locConfigBB.fetchFldVal('FACEBOOK_PAGE_URL')}"/>
<h:inputText value="#{locConfigBB.fetchFldVal('TWITTER_ID')}"/>
My pojo 'FieldDetail' class has two attributes named 'fieldInternalName' & 'fieldInternalValue'.
The above code gives me value stored in the database associated with the 'fieldInternalName', which I am passing as parameter (e.g. 'TWITTER_ID'). But now my requirement is, if my database doesn't contain records with the given 'fieldInternalName' (i.e. 'TWITTER_ID'), I need to enter a value in the input text so that I will have a list of 'FieldDetail' (which will create records as per my user input)
It means if I would enter a value in the inputText field with label 'Facebook Id' n submit the form then my list in the baking bean will contain only one object
I had tried to search and explore but couldn't get right way to solve this problem.
How can I pass both the static value n user enterd value together to managed bean that create a list of objects ?
I would be very much greateful if anybody can help. Thanks in advance. Let me know if further information required.