Author Topic: [solved] New Tab for outbound calls  (Read 3844 times)

Offline vma

  • Sr. Member
  • ****
  • Posts: 255
  • Karma: 0
[solved] New Tab for outbound calls
« on: May 10, 2011, 05:29:20 PM »
Hello,
I want to make a new tab in GAD so everytime an agent has to make a call he has to choose what kind of call this is. He has to choose between "customer" and "department". This way we differenciate between calls made to customers and calls made to other departments within the company which don´t use genesys.
Every time the agent makes a call he chooses a radio button and clicks Submit. Can there be a change made so the attached data is changed on "onclick¨event on radio button so he doesn´t have to click submit anymore?
Here is my jsp:[code]<%@page import="java.util.HashMap"%>
<%@page import="java.util.Map"%>
<%@page import="com.genesyslab.ail.AilLoader"%>
<%@page import="com.genesyslab.ail.AilFactory"%>
<%@page import="com.genesyslab.log.Logger"%>
<%@page import="com.genesyslab.ail.Interaction"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<%
Logger sLog = Logger.getLogger("custom.jsp.OutboundCall");
AilFactory factory = AilLoader.getAilFactory();
String idInteraction = (String) request.getParameter("idInteraction");

Interaction interaction = factory.getInteraction(idInteraction);

if (request.getParameter("OutboundCall") != null)
{
Map ad = interaction.getAttachedData();
if (request.getParameter("OutboundCall").equals("Customer"))
{
ad.put("call_type", "customer");
}
else
{
ad.put("call_type", "department");
}
interaction.setAttachedData(ad);
}
%>
</head>
<body>
<form method="POST" action="OutboundCall.jsp">
<TABLE border=1>
<tr><td bgcolor=#FF0000>
<input type="radio" name="OutboundCall" value="Customer" CHECKED>Customer
</td></tr>
<tr><td bgcolor=#FF0000>
<input type="radio" name="OutboundCall" value="Department">Department
<input type="hidden" name="idInteraction" value=<%=idInteraction%> >
</td></tr>
</TABLE>
<input value="Submit" type="submit">
</form>
</body>
</html>[/code]

Also woud be awsome to be able to force the user make a choice before making the call.
Thank you!
Mihai
« Last Edit: May 11, 2011, 03:18:07 PM by vma »

Offline René

  • Administrator
  • Hero Member
  • *****
  • Posts: 1832
  • Karma: 62
Re: New Tab for outbound calls
« Reply #1 on: May 11, 2011, 08:34:39 AM »
Hi Mihai,

It's doable using JavaScript as you can submit form once radio button is selected. You can make it even nicer using AJAX so there will be no page refresh ;)

[quote]Also woud be awsome to be able to force the user make a choice before making the call.[/quote]It might be possible by hiding existing 'New Call' button in the toolbar and adding custom toolbar button. However, that would require quite significant development...

R.

Offline vma

  • Sr. Member
  • ****
  • Posts: 255
  • Karma: 0
Re: New Tab for outbound calls
« Reply #2 on: May 11, 2011, 09:32:57 AM »
Hello René,
Submiting on "onclick" works well, cheers.
As for the ajax part I think you mean the thing that everytime after I click a radio button the pages refreshes and the check jumps to the default one. Yeah this is not nice at all. Although I have a 8 years development background, I only used C++ and VC++ and no JSP/Java experience. Made some searches on the net for the norefersh thing but I don't understand much :) For the moment they will have to work like this.

Thank you very much,
Mihai

[color=red]L.E. Managed to resolve this issue also not by not refresing but by dynamically checking the right button based on the attached data.[/color]
« Last Edit: May 11, 2011, 03:19:35 PM by vma »