Hi @keshava219
you should write dialog js so that wehn you change on dialog level at that time only dropdown value get changed (at the same time )---> Js will help you on that...
But if you want to pass the value in servlet , it can be done like below mentioned code snippet . but this would not be "on the fly" ..Suppose value is 5 .after dialog submission only your dropdown items count would be 5 ..when you made it suppose 6 then submit dialog again and open it again then only 6 items you will be able to see ..In backedn it will work like that
as you registered servlet with path ...just read the dailog values of your field "Number of Articles to Show " in your servlet
smething like this you can do
then you can use this value and put the logic to just those many dropdown selection items .
String cmptOnPage = req.getPathInfo().toString();
String actualPath = cmptOnPage.substring(cmptOnPage.lastIndexOf("/content"), cmptOnPage.length());
ValueMap actualResourceValueMap = req.getResourceResolver().getResource(actualPath).adaptTo(ValueMap.class);
String dialogVlaues =actualResourceValueMap.get("text", String.class);
logger.info("dialogVlaues path "+dialogVlaues);
/** ------------------------------------------------------------