StrataFrame Forum

SF Messaging Editor - Category (How to?)

http://forum.strataframe.net/Topic24188.aspx

By Edhy Rijo - 8/14/2009

Hi Trent,



I am working on a form in which I have the need to create a feature to assign a record to a "Category" in the same easy and elegant way implemented in the SF Messaging Editor (see image attached).



I don't want to create another lookup table to handle the Categories, so would you mind explaining how you guys did it in the Messaging Editor?



Thanks!
By Trent L. Taylor - 8/14/2009

Sure. It really isn't that complicated. It is just another VarChar field in the same table. Then the combo populates with the Distinct values for the project. This way it doesn't "bleed" into other projects where the category is not defined. If you prefer to show all distinct categories across all projects (using this example) then you would not add a WHERE to filter out the categories for the project.



So generally I will create a FillWithDistinctCategories method in the BO that has the category field and then populate the combo from there.



Let me know if you need more explanation. Smile
By Edhy Rijo - 8/14/2009

Great, it is in fact simple.



One more question, in the Tree shortcut menu there is an option to "Rename" the categories, I guess in your case you will just filter out the BO for this category and rename them all in a one pass, right? or is there another more efficient trick?
By Trent L. Taylor - 8/14/2009

One more question, in the Tree shortcut menu there is an option to "Rename" the categories, I guess in your case you will just filter out the BO for this category and rename them all in a one pass, right? or is there another more efficient trick?




Actually I created a sproc to update all of the categories at once then I reload the BO. That way there are fewer changes and queries going back and forth. I did it as you had mentioned originally, but it was so slow the larger the project became that I did it in a single query, requeried, then set the index back on the changed item.
By Edhy Rijo - 8/14/2009

Understood! thanks again Tongue
By Trent L. Taylor - 8/14/2009

No problem Smile
By Edhy Rijo - 8/14/2009

I have setup my combobox and get the data OK, but if I type in the Category instead of selecting from the combobox it does not persist and is never saved. In other words, I cannot enter any value in the combobox.



What am I missing?
By Edhy Rijo - 8/14/2009

Here are some screenshots.
By Trent L. Taylor - 8/14/2009

Change the binding property to Text instead of the SelectedValue. Bet that is your problem Wink
By Edhy Rijo - 8/14/2009

Thanks again Trent, that was the problem. Still learning new stuff every day!
By Trent L. Taylor - 8/14/2009

Cool Cool