I am using intl-tel-input jQuery plugin for phone number fields on new entity creation. Now I have a details form where I can view all entered details for newly created entity. How do I populate selected country code and flag on phone fields there? Also I should be allowed to edit my details on that page(this means we can edit our phone number also). I am using JSF+Primefaces for frontend.
Form where phone input is taken:
<input id="adminPhone" name="adminPhone" type="tel" />
<h:outputScript>
$("#adminPhone").intlTelInput({
initialCountry: "auto",
geoIpLookup: function(callback) {
$.get("http://ipinfo.io", function() {}, "jsonp").always(function(resp)
{
var countryCode = (resp && resp.country) ? resp.country : "";
callback(countryCode);
});
},
separateDialCode: true,
utilsScript: "../resources/js/utils.js"
});
</h:outputScript>
Updated backing bean adminPhone property using getRequestParameterMap().get("adminPhone")value
Update/View details form as of now:
<p:outputLabel id="engagementbillingPhoneLabel" value="Phone:" for="adminPhone" />
<p:inputText id="adminPhone" value="#{dashboard.selectedEntity.adminPhone}"/>