Re: [pidget-devel] new bindings
Brought to you by:
lkehresman
From: Luke E. <lu...@eh...> - 2003-10-19 14:27:18
|
On Sat, Oct 18, 2003 at 09:51:55PM -0400, David Whittington wrote: > > Indeed. We need to be able to retrieve information from widgets after a > ... [snip] ... > assigned to the widget. What do people think? Is it a worthy idea? I think that's a good idea for assigning names to widgets, but I'm a bit skeptical about what happens after post. As far as setting names, it could be another parameter of the constructor, and at render-time, the names could get concatinated together with parent names. Example: $fnEditbox = new pEditbox($form, "FirstName"); $lnEditbox = new pEditbox($form, "LastName"); That all works fine, I think. But after the form has been posted, how do we retrieve the values from $_POST? They could do it manually, but that is less than ideal. I would really like to have an object interface that gets loaded on form post which contains some easy way to get the data. Preferrably without having to know the names of the widgets themselves. What I'm thinking is something like this: At the top of a page that has some values in the $_POST variable, an object heierarchy will be created of pData objects. The pData object would have methods like: GetData(); GetType(); GetName(); GetChildren(); This way, to use your example of the contact manager, To fetch information after a post with two contact widgets on the same page, they would receive a pData widget heierarchy that would look like this: pData[page] | +-- pData[contact1] | | | +-- pData[firstname] | +-- pData[lastname] | +-- pData[phone] | +-- pData[contact2] | +-- pData[firstname] +-- pData[lastname] +-- pData[phone] Would something like that work? Luke -- Luke Ehresman luke[at]ehresman.org http://www.luke.ehresman.org |