Answered by:
Change the visualisation of details modal picker

Question
-
Hi guys,
I am trying to change the visualisation of details modal picker. I am using custom control and its render method.
And here is the code:
Here is what I get on the main screen (that contains the modal picker)
The full text of the error is: "Customcontrol error: xxxxPropertytemplate_render() method error: typeerror: cannot read property 'xxxx_number' of undefined" (xxxx is not part of the error, its just part of the property name - nothing important).If I click on the modal picker, a new window popups. The visualisation in the popup is exactly as I want it to be.
Please help me to find what is the reason for the error on the main screen.
By the way Manage included data configuration is correct - the related entity is marked as Included in the query that I use on the main screen.Thanks,
Martin
Wednesday, February 13, 2013 9:11 PM
Answers
-
The data may not be there yet. Using a DataBind will allow you to make sure the data is there. See: Writing JavaScript That Implements The Binding Pattern In Visual Studio LightSwitch
- Proposed as answer by PiersonLeeMicrosoft employee Friday, February 15, 2013 10:32 PM
- Marked as answer by Martin Karaivanov Friday, February 15, 2013 10:33 PM
Thursday, February 14, 2013 4:35 PM
All replies
-
Hi Martin,
Are you sure you want to append your html to the element? or do you want to do an element.innerHTML() with your code?
-Pierson
Thursday, February 14, 2013 12:07 AM -
Hi Pierson,
I think the issue here is with the contentItem. I can see it is of the correct type (entity that is navigation property of the main screen entity) but its value is undefined, that is why it gives me "...cannot read property 'xxxx_number' of undefined". I checked all available resources about using custom controls and the render method but can't figure this out. Thanks for helping me.
Martin
Thursday, February 14, 2013 7:28 AM -
The data may not be there yet. Using a DataBind will allow you to make sure the data is there. See: Writing JavaScript That Implements The Binding Pattern In Visual Studio LightSwitch
- Proposed as answer by PiersonLeeMicrosoft employee Friday, February 15, 2013 10:32 PM
- Marked as answer by Martin Karaivanov Friday, February 15, 2013 10:33 PM
Thursday, February 14, 2013 4:35 PM -
Thanks Michael, I will try that approach.Friday, February 15, 2013 10:13 PM