2012-03-23 6 views
0

내 GUI는 다음과 같습니다 및 클릭 할 때 나는 현재 아무것도하지 않는 윈도우의 닫기 버튼을 사용하려면 :여기에 창 닫기 버튼을 설정하는 방법은 무엇입니까?

enter image description here

는 JSP 당신이 방법을 말해 줄 수

<table width="100%" border="0" cellspacing="0" cellpadding="2" align="center" class="TB_nb"> 
    <tr> 
    <td colspan="3" class="pusher TB_nb"><h2>Sök person/företag</h2> 
</td> 
    <td align="right">X</td> 
</tr> 
</table> 
<br><br> 
<h2 class="pusher">Sök person/företag</h2> 
<div id="Vsok"> 

<div style="text-align: right; width: 100%; padding-right: 5%; padding-top: 5px;"> 
<span onClick="getElementById('sokF').style.display='', getElementById('bottomA').style.display='none', getElementById('bottomV').style.display='', getElementById('Vsok').style.display='none'" class="link_sm">Visa s&ouml;kformul&auml;r</span> 
</div> 

</div> 

<div id="sokF"> 

<div style="text-align: right; width: 100%; padding-right: 5%; padding-top: 5px;; padding-bottom: 5px;"> 
<span onClick="getElementById('sokF').style.display='none', getElementById('bottomA').style.display='none', getElementById('bottomV').style.display='', getElementById('Vsok').style.display=''" class="link_sm">D&ouml;lj s&ouml;kformul&auml;r</span> 
</div> 

<div style="width: 100%; margin-left: 15px; margin-right: 80px;" class="fontS80"> 
<fieldset style="border: 1px solid Grey; display:inline;"><legend class="small">Fysisk</legend> 
<div class="fl30">&nbsp;F&ouml;rnamn:</div> 
<div class="fl50"><input type="text" size="60" name="searchFornamn"></div> 
<div class="clear"></div> 
<div class="fl30">&nbsp;Efternamn:</div> 
<div class="fl50"><input type="text" size="60"></div> 
</fieldset> 

<fieldset style="border: 1px solid Grey; display:inline;"><legend class="small">Juridisk</legend> 
<div class="fl30">&nbsp;F&ouml;retag:</div> 
<div class="fl50"><input type="text" size="60"></div> 
<div class="clear"></div> 
<div class="fl30">&nbsp;Organisationsnummer:</div> 
<div class="fl50"><input type="text" size="60"></div> 
</fieldset> <br><br> 


<div class="fl30">Postort:</div> 
<div class="fl50"><input type="text" size="40"></div> 
<div class="clear"></div> 

<div class="fl30">Land:</div> 
<div class="fl50"><input type="text" size="2">&nbsp; 
        <select name=""> 
         <option value="1" SELECTED></option> 
         <option value="2"></option> 
         <option value="3"></option> 
         <option value="4"></option> 
         <option value="5">---------------------------------</option> 
</select></div> 
<div class="clear"></div> 

<div class="fl50">&nbsp;</div> 
<div class="fl5"><input type="button" value="Rensa"></div> 
<div class="fl10"><input type="button" value=" S&ouml;k " onclick="javascript:doSubmit('Namnsokning', 'search')"></div> 
<div class="clear">&nbsp;</div> 
<div class="clear">&nbsp;</div> 
</div> 

</div> 
<div style="width: 100%; margin-left: 15px; margin-right: 15px;"> 
<table width="100%" border="0" cellspacing="0" cellpadding="4" align="center"> 
<tr>  
    <td><h3>Sökresultat:</h3></td> 
    <td>&nbsp;</td> 
    <td>&nbsp;</td> 
    <td>&nbsp;</td> 
</tr> 
<tr>  
    <td colspan="4">En massa text <span class="link">Hj&auml;lp!</span> </td> 
</tr> 
<tr>  
    <td><input type="button" value="Visa alla"></td> 
    <td>&nbsp;</td> 
    <td>&nbsp;</td> 
    <td>&nbsp;</td> 
</tr> 
<tr class="smallb"> 
    <td>Antal &auml;renden: 527</td> 
    <td>&nbsp;</td> 
    <td>Visa &auml;renden: << 1-200 201-400 401-527 >> </td> 
<td>&nbsp;</td> 
</tr> 
</table> 

<table width="100%" cellspacing="0" align="center" class="sortable" id="unique_id"> 
<tr> 
    <th class="thkant">F&ouml;rnamn</th> 
    <th class="thkant">Efternamn</th> 
    <th class="thkant">Adress</th> 
    <th class="thkant">Postnr</th> 
    <th class="thkant">Postort</th> 
    <th class="thkant">Region</th> 
    <th class="thkant">Land</th> 
    <th class="thkant">Telefonnummer</th> 
</tr> 

<% 
    for(int i=0; i<apc.getSessionData().getNamnsokningLista().size(); i++) { 

     PersonInfo person = (PersonInfo)apc.getSessionData().getNamnsokningLista().get(i); 
     if(i%2==0) { 
%> 
<tr class="g1" onmouseover="javascript:setStoreStyle(this)"; onmouseout="javascript:getStoreStyle(this)" onclick="javascript:doSubmitWithModifierAndIndex('Grunduppgifter','editSearchPerson', '', '<%= person.getPersonId() %>')" style="cursor:pointer;"> 
<% 
     } else { 
%> 
<tr class="g2"onmouseover="javascript:setStoreStyle(this)"; onmouseout="javascript:getStoreStyle(this)" onclick="javascript:doSubmitWithModifierAndIndex('Grunduppgifter','editSearchPerson', '', '<%= person.getPersonId() %>')" style="cursor:pointer;"> 
<% 
     } 
%> 
    <td><%= person.getFornamn() %></td> 
    <td><%= person.getEfternamn() %></td> 
    <td><%= person.getPostadress() %></td> 
    <td><%= person.getPostnr() %></td> 
    <td><%= person.getPostort() %></td> 
    <td>&nbsp;</td> 
    <td><%= person.getLandKod() %></td> 
    <td><%= person.getTelefon() %></td> 
</tr> 
<% 
} 
%> 
</table> 


<div id="bottomV"> 
<table width="100%" align="center"> 
<tr> 
<td align="left"><input type="button" id="visaknapp" value="Visa" disabled style="width:150px;" onClick="getElementById('sokR').style.display='', getElementById('bottomA').style.display='', getElementById('bottomV').style.display='none', getElementById('Vsok').style.display='', getElementById('sokF').style.display='none'"></td> 
<td align="right"><input type="button" value="Avbryt" style="width:150px;" class="checkmargin"><input type="button" value="Infoga" disabled style="width:150px;"></td> 
</tr> 
</table> 
</div> 

<div id="bottomA" style="display: none"> 
<table width="100%" align="center"> 
<tr> 
<td align="left"><input type="button" value="&Auml;ndra i register" style="width:150px;"></td> 
<td align="right"><input type="button" value="Avbryt" style="width:150px;" class="checkmargin"><input type="button" value="Infoga" style="width:150px;"></td> 
</tr> 
</table> 
</div> 
</div> 

입니다 닫는 기능을 사용 하시겠습니까? 그것을이 코드는 지금처럼

function xOnclick() { 
    window.close() 
} 

<td onclick="xOnclick()" style="text-align: right; cursor: pointer;">X</td> 

: 당신이

+1

멋진 상자 란 무엇입니까? 무엇을 닫으시겠습니까? –

+1

그건 닫는 버튼이 아니에요. ''요소의 X입니다 ... –

+0

상자입니다. JSP include 태그로 열 수있는 창을 받았습니다. 그래서 "정상적인"팝업이 아닌 것 같습니다. 그것은 인라인이므로 닫는 방법에 대한 몇 가지 특별한 규칙이 있습니까? –

답변

1

나는 그것을 닫으려는 정확히 무엇인지 모르는 감사,하지만 난 방법 X에 온 클릭 핸들러를 연결하는 방법을 표시 할 수 있습니다 창을 닫지 만 필요할 경우 다른 것으로 바꿀 수 있습니다.

+0

'window.close()'는 인라인 "창"에 대해 좋은 작업을 수행하지 않습니다. – ThiefMaster

+0

그래서 내가 OP에게 그가 정확히 닫고 싶은 것을 물었다. – Tom

+0

해답입니다. JSP로 열면 인라인 창이라고 생각합니다. 그런 다음 검색 페이지가 열리기 전에 페이지를 닫고 페이지를 렌더링하는 방법을 정확히 모릅니다. –

관련 문제