Serenity: Generated ServerType form does not include field when using custom LookupEditor

Created on 1 Oct 2019  路  4Comments  路  Source: serenity-is/Serenity

I have implemented the code described in the following link:

https://github.com/volkanceylan/Serenity/wiki/Lookup-Editors:-How-to-Create-Lookup-Editor-for-code-description-tables

On the form file ModulesDefaultEstimationsDetailEstimationsDetailForm.cs I have use the ItemsEditor2 custom Lookupeditor and it works perfectly:
image

image

But after running the T4 templates , the generated file ImportsServerTypingsDefault.EstimationsDetailForm.ts does not have the ItemId field:
image

If I use instead the standard [LookupEditor(typeof(ItemsRow))], the field ItemId is generated. I need that field as I need access to the changeSelect2 event in the dialog file.

Most helpful comment

Don't know whether it is a bug or not. For some reason, the serenity does not generate for sub-namespace like RootNamespace.Default

I think your namespace in customEditor.ts is other than your RootNamespace (maybe it is RootNamespace.Default) remove the .Default part from namespace then build and t4. I hope your issue will be resolved.

All 4 comments

In wiki, at this point there is an error

 public partial class LKCodeDescrAttribute : LKCodeDescrAttribute

is instead

 public partial class LKCodeDescrAttribute : LookupEditorBaseAttribute

Your source is correct?
(now I correct the wiky)

Don't know whether it is a bug or not. For some reason, the serenity does not generate for sub-namespace like RootNamespace.Default

I think your namespace in customEditor.ts is other than your RootNamespace (maybe it is RootNamespace.Default) remove the .Default part from namespace then build and t4. I hope your issue will be resolved.

In wiki, at this point there is an error

public partial class LKCodeDescrAttribute : LKCodeDescrAttribute
is instead

public partial class LKCodeDescrAttribute : LookupEditorBaseAttribute
Your source is correct?
(now I correct the wiky)

Thanks, I have fixed that part although it was not the reason why the field was not being generated. Additionally I needed to remove the base prefix from the values below:

CodeName = codeFieldName;
DescrName = descriptionFieldName;

Don't know whether it is a bug or not. For some reason, the serenity does not generate for sub-namespace like RootNamespace.Default

I think your namespace in customEditor.ts is other than your RootNamespace (maybe it is RootNamespace.Default) remove the .Default part from namespace then build and t4. I hope your issue will be resolved.

It worked, thanks!!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

newyearsoft picture newyearsoft  路  3Comments

stepankurdylo picture stepankurdylo  路  3Comments

stixoffire picture stixoffire  路  3Comments

AmuthaKondusamy picture AmuthaKondusamy  路  3Comments

gfo2007 picture gfo2007  路  3Comments