Adding Value Property that does not have a DB Bind Column Value

Aug 20, 2011 at 1:23 PM

I have an Editable Child that I am trying to add a column to that is not bound to a database column.  I have been able to do this in the past.  Is this an acceptable practice or has there been a new feature in 4.0 that has replaced this ability.

On my editable child I get this output:

MenuItemRoot:
    File: C:\KMM_VisualStudio\K CAFE\KCafe_Mercurial\KCafeWPF\CSLAOutput\KMMCafeManager\Library\DataAccessObjects\MenuItemRoot.Designer.cs
An error occurred while generating object:
Object reference not set to an instance of an object.

Stack Trace:
   at CslaGenerator.CodeGen.CslaTemplateHelperCS.ColumnNameMatchesParentProperty(CslaObjectInfo parent, CslaObjectInfo info, IColumnInfo validatingColumn)
   at CslaGenerator.CodeGen.CslaTemplateHelperCS.PropertyNameMatchesParentProperty(CslaObjectInfo parent, CslaObjectInfo info, ValueProperty prop)
   at _CodeSmithTemplate.EditableChild_cst.__RenderMethod1(TextWriter writer, Control control)
   at CodeSmith.Engine.DelegateControl.Render(TextWriter writer)
   at CodeSmith.Engine.Control.RenderChildren(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.Render(TextWriter writer)
   at CslaGenerator.CodeGen.AdvancedGenerator.GenerateObject(CslaObjectInfo objInfo, CslaGeneratorUnit unit)

PQT8W-68YB2-MPY6C-9JV9X-42WJVMenuItemRoot:
    File: C:\KMM_VisualStudio\K CAFE\KCafe_Mercurial\KCafeWPF\CSLAOutput\KMMCafeManager\Library\DataAccessObjects\MenuItemRoot.Designer.cs
An error occurred while generating object:
Object reference not set to an instance of an object.

Stack Trace:
   at CslaGenerator.CodeGen.CslaTemplateHelperCS.ColumnNameMatchesParentProperty(CslaObjectInfo parent, CslaObjectInfo info, IColumnInfo validatingColumn)
   at CslaGenerator.CodeGen.CslaTemplateHelperCS.PropertyNameMatchesParentProperty(CslaObjectInfo parent, CslaObjectInfo info, ValueProperty prop)
   at _CodeSmithTemplate.EditableChild_cst.__RenderMethod1(TextWriter writer, Control control)
   at CodeSmith.Engine.DelegateControl.Render(TextWriter writer)
   at CodeSmith.Engine.Control.RenderChildren(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.Render(TextWriter writer)
   at CslaGenerator.CodeGen.AdvancedGenerator.GenerateObject(CslaObjectInfo objInfo, CslaGeneratorUnit unit)
Coordinator
Aug 21, 2011 at 12:47 AM
Edited Aug 21, 2011 at 8:42 AM
farkmischer wrote:

I have an Editable Child that I am trying to add a column to that is not bound to a database column.  I have been able to do this in the past.  Is this an acceptable practice or has there been a new feature in 4.0 that has replaced this ability.


[Edited]

Tested with EditableRoot and didn't crash CGF. But SProcs expect a bound column so they must be hand corrected.

EditableChild has a problem.

Didn't test other stereotypes (yet))

 

Coordinator
Aug 21, 2011 at 9:52 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Aug 21, 2011 at 2:55 PM

Yeah I did test and notice that it worked on the Editable root.  I may be programming incorrectly but I was using the unbound value to make things easier for my datatrigger.  For my current project there is some extra processing that I need to do if several of the items are set a certain way when I save the object.  I was planning on using it as a flag for the stored procedure.  The value would just que something else to happen but would never be stored in the db.  This may not be the proper way to do this but I have used it for little things here and there through the years.

Coordinator
Aug 21, 2011 at 3:21 PM

Hi farkmischer,

This is solved. Just grab the changed template from change set #7689.

I'm on the SProc issue.

Aug 21, 2011 at 8:06 PM

Wow you had this solved before I even posted my message.  Thank you so much for the super quick response.  This will help my project move along today.  I will pull that from SVN tonight and try it out.

 

  You are doing a great job!

Coordinator
Aug 21, 2011 at 8:13 PM

Hi farkmischer,

I think you should thank Saint Peter.

This week end the weather although warm is windy and rainy. It's not what we are used to have in August. As I couldn't go to the beach, I had to program a bit.