Re: [rwfphp-developers] Feedback to rwfphp from control
Status: Beta
Brought to you by:
kaibab
|
From: Berend D. <cyb...@sp...> - 2004-09-21 13:04:28
|
Ok that would be awesome :) Plus its possible to extend like the Image control and use the regions in a same way - without using normal links but with the new feedback mechanism :) And indeed, normal grids will give a lot over overhead. Take for example this system I'm testing. It has 12 columns and up to 1000 rows per page. If each cell had to be clickable and thus needed another control you would create 12.000 dynamic controls for this which offcourse is a huge slowdown. Btw, have you tried compiling the code to Zend to test if it speeds up the big, heavy applications? Berend Dekens Renaun Erickson wrote: > I know about your concerns of the lots of controls and overhead. You > have to remember the goal of rwfphp wasn't to make the fastest > framework (not saying its slow). I do want to do some more > benchmarking, there is a quick hack include in the rwfphp tools folder > but you still have insert lots of benchmark code into your existing > code to use it. > > The overhead of lots of controls is mainly memory, and data grids are > prime suspects to create specific control that uses less general > purpose controls. But in terms of the DataList I wanted something > easy to use and be able to reuse existing controls. So saying that, I > would also like a lightweight control like the approach you are > taking. It can't be done with the FrameworkController as is. But > with a general modification to the FrameworkController to handle cases > of dynamic content in controls we can get it to work. > > With that said, lets talk about your specific approach. > > "is there a way to tell the control *WHAT* has been clicked?" this is > normally passed as the $sender object. I am assuming that its the > your modified DataList control that comes back as the clicked control, > but you want to know what row/cell was clicked. > > But a general purpose way to do this is brewing in my mind. My > thinking is this. As you dynamically create the rwfName (ie: > index_r_wcFirstControl_r_wcNewDataList), you add references to the > name with another sperator. So the outputted rwfName (what ends up in > html id and/or name), would look like > index_r_wcFirstControl_r_wcNewDataList_args_param1_args_param2 > > This new separator would be called defined as FrameworkController > attribute and could be changed to your liking just like how you can > change "_r_". > > Making it with general parameters you could code your dynamic linkable > parts with numbers or names or however you want. Also you could pass > simple ID's through this method, I would not pass a whole string of > values though. But with knowing what was clicked you could create an > array in the modified DataList that held all kinds of information that > would be needed once the item was clicked. Which becomes close to > just having the items be dynamically created controls. But there are > still many cases a lightweight listing control would be nice. > > Then the FrameworkController would read up to the first _args_ > normally which would keep the events working. Then it would read in > the _args_ parameters and put them in an array and pass them as the > args to the Event. Where the $sender would equal the reference to the > wcNewDataList and the 2nd argument of the Event method would be an > array of the arguments. I am thinking making the array indexed by > numbers no associated array stuff. > > Thats a quick idea, and would work. It would save some overhead on > big lists which is always good to pursue. > Let me know if you what you think. I could code up the > FrameworkController changes pretty easy. > > Renaun |