custom view? custom template?

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
zshansas1
User
Posts: 3

custom view? custom template?

Post by zshansas1 »

Setup:

Tables:
Products (Product_Id, Product_Name, Product_Code...)
Orders (Order_Id, Order_Number, Date, ...)
Order_Items(Item_Id, Order_Id, Product_Id, Qty)

Links:
Products -> Order_Items
Orders -> Order_Items

Question:
Order Item table, "Product_Id" field I have configured as lookup, where Product_Id is the value and Product_Code, Product_Name are the display values. Product_Code and Product_Name are displayed as comma delimited in one column, I would like to have then in separate columns, what is the recommended way for some situation? Custom View or Custom Template or something else?

Thanks


vincenthung
User
Posts: 88

Post by vincenthung »

If you want to create list page that show the product id as 2 column, you can create a view and duplicate the "Product_Id" field with 2 alias. Then make them display as "Product_Id" and "Product_Name" respectively.


zshansas1
User
Posts: 3

Post by zshansas1 »

vincenthung, your solution works in List View, however Add/Edit pages don't work, system gets confused between the two fields and ignores entry configuration (i guess because when views are used for data entry it uses the original field names and not aliases). Any other recommendations how to address this issue?


vincenthung
User
Posts: 88

Post by vincenthung »

I think you should add or edit the records in the original table.

If you want to perform add/edit from the list page of the table view.

You can try to update the links of the add, edit button in the list page of table view to link to the original table in "ListOptions_Rendered" server event of the list page.

For example: (Update the edit link in table view list page)
ListOptions("edit").Body = ListOptions("edit").Body.Replace("<Table View>edit.vbhtml","<Table>edit.vbhtml")

And after the action performed, redirect back to the list page of the table view.

  • Setup the "Return Pages" in [Table] -> [Return Pages] -> [After add and After edit] with "<Table View>list.vbhtml"

zshansas1
User
Posts: 3

Post by zshansas1 »

Thanks, that does the job!


Post Reply