<h:commandButton onclick="window.open('/page.html')" value="test" action="#{bean.myAction}"></h:commandButton>
위를 클릭하면 브라우저가 나타나 페이지를 새로 고치고 맨 위로 스크롤합니다.
"return false"를 사용하면 액션이 실행되지 않습니다.
이런 일이 발생하지 않도록하려면 어떻게해야합니까?
을 사용하는 이유를 잘 모르겠지만 "window.open('/page.html')"
작업 명령이 완료된 후 페이지를 열려면 다음을 수행하십시오.
<h:commandButton value="test" action="#{bean.myAction}">
<f:ajax onevent="function(data){ if(data.status === 'success') window.open('/page.html')}"/>
</h:commandButton>
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다