I have never used callServer() before in a DCT. Now I may have to use it. I need some confusion cleared.
I am going through guide, but can not understand it.
| The target server (which can be any process that can handle an HTTP request and make a response, such as a servlet or CGI) reads the request and returns JavaScript code embedded in an HTML page. This page is loaded into a hidden frame, distinct from the frame that contains the user script and FormAPI. FormsPublisher provides a special parent.getScriptFrame() function to this hidden frame that returns the user script frame. In this way, the code returned by the server coexists with the user script and has full access to its methods and data |
1) a remote server call is made using callServer() , then remote server executes a CGI and returns an HTML page as response which contains Javascript code only. Why is there Javascript code only ? can this HTML page not containg any other HTML code ? As CGI can return any valid HTML code.
2) This page is loaded in hidden frame. What does this mean ? what is hidden frame ? Is it separate HTML page or is it a frame within DCT form used by user ? I did not see any attribute in frame element to make a frame hidden. When HTML page is returned by remote server that contains javascripot code, does it exist separately from DCT form or does it exist within DCT form ? It looks like this HTML that contains Javascript code exists within DCT form , but it is separate from already existing Javascript code.
3) FormsPublisher provides a special parent.getScriptFrame() function to this hidden frame that returns the user script frame.
Does it mean that page returned by the remote server stays in the DCT as a child page or sub page of existing DCT form ? and when we use parent.getScriptFrame(), does that get code from parent frame into the child frame ? Can we get javascript code from child frame into parent frame ?
4) How does the HTML page returned by remote server get converted to frame to exist within DCT form ?
5) What makes it necessary to get JavaScript code to be called using callServer() ? Can we just not write a JavaScript code in the DCT itself ?
thanks