You need to sign in to do that
Don't have an account?

Not getting any Value in CK editor on Parent Page . Value is coming through action button of child page How to reRender the Parent page
Not getting any Value in CK editor on Parent Page . Value is coming through action button of child page
How to reRender the Parent page
//////////////////////Parent Page////////////////////////////////
<apex:page StandardController="Contact" extensions="AccountSelectClassController" >
<script>
var newWin=null;
function check(){
var url='/apex/selectvideo2';
newWin=window.open(url, 'Popup','height=500,width=700,left=100,top=100,resizable=no,scrollbars=yes,toolbar=no,status=no');
}
function closePopup(){
if (null!=newWin){
newWin.close();
}
}
</script>
<apex:form id="frmId">
<apex:outputLabel value="Choose Video "/>
<apex:outputLink onClick="check();return false;"> <br/>
Click here to choose session </apex:outputLink>
<br/><br/>
<apex:outputLabel value="Body" for="Body"/>:<br/>
<apex:inputtextarea value="{!body}" id="body" styleClass="ckeditor" richtext="false" style="width: 500px; height: 150px;">
</apex:inputtextarea>
<br/><br/><br/>
<apex:includescript value="{!URLFOR($Resource.CkEditor,'ckeditor/ckeditor.js')}" />
</apex:pageblock>
</apex:form>
</apex:page>
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ child Pop up page////////////////////////////////
<apex:commandButton value="Done" onclick="CloseWindow(); return false;" action="{!callapi2}" />
</apex:pageBlock>
<script>
function CloseWindow(){
var winMain=window.opener;
if (null==winMain){
winMain=window.parent.opener;
}
winMain.closePopup()
}
</script>
</apex:form>
/////////////////////////Controller\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
public void callapi2(){
//body = '';
String SessionId = '';
for( consolewrap cwt : selectedWrapperList){
if(cwt.selected){
if(SessionId == ''){
SessionId += cwt.sid;
}else{
SessionId += ','+ cwt.sid;
}
}
}
List<video> ConsoleWrapperList1 = new List<video>();
HttpRequest req = new HttpRequest();
HttpResponse res = new HttpResponse();
Http http = new Http();
req.setEndpoint('http://webapi.demomail.net/test/SendVideoBody.js?id='+SessionId);
req.setMethod('GET');
res = http.send(req);
if(res.getstatusCode() == 200 && res.getbody() != null){
String replaceIllegal= res.getbody().replaceAll('\n','').replaceAll('\r','').replace('','');
ConsoleWrapperList1=(List<video>)System.JSON.deserialize(replaceIllegal,List<video>.class);
body = ConsoleWrapperList1.get(0).bodyT;
System.debug('***********: '+ body );
}
}
How to reRender the Parent page
//////////////////////Parent Page////////////////////////////////
<apex:page StandardController="Contact" extensions="AccountSelectClassController" >
<script>
var newWin=null;
function check(){
var url='/apex/selectvideo2';
newWin=window.open(url, 'Popup','height=500,width=700,left=100,top=100,resizable=no,scrollbars=yes,toolbar=no,status=no');
}
function closePopup(){
if (null!=newWin){
newWin.close();
}
}
</script>
<apex:form id="frmId">
<apex:outputLabel value="Choose Video "/>
<apex:outputLink onClick="check();return false;"> <br/>
Click here to choose session </apex:outputLink>
<br/><br/>
<apex:outputLabel value="Body" for="Body"/>:<br/>
<apex:inputtextarea value="{!body}" id="body" styleClass="ckeditor" richtext="false" style="width: 500px; height: 150px;">
</apex:inputtextarea>
<br/><br/><br/>
<apex:includescript value="{!URLFOR($Resource.CkEditor,'ckeditor/ckeditor.js')}" />
</apex:pageblock>
</apex:form>
</apex:page>
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ child Pop up page////////////////////////////////
<apex:commandButton value="Done" onclick="CloseWindow(); return false;" action="{!callapi2}" />
</apex:pageBlock>
<script>
function CloseWindow(){
var winMain=window.opener;
if (null==winMain){
winMain=window.parent.opener;
}
winMain.closePopup()
}
</script>
</apex:form>
/////////////////////////Controller\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
public void callapi2(){
//body = '';
String SessionId = '';
for( consolewrap cwt : selectedWrapperList){
if(cwt.selected){
if(SessionId == ''){
SessionId += cwt.sid;
}else{
SessionId += ','+ cwt.sid;
}
}
}
List<video> ConsoleWrapperList1 = new List<video>();
HttpRequest req = new HttpRequest();
HttpResponse res = new HttpResponse();
Http http = new Http();
req.setEndpoint('http://webapi.demomail.net/test/SendVideoBody.js?id='+SessionId);
req.setMethod('GET');
res = http.send(req);
if(res.getstatusCode() == 200 && res.getbody() != null){
String replaceIllegal= res.getbody().replaceAll('\n','').replaceAll('\r','').replace('','');
ConsoleWrapperList1=(List<video>)System.JSON.deserialize(replaceIllegal,List<video>.class);
body = ConsoleWrapperList1.get(0).bodyT;
System.debug('***********: '+ body );
}
}
In you code you are not passing any value from Child window to Parent Window.
change you child window code to: and change code on you parent window as:
- thatherahere
Save your VF page and run it again.
- thatherahere