Re: Re: WOPopUpButton
Lawrence Kendall <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.newbies |
|---|---|
| Message-ID | <[email protected]> |
Look, I don't mean to be rude, but..... that is a dumb idea. If you just add a text field with your EDU stuff in it (forgetting that you would need two text fields to accommodate your original requirement for EDU and Education) then every time you do a search it will have to do a caseInsensitiveLike on each of the strings... If your product DB gets big then your searches will be slow. If you add the entity and a relationship to it then you can compare objects directly, this will yield much faster search times. Also, if you use the relationship you will simply have to use a pop up to select whatever price type you need for each product. If you end up just adding those text fields then you will need to type it in EVERY TIME which will make your data entry slower. Unnecessarily slow data entry + slow search times = application that needs improvement. Even if I didn't want the short and long names for this task, I would still create the entity and use the displayGroup. In fact, I do the same thing in a lot of my apps for Brand, ie I have a Product and it belongs to a Brand. My Brand entity has an ID and a name field, that's it. But using this data structure I can quickly find all products from this brand (and, most importantly, when I add a new product I don't have to type the brand name again). Another thing, how do you plan to present this to the user? If you give them a text field and say "please type Education or Retail or Wholesale or Ex Tax....." then you just know they will type "All" and won't get any results at all. Do you think that is a good user interface (UI)? No! Whenever you want a user to select one of a few options, make it as simple as you possibly can for them to pick the right one (or at least one that you are expecting them to pick). I don't mean to sound like I am ranting at you but I can just see that you are about to make a big mistake, one that you will soon have to go back and fix anyway. Do it right the first time and let your boss think you are a genius (and make sure he/she remembers it when the pay negotiations come round!!!). Trust me when I say that the best way to do this is to bite the bullet and add the entity and the relationship. It'll take you five minutes and you'll be rapt with the result. You will thank me later. Larry. Thanks for your help, I was hoping I could do it without having to get authorisation to change the database. I figure if I have to make changes to the database I may as well just add a field to the product description table and search on that field. --- In [email protected], Lawrence Kendall <lawrence@a...> wrote: > No Problem.... > > Yes.... I would have another table in the database. I assume you are > using EOModel?? In EOModel, add a new entity and enter the field names > I described before. In your database (DB) add your table and the > fields. > > Once you have added this table, add the priceTypeID field to the > product entity and make a relationship between them. Make sure you > also add the priceTypeID to the Product table in the DB. > > Once you have entered your data in the DB (EDU - Education etc) then > just hook it up. All Good!! ;) > > I can send you some screen grabs if you need extra help. Let me know > how you go. > > Cheers then, > > Larry. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/webobjects-newbies/ <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/