Requirement: I have an inputDateDemo.jspx page. On that inputDateDemo.jspx page, I have three fields: af:selectOneChoice, af:inputDate, and af:chooseDate components. Based on the item I select inaf:selectOneChoice the language translation should happen. And, also I should be able to change the date for all the languages. As of now, it is working fine for English and Russian language. But I am not able to select date from af:inputDate, and af:chooseDate components for Mongolian, Kazakh, and Kyrgyz languages.
Solution: For solution to the above requirement follow the steps as shown below:
Step 1: Create an Oracle ADF Fusion Web Application.
Step 2: Create an inputDateDemo.jspx page. Drag and drop choice from the component palette on the inputDateDemo.jspx page as shown below:
Select Create list(select item) and create the list items as shown below:
Click Next. Set the Label as Select Language. The Select Language text we will set in the ResourceBundle as shown below:
Click Save and Select. Thus the Label is set as shown below:
Click Finish.
Set partialTriggers=”soc1″ and autoSubmit=”true” for the af:selectOneChoice component.
Set valueChangeListener=”#{backingBeanScope.MyBean.languageChange}”
Step 3: Drag and drop af:inputDate from the component palette. Set label=”#{viewcontrollerBundle.SELECT_DATE}”. Set partialTriggers=”soc1″.
Thus, the complete inputDateDemo.jspx code is shown below:
Step 4: Create five ResourceBundles as shown below:
The content of each of the five bundle are shown below:
Step 5: Write the below code for the languageChange ValueChangeEvent.
Save all and run the application. Thus the ran application is shown below:
Select Language as RU-Mongolian and Select Date as 6/13/2016. Date should be picked from the af:inputDate. Don’t enter the Date manually. Thus we are able to Select Date as shown below:
Select Language as RU- Kyrgyz and Select Date as 6/13/2016. Date should be picked from the af:inputDate. Don’t enter the Date manually. Thus we are not able to Select Date. The af:inputDate is not responding as shown below:
Step 6: Thus to fix the above issue, put <formatting-locale>#{request.locale}</formatting-locale> in the trinidad-config.xml file as shown below:
Step 7: Save all and run the application. Thus, the ran application is shown below:
Here whatever Language we select the af:inputDate component will always work.
Hence, the solution to our requirement.
If you like the post please comment, share, and do join me on Facebook. Please subscribe to my YouTube Channel for video tutorials.
Thanks & Regards,
Susanto Paul
497 total views, 3 views today