locked
Interacting with one screen property from another RRS feed

  • Question

  • In the Silverlight client I have a lot of code of the form:

    Private Sub Property1_Changed()
        If (Me.Property1 = True) Then
            Me.Property2 = False
        End If
    End Sub

    But in the HTML client, when I'm trying to wire up data bind callbacks or change event handlers, I do this in a render or postRender method. So I only have access to the element and the contentItem and not the screen. Which means I'm unable to do screen.Property2 = false when I'm setting up Property1.

    I found this article which provides a solution, sort of, in it's findMatchingContentItems function. But is that really what needs to be done? Do I need to traverse the content tree by looking at a parents and children if I want to change one property from another? Or is there an easier way?

    Thursday, December 10, 2015 8:14 PM

Answers

  • You can access the screen from inside any render or post_render function.  contentItem.screen will get you the screen to which the contentItem is bound.  Once you access the screen, you can access anything.
    • Marked as answer by kyle ls Friday, December 11, 2015 7:48 PM
    Thursday, December 10, 2015 8:39 PM

All replies

  • You can access the screen from inside any render or post_render function.  contentItem.screen will get you the screen to which the contentItem is bound.  Once you access the screen, you can access anything.
    • Marked as answer by kyle ls Friday, December 11, 2015 7:48 PM
    Thursday, December 10, 2015 8:39 PM
  • I knew it was something simple. Thanks!
    Friday, December 11, 2015 7:48 PM