For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > May 2005 > Re: [PEAR] FB + QFC + back + linkNewValue = trouble









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PEAR] FB + QFC + back + linkNewValue = trouble
Justin Patrin

2005-05-27, 3:58 am

On 5/25/05, Ken Restivo <ken@restivo.org> wrote:
> On Wed, May 25, 2005 at 09:18:00PM -0700, Justin Patrin wrote:
...[color=darkred]
>=20
> Thanks. You rule! I've spent ws fiddling with this, and had no luck fi=

nding that. I never would have even thought to look there.

:-) It took a while for me to find it, too. I assumed QFC would be
using setDefaults as this is what makes sense... but, alas,
HTML_QuickForm_Page extends HTML_QuickForm so they assume they can
play with internal vars... It's ok if they're protected, but those are
more private vars...

And in case you wanted to see it working:
http://pear.reversefold.com/SubFormQFC.php

>=20
>=20
> Indeed. Setting private variables =3D=3D bad. Of course, I do it myself o=

ccasionally, but in a custom app where I pretty much have control over the =
whole thing.

And, unfortunately, I do it with the SubForm element as I have no
other choice. Well, I don't set any private vars except _submitValues
in the subForm. Other than that I read a few private vars. But this is
mostly due to a lack of a public API to interact with them. I also doa
bit of "private var magic" in FormBuilder, but I plan to fix
it...eventually...when I figure out how.

>=20
>=20
> My approach is kind of a mix of SubForm and FB. For your amusement (and =

my embarassment):
>=20

[snip]
>=20
> My users couldn't figure out "-- New Value --" so I gave them an "Add Ne=

w" button prominently displayed next to the popup. And I have a burning pas=
sionate hate of JavaScript (my browser is w3m), so I'm doing the popup/subf=
orm switch server-side. FYI, addSubTables() is similar to FB::_prepareLinkN=
ewValue().

Never thought people wouldn't be able to figure that out...I could add
an option which would add a button in FormBuilder instead of making it
an option in the select. I'd also have to make it add the option to
the select and select it, though, as the value in the select is
important for making the whole system work right now...

>=20
> SubForm seems more anatomically-correct, so I'll probably modify my app t=

o use it instead.

:-) go for it. Let me know if you encounter any errors.

>=20
> Again, thanks for tracking this down so quickly.
>=20


And, also, I've altered FormBuilder to use SubForm instead of the
PopupSelect element I had previously created (it was more of a hack
than SubForm and less compatible). I would really appreciate it if you
could give it a try and see if it works for you in QFC.
http://pear.reversefold.com/DB_Data...-0.16.1pre2.tgz

I did a quick test of FB with QFC here:
http://pear.reversefold.com/LinkNewValueQFC.php
Go to the second page and you can see my Movie form created by FB. The
Genre select has a --New Value -- entry and it seems to be keeping its
values if you click next then back.

--=20
Justin Patrin
Ken Restivo

2005-05-28, 8:56 pm

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

[whole thread snipped]
> And, also, I've altered FormBuilder to use SubForm instead of the
> PopupSelect element I had previously created (it was more of a hack
> than SubForm and less compatible). I would really appreciate it if you
> could give it a try and see if it works for you in QFC.
> http://pear.reversefold.com/DB_Data...-0.16.1pre2.tgz
>


Umm.. uh, did you change FB back the way it was, to not use the fb_ versions of the config vars anymore? I missed that one. Gah.

/me fires up query-replace.

> I did a quick test of FB with QFC here:
> http://pear.reversefold.com/LinkNewValueQFC.php
> Go to the second page and you can see my Movie form created by FB. The
> Genre select has a --New Value -- entry and it seems to be keeping its
> values if you click next then back.


That looks pretty good. Thanks.

- -ken
- --
- ---------------
The world's most affordable web hosting.
http://www.nearlyfreespeech.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCmLOoe8HF+6xeOIcRAvjtAJ0U0lLjzrkV
IX8yATiYygLZo0hQjwCgqiYX
hAzB/TLP9Xs/AQCmZG6lE+c=
=IYtO
-----END PGP SIGNATURE-----
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com