• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

spring mvc return from pop-up jsp

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

I have this controller about a pop up that open when click a bottun on the jsp :



package ship.vetting.web.controller.incidents;

import it.eng.common.bean.user.User;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;

import ship.common.web.controller.BaseFormController;
import ship.vetting.beans.clearance.Clearance;
import ship.vetting.beans.incident.Incident;
import ship.vetting.business.clearance.ClearanceWorkFlowManager;
import ship.vetting.dao.clearance.ClearanceDAO;

public class SearchLeycanController extends BaseFormController {

private ClearanceWorkFlowManager clearanceWorkFlowManager;

@Override
protected Object formBackingObject(HttpServletRequest request,User user) throws ParseException{

ClearanceDAO cdao = this.getClearanceWorkFlowManager().getClearanceDAO();

List<Clearance> leycanList = new ArrayList<Clearance> ();

String irImoShipNo = request.getParameter("lrImoShipNo");

String date = request.getParameter("date");
Long lirImoShipNo = new Long(12344);
Long imo = new Long(789979);
if(irImoShipNo != null){

lirImoShipNo = Long.parseLong(irImoShipNo);
}


Date convertedDate = null;

if (date !=null) {

SimpleDateFormat dateFormat = new SimpleDateFormat("dd/mm/yyyy");

convertedDate = dateFormat.parse(date);

}

leycanList = cdao.range1MonthsLeycan(lirImoShipNo,convertedDate,user);

Clearance obj = new Clearance();
obj.setLrimoshipno(lirImoShipNo);
obj.setShipName("IMO");

Clearance hobj = new Clearance ();
hobj.setLrimoshipno(imo);
hobj.setShipName("AMO");
leycanList.add(obj);

leycanList.add(hobj);

request.getSession().setAttribute("leycanList", leycanList);

return new ModelAndView(getSuccessView());



}



@Override
protected ModelAndView onSubmit(HttpServletRequest request,
HttpServletResponse response, Object command, BindException errors,
User user) throws Exception {

// Incident incident = (Incident) command;



return new ModelAndView(getSuccessView());
}

public ClearanceWorkFlowManager getClearanceWorkFlowManager() {
return clearanceWorkFlowManager;
}

public void setClearanceWorkFlowManager(
ClearanceWorkFlowManager clearanceWorkFlowManager) {
this.clearanceWorkFlowManager = clearanceWorkFlowManager;
}

}
I open the pop-up and call this contoller with onclick
-window.open('SearchLeycan.do?lrImoShipNo='+imo+'&date='+incidentDate,"","toolbar=yes, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width=1024, height768 ,left=62, screenX=62, top=100, screenY=84");

-leycanList return form the

the pop-up jsp is this :


<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="808080">
<table width="300" border="0" cellspacing="1" cellpadding="0">
<tr>
<td class="intform">Leycan List</td>
</tr>
<tr>
<td align="center" class="blockform2">
<table width="100%" border="0" cellpadding="0" cellspacing="0"
bgcolor="#808080">
<tr>
<td valign="top">
<table width="100%" border="0" cellpadding="0"
cellspacing="0" bgcolor="#808080">

<tr>
<td>
<display:table style="width:100%"
name="sessionScope.leycanList"
pagesize="10"
uid="shipList"
id="table"
requestURI="/anagrafiche/SearchLeycan.do?doNotLoad=true"
cellspacing="1"
cellpadding="4"
excludedParams="*"
sort="list" >
<display:column property="key"
titleKey="label.popup.nave.imo" sortable="true"
headerClass="titform2"
class="blockform2"></display:column>

<display:column property="shipName"
titleKey="label.popup.nave.vesselName" sortable="true"
headerClass="titform2"
class="blockform2"></display:column>

<display:column property="deadweight"
titleKey="label.popup.nave.shipTypeL" sortable="true"
headerClass="titform2"
class="blockform2"
format="${formatWeightDisplay}" ></display:column>
<display:column property="richiedenteUnita"
titleKey="label.popup.nave.owner" sortable="true"
headerClass="titform2"
class="blockform2"></display:column>
<display:column property="richiedenteInvio"
titleKey="label.popup.nave.flag" sortable="true"
headerClass="titform2"
class="blockform2"
format="${formatDateDisplay}" ></display:column>
<display:column property="htmlImgStato"
titleKey="label.popup.nave.deadweight" sortable="true"
headerClass="titform2"
class="blockform2"></display:column>
<display:column property="portoCaricazione1"
titleKey="label.popup.nave.yearOfBuild" sortable="true"
headerClass="titform2"
class="blockform2"></display:column>


<display:column property="portoDiscarica1"
titleKey="label.popup.nave.yearOfBuild" sortable="true"
headerClass="titform2"
class="blockform2"></display:column>

<display:column property="htmlLaycanDate"
titleKey="clearance.insert.cancellocaricazione.label"
headerClass="titform2"
class="blockform2"
></display:column>

<display:column property="commodity"
titleKey="label.clearance.dettaglio.cargo" sortable="true"
headerClass="titform2"
class="blockform2"
></display:column>

<display:column property="quantita"
titleKey="clearance.insert.quantita.label" sortable="true"
headerClass="titform2"
class="blockform2_right"
format="${formatWeightDisplay}"
></display:column>
<display:column headerClass="titform2"
class="blockform2"
style="width=6%">

<img width='15' height='15' border='0' alt='Selection'
src="<%= request.getContextPath() %>/images/page_tick.gif" />
<%--
<img width='15' height='15' border='0' alt='Selection'
src="<%= request.getContextPath() %>/images/page_tick.gif" onclick="var pname0='<c:out value="${table.previousName}"></c:out>'; var pname1=pname0.replace('\'','`') ;updateParent('<spring:escapeBody javaScriptEscape="true">${table.shipName}</spring:escapeBody>','<c:out value="${table.key}"></c:out>','<c:out value="${table.deadweight}"></c:out>',pname1,'<c:out value="${table.remarksSelnavCleaned}"></c:out>')" />

--%>
</display:column>

</display:table></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>

In the button selection I can choos my row to set a new value and when close the pou-up i return on the jsp withoud modify and conserve the input field.How to it is possible?


thanks so much

D.Di Donato


 
reply
    Bookmark Topic Watch Topic
  • New Topic