<%@ page import="org.apache.log4j.Logger" %>
<%@ page import="ro.emid.common.utils.ObjectUtils" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.Map" %>

<% final Logger LOG = Logger.getLogger("setReclamatieChecked_jsp"); %>
<respmesg>
<% try{ %>
    <%
        final long idReclamatie = ObjectUtils.getLongValue(request.getParameter("idReclamatie"), -1);
        final boolean checked = ObjectUtils.getIntValue(request.getParameter("checked"), -1) == 1;

        LOG.debug("ID Reclmatie =" + idReclamatie);
        LOG.debug("Checked =" + checked);

        //alea checkuite sunt salvate in sesiune

        Map checkedIds = (Map)session.getAttribute("checkedReclamatiiIds");
        if( checkedIds == null) {
            checkedIds = new HashMap();
            session.setAttribute("checkedReclamatiiIds", checkedIds);
        }
        //}

        if( checked){
            checkedIds.put( new Long(idReclamatie), "true");
        }else{
            checkedIds.remove(new Long(idReclamatie));
        }
    %>
    OK
<%}catch( Exception t){%>
    <%=t.getMessage()%>
<%}%>
</respmesg>


