This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have two dropdowns say State and District. In first page, I select a state based on which District will be loaded. Now I select State as TamilNadu and District Chennai. Upon clicking it takes to second page as well as it stores it in DB. Now second page is for edit. I click an edit button. It takes me back to first page. Now I want to load all the values of State and i want TamilNadu as a highlighted one. similarly for District, all other values must be loaded and Chennai must be highlighted.
I load values using the following call
With the above code, i just get the entire list of state and district. But I also want to highlight the option I already have in database for which I again make a dwr call passing the id generated while adding the selected options in DB. I am able to fetch the selected option. But I just get struck up as I want to make that option as the first one which doing Edit operation.