Hi,
I recently started playing with Orbeon and found it is a great product and is quite useful for us. However, when I was trying to fit Orbeon in our web framework, I had a problem. In order to include the Orbeon form in our web pages, I have to put the form between our company's header and footer, which is normally done through include in PHP. Since no PHP code is executed in Orbeon, I tried to do a GET of the form from a PHP page. The form looks ok when it is displayed in the browser, however, as long as I make any change, which triggers AJAX to run, an error message appears on the top left corner of the form, saying "Error while processing response: undefined". And Firebug, gave me "Permission denied to call method XMLHttpRequest.open" I first thought it may be a cross domain AJAX problem because the PHP page and Orbeon are on different servers, but moving them on the same server under the same domain(different ports) doesn't fix the problem. My questions are then: (1) Could anyone tell me how can I get rid of this problem? (2) Is there any easy way to include a header and a footer files in an Orbeon form? Thanks very much! Jason The PHP code is attached: <?php session_start() ; // utils, libraries, classes and various bits of magic include "_include.php5" ; // instantiate util objects include "_prepare.php5" ; // deal with the user object and session handling include "action/_user.php5" ; $service = str_ireplace( ' ', '+', 'http://localhost:8080/ops/hwhite/' ) ; $client = new Zend_Http_Client ( $service ) ; $client->setMethod ( Zend_Http_Client::GET ) ; $service_response = $client->request() ; $response_body = (string) $service_response->getRawBody() ; $status = $service_response->getStatus() ; $response_body = str_ireplace( '/ops/', 'http://localhost:8080/ops/', $response_body ); $response_body = str_ireplace( '<a href="http://localhost:8080http://localhost:8080/ops/'">http://localhost:8080http://localhost:8080/ops/', 'http://localhost:8080/ops/', $response_body ); $base_url = "http://localhost:8080/ops/"; echo $response_body; ?> -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Hi Jason,
> (2) Is there any easy way to include a header and a footer files in an > Orbeon form? You could use the Page Flow Epilogue to add header and footer code to the output. The Epilogue is described here: http://www.orbeon.com/ops/doc/reference-epilogue HTH florian -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
In reply to this post by jasonskwok
Jason,
You may be better off including the form using an iframe in your page. It's not an ideal situation because iframe has limitations, in particular in terms of layout, but it will make sure that the Orbeon Forms code does not conflict with your own code. A few questions: * Is iframe an option for you? * Does your PHP page use other JavaScript libraries? Best, -Erik Jason Kwok wrote: > Hi, > > I recently started playing with Orbeon and found it is a great product > and is quite useful for us. However, when I was trying to fit Orbeon > in our web framework, I had a problem. > > In order to include the Orbeon form in our web pages, I have to put > the form between our company's header and footer, which is normally > done through include in PHP. > > Since no PHP code is executed in Orbeon, I tried to do a GET of the > form from a PHP page. The form looks ok when it is displayed in the > browser, however, as long as I make any change, which triggers AJAX to > run, an error message appears on the top left corner of the form, > saying "Error while processing response: undefined". And Firebug, gave > me "Permission denied to call method XMLHttpRequest.open" > > I first thought it may be a cross domain AJAX problem because the PHP > page and Orbeon are on different servers, but moving them on the same > server under the same domain(different ports) doesn't fix the problem. > > My questions are then: > (1) Could anyone tell me how can I get rid of this problem? > (2) Is there any easy way to include a header and a footer files in an > Orbeon form? > > Thanks very much! > Jason > > The PHP code is attached: > > <?php > session_start() ; > > > // utils, libraries, classes and various bits of magic > include "_include.php5" ; > > // instantiate util objects > include "_prepare.php5" ; > > // deal with the user object and session handling > include "action/_user.php5" ; > > > $service = str_ireplace( ' ', '+', 'http://localhost:8080/ops/hwhite/' ) ; > > $client = new Zend_Http_Client ( $service ) ; > > $client->setMethod ( Zend_Http_Client::GET ) ; > > $service_response = $client->request() ; > $response_body = (string) $service_response->getRawBody() ; > $status = $service_response->getStatus() ; > > $response_body = str_ireplace( '/ops/', 'http://localhost:8080/ops/', > $response_body ); > $response_body = str_ireplace( > '<a href="http://localhost:8080http://localhost:8080/ops/'">http://localhost:8080http://localhost:8080/ops/', > 'http://localhost:8080/ops/', $response_body ); > > $base_url = "http://localhost:8080/ops/"; > echo $response_body; > ?> > -- Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.com/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Erik,
Thanks for this and iframe is definitely an option, and it now works well for me. However, I still have no clue why I got that error. There is no other js library I used on that php page, and the error still occurs even when the client that sources orbeon is hosted on the same server under the same domain. J On 24/08/07, Erik Bruchez <[hidden email]> wrote: > Jason, > > You may be better off including the form using an iframe in your page. > It's not an ideal situation because iframe has limitations, in > particular in terms of layout, but it will make sure that the Orbeon > Forms code does not conflict with your own code. A few questions: > > * Is iframe an option for you? > * Does your PHP page use other JavaScript libraries? > > Best, > > -Erik > > Jason Kwok wrote: > > Hi, > > > > I recently started playing with Orbeon and found it is a great product > > and is quite useful for us. However, when I was trying to fit Orbeon > > in our web framework, I had a problem. > > > > In order to include the Orbeon form in our web pages, I have to put > > the form between our company's header and footer, which is normally > > done through include in PHP. > > > > Since no PHP code is executed in Orbeon, I tried to do a GET of the > > form from a PHP page. The form looks ok when it is displayed in the > > browser, however, as long as I make any change, which triggers AJAX to > > run, an error message appears on the top left corner of the form, > > saying "Error while processing response: undefined". And Firebug, gave > > me "Permission denied to call method XMLHttpRequest.open" > > > > I first thought it may be a cross domain AJAX problem because the PHP > > page and Orbeon are on different servers, but moving them on the same > > server under the same domain(different ports) doesn't fix the problem. > > > > My questions are then: > > (1) Could anyone tell me how can I get rid of this problem? > > (2) Is there any easy way to include a header and a footer files in an > > Orbeon form? > > > > Thanks very much! > > Jason > > > > The PHP code is attached: > > > > <?php > > session_start() ; > > > > > > // utils, libraries, classes and various bits of magic > > include "_include.php5" ; > > > > // instantiate util objects > > include "_prepare.php5" ; > > > > // deal with the user object and session handling > > include "action/_user.php5" ; > > > > > > $service = str_ireplace( ' ', '+', 'http://localhost:8080/ops/hwhite/' ) ; > > > > $client = new Zend_Http_Client ( $service ) ; > > > > $client->setMethod ( Zend_Http_Client::GET ) ; > > > > $service_response = $client->request() ; > > $response_body = (string) $service_response->getRawBody() ; > > $status = $service_response->getStatus() ; > > > > $response_body = str_ireplace( '/ops/', 'http://localhost:8080/ops/', > > $response_body ); > > $response_body = str_ireplace( > > '<a href="http://localhost:8080http://localhost:8080/ops/'">http://localhost:8080http://localhost:8080/ops/', > > 'http://localhost:8080/ops/', $response_body ); > > > > $base_url = "http://localhost:8080/ops/"; > > echo $response_body; > > ?> > > > > > -- > Orbeon Forms - Web Forms for the Enterprise Done the Right Way > http://www.orbeon.com/ > > > > -- > You receive this message as a subscriber of the [hidden email] mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > > -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
Jason,
On 9/5/07, Jason Kwok <[hidden email]> wrote: > Thanks for this and iframe is definitely an option, and it now works > well for me. However, I still have no clue why I got that error. There > is no other js library I used on that php page, and the error still > occurs even when the client that sources orbeon is hosted on the same > server under the same domain. The server the Ajax request goes to is based on the URL the xforms.js is loaded from. In your case, where is the xforms.js loaded? Is it on the start of the URL the same as the one used to serve the page? To debug this, you can modify xforms.js, and add a console.log(XFORMS_SERVER_URL) after the "XFORMS_SERVER_URL = BASE_URL + ...". Alex -- Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise http://www.orbeon.com/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Free forum by Nabble | Edit this page |