locked
Is there a workaround to have the drop-down value be blank on a create screen when the Entity Summary is Set to a Computed Property RRS feed

  • Question

  • I am creating a Lightswitch Desktop Application using Visual Studio 2012 Update 3 (11.0.60610.01) and am having an issue where the Create Screen is defaulting text for drop downs that are bound to Entities having a Computed Summary columns.  The drop downs are defaulted with text; however, have no value. If you select the drop down without selecting a value, and then click off of it it clears the text.  In contrast, if I set the Entity's summary to a non-computed property the drop-down's text is blank, which is the desired effect in either situation. 

    Here is a little more detail:

    I have an entity "Employee" (from SQL table), with fields "FirstName" and "LastName", I have a computed property named "FullName" with method:

            partial void FullName_Compute(ref string result)
            {

    result = string.Format("{0} {1}", this.FirstName.ToString(), this.LastName.ToString());

    }

    Both Firstname and LastName are required fields (so there are no null values)
    The Employee Entity summary property is set to "FullName"

    I create a query EMPLOYEE_QUERY that sorts the employees by lastname.

    This query is used to populate a dropdown on the screen, when the create screen loads in run-time, the drop-down is populated with the first employee record; however, there is no value IOW if I press save it throws a validation error saying an Employee is not selected.

    I would like to know how to make the text for the drop down blank when the screen loads using an entity with a summary field set to a computed property.  I have tested this in other entities and I am having the same issue.  I am thinking this is a bug and am hoping someone can provide a workaround.  Thanks in advanced.

    Monday, October 14, 2013 4:34 PM

All replies

  • Is anyone able to duplicate these results?
    Tuesday, October 15, 2013 8:29 PM
  • Hi PaulPerret,

    Can you try this for me? Select the control in your Screen Designer for the drop down and take a screen shot of the properties window, specifically around the Binding property and post that for me?

    Thanks

    Pierson

    Wednesday, October 16, 2013 1:53 AM
    Moderator
  • Let me know if you need anything else. In the meantime I just created a new DB Field and am updating the FULLNAME field when the entity changes.

    I'm not allowed to attach an image, because I'm not fully verified (I do not know how to get fully verified).  The DataBinding is grayed out and is populated with "MANPOWER_REQUESTProperty.SUPERVISOR_EMPLOYEE"

    Wednesday, October 16, 2013 8:13 PM
  • To get verified I think you have to verify your email address. The system should have sent your email address (the one you sign in with) an email to verify your account).

    Is Supervisor_Employee an entity or a field in a table?

    Wednesday, October 16, 2013 8:40 PM
    Moderator
  • It is a query from an entity
    Thursday, October 17, 2013 9:06 PM
  • Hi,

    I am experiencing the same problem. I have an entity Material, which has an optional relationship to StockStatus. The summary property of StockStatus is a computed field.

    On my Material Detail screen when loading an entity with a BLANK StockStatus, the dropdown populates by default with the first value in the screen. When refreshing the screen, the value is cleared. After the value has been cleared on one instance of this detail screen, the value is also displayed correctly on all subsequently opened instances of this detail screen.

    Appreciate you help.

    Kind regards,

    Pieter van Aarde

    Tuesday, February 18, 2014 5:09 AM