tags:

views:

5

answers:

0

In the following program i am using the DWR to update all pages at a time. I want to update the data for only specified pages that have the unique 'queueId'. i.e user enter with id & pass, he belong to 'queue1', and another user entered and he belong to 'queue2'. I don't want to show the updates of one user to other. but, It is sending the updates to all the pages without considering the QueueId. please give a solution for this***

private static Map utilSessionMap = new HashMap(); public void sendUpdates(int queueId)//first time when page loaded { WebContext wctx = WebContextFactory.get(); utilSessionMap.put(queueId, wctx); displayQueue(queueId); } //to display data on the screen public void displayQueue(int queueId) { WebContext wctx = utilSessionMap.get(queueId); String currentPage = wctx.getCurrentPage(); Collection sessions = wctx.getScriptSessionsByPage(currentPage); Util utilAll = new Util(sessions); Map displayQueue = getDisplayQueue(queueId); Iterator iterator = displayQueue.keySet().iterator(); int index = 0; while (iterator.hasNext()) { String counter = iterator.next(); String token = displayQueue.get(counter); if (index < 5) { utilAll.setValue("t" + index, token);//these are table row id's i should update utilAll.setValue("c" + index, counter); } index++; } } //get dynamic data method private Map getDisplayQueue(int queueId) { Map collection = QueueManager.getInstance().getCounterTokenCollection(queueId); //get the dynamic generated data for (String counterNumber : collection.keySet()) {
displayQueue.put(counterNumber, collection.get(counterNumber).getTokenNumber()); } return displayQueue; }