[FX.php List] Accepting user input on multiple records simultaneously

Erik Andreas Cayré erik at cayre.dk
Mon Apr 23 02:06:14 MDT 2007


Let's see...

You have table wth many records, and you want to offer a web user the  
ability to dynamically select some of these for further processing  
(comparing or whatever).

Assuming you don't like the idea of keeping all the records in an  
array (in $_SESSION), for example because the 'further processing'  
requires more data than you like to fetch in the first place, maybe  
even related data form other tables... whatever.

I just thought of another way to deal with such a situation.
-create antother table
-in this table create a field which will be used as a foreign key in  
a relationship to the table you wish to let the user select from
-then create a layout which contains the said field, and a portal to  
the relevant table using the mentioned relationship

First fetch the (minimal) amopunt of information needed to let the  
web user select records. This MUST include the primary key of these  
records, which you will aggregate in a $_SESSION array from the  
user's selections.

When the user is ready to do the 'further processing', do an FMNew()  
puttting the user_selected keys into the fk field (implode with  
Pilcrows) this creating a multikey. This will populate the portal  
with the records selected by the user.
Now reuse the recid returned by FMNew() to find the same record now  
containing the user_selected records in the portal. (This last step  
may not be necessary, if the portal is populated before FMNew()  
returns the newly created record...)

Advantages:
-only needs few fields in first search to let the user select (?)
-remembers user selections in separate table (interesting for later  
analysis?)

Disadvantages:
-requires extra table, field and relationship
-more complex array (from portal)

Am I just a lunatic, or what do y'all think+


Den 23/04/2007 kl. 11.47 skrev Jonathan Schwartz:

> In my example below, I was suggesting...what if worst case, all 100  
> records were checked on a page.  Then that would produce 100 FMP  
> requests in order to update all 100.  That just doesn't seem right.
>
> What do you mean "filter the records"?
>
> Jonathan
>
>
>
>
>
>
> At 10:22 PM -0500 4/22/07, Dale Bengston wrote:
>> Why not get the same found set as displayed initially and filter  
>> the records to just the ones checked? Even with 100 records, I  
>> would expect this to be much faster than five separate find  
>> requests to FMSA for one record apiece. And this is a much better  
>> scenario than editing those records to somehow flag them.
>>
>> Dale
>>
>> On Apr 22, 2007, at 9:47 PM, Jonathan Schwartz wrote:
>>
>>> At 8:48 PM -0500 4/22/07, Alex Gates wrote:
>>>> Hi Jonathan-
>>>>
>>>> Maybe I don't understand exactly what you are trying to do, but  
>>>> why not just do a separate find for each of the desired  
>>>> "checked" records?
>>>>
>>>> Alex
>>>
>>>
>>> Alex,
>>>
>>> I guess that that is what is needed...loop thru the checked  
>>> records and issue an FMEdit() for each record checked. Seems like  
>>> alot of bandwidth.  What if there are 100 records on a page?
>>>
>>> Jonathan
>>>
>>> --
>>> Jonathan Schwartz
>>> Exit 445 Group
>>> jonathan at exit445.com
>>> http://www.exit445.com
>>> 415-381-1852
>>> FileMaker 8 Certified Developer
>>> _______________________________________________
>>> FX.php_List mailing list
>>> FX.php_List at mail.iviking.org
>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>
>
> -- 
> Jonathan Schwartz
> Exit 445 Group
> jonathan at exit445.com
> http://www.exit445.com
> 415-381-1852
> FileMaker 8 Certified Developer
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list



---
Erik Andreas Cayré
Spangsbjerg Møllevej 169
6705 Esbjerg Ø

Privat Tel: 75150512
Mobil: 40161183

---
»Kun p....sure mennesker kan ændre verden. Innovation skabes ikke af  
'markedsanalyse', men af folk, der er afsindigt irriterede over  
tingenes tilstand «
--Tom Peters

»Hvis du ikke kan forklare det simpelt, forstår  du det ikke godt nok.«
-- Albert Einstein

»Hvis du ikke har tid til at gøre det rigtigt, hvornår vil du så have  
tid til at lave det om?«
-- John Wooden, basketball coach




More information about the FX.php_List mailing list