See below...
this is a problem which I solved by implementing my own textfield and with interceptors. But I couldn't find a generic way to do it:
consider these settings:
table STOCKS {
STOCKS_ID int,
WKN int
}
where STOCKS_ID is the pk and WKN is unique. (Wkn is the common german unique id for Stocks).
table POOL { POOL_ID int, STOCKS_ID int, DESCRIPTION varchar } where STOCK_ID is the fk.
When editing POOL the user is not interested in seeing the STOCK_ID because it is technical. he or she wants to edit the WKN. You can do that in dbforms using a selectbox.
In my case this approach is not feasible because I have 30000 rows in STOCKS. Thus it takes to much time to load the whole selectbox.
I would like to have a textField which is prefilled with the WKN belonging to the STOCKS_ID in table POOL. When user changes the WKN (in detail view of POOL) and pushes the update Button it would be nice if dbforms would select the right STOCK_ID and updates it in POOL.
The problem I see with that is the user needs to fill in a correct WKN (if they want to change it). If they enter a wrong value [say "sco" instead of "scox"] , I assume they will get some kind of error. In that case, the user needs to figure out what what an acceptable value for the WKN is. In your case because they are stocks, the user would likely google or look it up someplace. In other situations though that may not be possible, so I am not sure if your solution is the best possible general solution.
As I mentioned before, I was thinking about using a select box where you could enter a field such as "sco" and have it update the box with matches that were like it. To solve the 30000 rows problem, instead of having the full rsv in memory, what about just running a query for the foreign key. The other values could be all sent back to the server and then just passed back along with the info from the new select query.
I have implemented a textfield which can pre-fill it in a generic way (easy, just a merge between DbSelectBox and DbTextField). But I didn't implement the way back to dbforms where you have to do the mapping between the unique key and the foreign key (I've implemted it in a interceptor for my special case).
Do you think it would be ueful to enhance dbforms to a "textForeignDataField" (or whatever we will call it)?
Any ideas?
"textForeignDataField" is a good name for the function you proposed
maybe I will have to come up with a "searchableSelectBox" that gives you an option to read from memory or re-query the database.
I would implement it in my spare time if I get positive feedback.
-- Shawn
Happily using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ DbForms Mailing List
http://www.wap-force.net/dbforms