errors when trying to use Facebox

thread: 35 messages  |  last: a year ago  |  started: monday, february 1, 2010, 4:24 pm pst


#1  |  kingwithin (San Francisco, CA) United States of America
Monday, February 1, 2010, 4:24 PM PST

I am trying to enable basic pop-ups that have form-submission functionality using Facebox:

http://famspam.com/facebox

However, this seems to be generating a fair number of errors.

For example, even though we are calling the file in the popup-link, it still produces an error, call to undefined method.


Line 47 is where I am invoking Facebox:

“http://github.com/allyforce/AF-upload/blob/master/Templates/profile_activity.tpl.php”


This calls the error:

“http://github.com/allyforce/AF-upload/blob/master/complete_profile_popup.php”


This is the library which defines the method:

http://github.com/allyforce/AF-upload/blob/master/Library/CompleteProfilePopup.class.php

Facebox is working when just calling straight .php.

#2  |  Mike Ho (Sunnyvale, CA) United States of America Qcodo Administrator
Monday, February 1, 2010, 10:15 PM PST

Seems to work for me...

i copied the sample.php and sample.tpl.php files to sample2.php and sample2.tpl.php.

Then I edited sample2.tpl.php to include the facebox-related code -- I had facebox calling the original form in sample.php.

It all worked fine... here's my code for sample2.tpl.php (sample2.php was the exact same code as sample.php):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php _p(QApplication::$EncodingType); ?>" />
<title>Sample QForm</title>
<style type="text/css">@import url("<?php _p(__VIRTUAL_DIRECTORY__ __CSS_ASSETS__); ?>/styles.css");</style>
<style type="text/css">@import url("facebox.css");</style>
<script type="text/javascript" src="jquery-1.4.1.min.js"></script>
<script type="text/javascript" src="facebox.js"></script>
</head><body>

<?php $this->RenderBegin(); ?>
    <p><?php $this->lblMessage->Render(); ?></p>
    <p><?php $this->btnButton->Render(); ?></p>
    <a href="#info" rel="facebox">Test</a>
    <iframe id="info" style="display: none; border: 0; padding: 0; margin: 0;" src="/sample.php">
    </iframe>
<?php $this->RenderEnd(); ?>

<script type="text/javascript">
 jQuery(document).ready(function($) {
  $('a[rel*=facebox]').facebox()
})
</script>
</body></html>

I think the main thing to note is that you'll need to call the new file in as an iframe, instead of using the <a> method for facebox.

But by doing so, you'll note that the qform on the main form and the qform in the popup both work just fine.

Please post if there are any other issues...

#3  |  kingwithin (San Francisco, CA) United States of America
Tuesday, February 2, 2010, 10:23 AM PST

So the change is you used an iframe rather than an <a> tag?

Do I need to extend the QPanel instead of the QForm?

I should be able to have a QForm work in Facebox that submits and so forth, right?

I've also posted the question on SO:


http://stackoverflow.com/questions/2186486/getting-facebox-to-work-in-the-qcodo-qcube-php-framework


This can help to raise awareness of Qcodo and get more developers on it which we need.

Thanks for the prompt response.

#4  |  kingwithin (San Francisco, CA) United States of America
Tuesday, February 2, 2010, 10:57 AM PST

Alright, I did do it, but it doesn't appear to be loading the file.  Facebox is empty.

I get an error that I was getting before:

Fatal error</b>: Call to undefined method CompleteProfilePopup::run()


#5  |  Mike Ho (Sunnyvale, CA) United States of America Qcodo Administrator
Tuesday, February 2, 2010, 12:45 PM PST

Did you try the sample code that I posted?  give that a try and see if it works -- let's make sure that your installation is working correctly first.

If it's working, then you can start by adapting the sample into whatever page you need.

If it's not, then we'll have to see what may be up with your installation or configuraiton.

#6  |  kingwithin (San Francisco, CA) United States of America
Tuesday, February 2, 2010, 4:49 PM PST

Where is the sample.php file from?  What classes does it call?

Facebox appears to be working right and does get invoked within the sample.tpl.php as well as the code.

I basically just copied the format displayed.

But it still doesn't find the class, even though it's been defined.

http://github.com/allyforce/AF-upload/blob/master/Library/CompleteProfilePopup.class.php

So structurally it's the same as far as I can tell other than that I actually have a class, extending QDialogBox.

#7  |  Mike Ho (Sunnyvale, CA) United States of America Qcodo Administrator
Tuesday, February 2, 2010, 5:14 PM PST

the sample.php is taken from the core distribution (you can view the code on github.com/qcodo if you need to).

You'll need your facebox to call a new php page (e.g. a whole qform), not just an individual qcontrol.

#8  |  kingwithin (San Francisco, CA) United States of America
Tuesday, February 2, 2010, 5:51 PM PST

It is calling the page -- I was pointing to the controller to show that the class said to be “missing” is actually defined.  Yet it has been called in the .php page.

Also...the link to the forums aren't active links at least in Gmail...so I have to cut and paste in order to respond.....?

#9  |  Mike Ho (Sunnyvale, CA) United States of America Qcodo Administrator
Tuesday, February 2, 2010, 6:18 PM PST

What's the exact error message you are getting?

and if you run the popup by itself (directly invoking complete_profile_popup.php in a browser), does it work properly?

And just to clarify, is what you are ultimately trying to do is to load complete_profile_popup.php in an iframe in a facebox?

#10  |  kingwithin (San Francisco, CA) United States of America
Wednesday, February 3, 2010, 9:01 AM PST

Yeah, here's the message, it happens in the browser or through Facebox (via Firebug):

Fatal error: Call to undefined method CompleteProfilePopup::run()

But I look at the class and it appears that it is defined.  


http://github.com/allyforce/AF-upload/blob/master/Library/CompleteProfilePopup.class.php

Yes, I just want to have some iteractions A -> B -> C take place within the Facebox pop-up.  A submits a form and returns B.  B is another form which returns C.

Thanks.

I feel we must be missing something obvious, but the developer says he just can't drill down into the problem based on Qcodo.  The facebox interaction I had tested before, so I know that works (meaning it would pull up multiple php pages as described above).

Thanks.



Copyright © 2005 - 2012, Quasidea Development, LLC
This open-source framework for PHP is released under the terms of The MIT License.