이 페이지는 newwindow에서 열립니다. 하나의 텍스트 상자와 두 개의 단추가 있습니다 (h : commandbutton 및 a4j : commandButton).기본 동작 방지
커서 포커스를 텍스트 필드로 이동 (설정)합니다.
내 문제는 텍스트 필드에서 입력 버튼을 누르면 자동으로 h : comandButton 작업이 호출되고 새 창이 닫힙니다. 이것을 피하는 방법.
하지만, 내가 버튼을 입력 A4J 커서의 포커스를 이동 쳤을 때 내가 필요 : 내가 textfiled에서 버튼을 입력 치면있는 명령
<f:view>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
function a4jButtonClick()
{
alert("A4J Command Buton clicked...");
}
</script>
</head>
<body>
<h:form id="sampleForm">
<rich:panel id="samplePanel">
<h:outputText value="User Name : "/>
<h:inputText/>
<h:commandButton value="Closing-CommandButton"
onclick="javascript:window.close();return false;"/>
<a4j:commandButton value="A4JCommandButton" onclick="a4jButtonClick()"/>
</rich:panel>
</h:form>
</body>
</html>
</f:view>
, 난 "(A4J를 스크립트 경고를 호출 할 Command Buton 클릭 ... ");
도와주세요. 감사합니다.
답변 해 주셔서 감사합니다. 이제 내 질문을 업데이트합니다. 나는 false를 반환합니다. 사건이 창문이 닫히고 있습니다. – Eswar
물론 닫히기 전에 window.close()가 호출됩니다. false –
ok. 먼저 onclick "return false; javascript : window.close();"를 사용합니다. 하지만 수동으로 "Closing-CommandButton"을 클릭하면 새 창이 닫히지 않습니다. – Eswar