Hi,
I'm also curious, and would like a simple solution to this, instead of having to create a custom repository (only solution i can think of) and modify the GetPaged() method for every table I have.
Hey, you'll have to hook into the event model and write the select query... there should be some examples here on the forum, I'll see what I can find...
Hi Tim,
Thanks for the speedy reply.
I've checked the example, and implemented the code in my project.
Due to being on an older Umbraco, and MVC project, I had to reference a different object, as seen in my code;
Every time I click to open a UI-O-Matic entity, my code hits the if loop, and enters when the correct table is clicked, and my query works (tested resulting Query in appropriate DBMS).
However, my FK isn't being replaced with the field I'd like to return instead, which would be langauges.Name instead of propertytypelisttranslations.LanguageId
Do I have to add something to the resulting POCO, but keep it empty?
Is it possible to have a custom query for the edit screen in UI-O-Matic? The BuiltQuery event allows for a custom query in the List View that displays all of the records. Is there something equivalent for a single record?
I need to access a value from a related table to display on the edit screen. It is not editable and for display only.
List name field of reference table instead of Id in Ui-O-Matic table
Hi,
I am using Ui-O-Matic. It is working really nice. But problem is in listing records of table.
I am able to list added records of table. But if table has any reference table. Then it will show you stored Id of reference table.
But I want to list name field of reference table instead of Id. To make it more readable.
Please see attached screenshot here. Please help me to get expected result.
Hi, I'm also curious, and would like a simple solution to this, instead of having to create a custom repository (only solution i can think of) and modify the GetPaged() method for every table I have.
Can anyone help, or shed some light on this?
Comment author was deleted
Hey, you'll have to hook into the event model and write the select query... there should be some examples here on the forum, I'll see what I can find...
Comment author was deleted
Check out this example
https://github.com/TimGeyssens/UIOMatic/blob/master/src/Example/Startup.cs#L28
https://github.com/TimGeyssens/UIOMatic/blob/master/src/Example/Startup.cs#L49
Hi Tim, Thanks for the speedy reply. I've checked the example, and implemented the code in my project. Due to being on an older Umbraco, and MVC project, I had to reference a different object, as seen in my code;
Every time I click to open a UI-O-Matic entity, my code hits the if loop, and enters when the correct table is clicked, and my query works (tested resulting Query in appropriate DBMS).
However, my FK isn't being replaced with the field I'd like to return instead, which would be langauges.Name instead of propertytypelisttranslations.LanguageId
Do I have to add something to the resulting POCO, but keep it empty?
Comment author was deleted
Yeah you need update your poco so it includes a name property that can be populated
Comment author was deleted
and mark it with
[ResultColumn] [UIOMaticIgnoreField]
Comment author was deleted
Check out the poco from the example here https://github.com/TimGeyssens/UIOMatic/blob/master/src/Example/Models/Dog.cs#L35
Comment author was deleted
But it seems you have 2 with the alias Name, so you'll have to have an as ... in your query
I have updated my POCO accordingly, to name them uniquely. I have also added the LanguageName to my POCO, and given it the attributes as Iyou linked;
Making it;
However, my FK is still not being replaced with the new field;
Anything else I can do?
Comment author was deleted
Which ui o matic version are you using, for an item to appear in the list view you also have to mark it with an attribute
Comment author was deleted
so with the attri [UIOMaticListViewField]
It looks like I managed to get it working! basically what I did after changing the attribute, is move the LangaugeName next to LanguageId, and removed
from LanguageId.
I added what i removed, to LanguageName instead, and well, it works how I want it to be honest;
My POCO for what I mean;
Comment author was deleted
Does that do the trick? It won't replace it but will add a new column... if you wish to remove the id column then don't mark that with the attribute
Comment author was deleted
Great, glad you have it working!
Is it possible to have a custom query for the edit screen in UI-O-Matic? The BuiltQuery event allows for a custom query in the List View that displays all of the records. Is there something equivalent for a single record?
I need to access a value from a related table to display on the edit screen. It is not editable and for display only.
Thanks
Dallas
is working on a reply...