     viewUtils.makeEditable @, @model, 'code', {}
 
 class XLF.SkipLogicView extends Backbone.View
+  alreadyRendered: false
   initialize: (opts) ->
     @relevantDetailView = opts.relevantDetailView
     #@model = @relevantDetailView.model
-  render: () ->
-    @$el.html('<select></select> was <input placeholder="response value" type="text" />')
-    select = @$el.find('select')
-    input = @$el.find('input')
-    survey = @model.parent.getSurvey()
-    surveyNames = survey.getNames()
+  render: ($outerEl) ->
+    if !@alreadyRendered
+      @$el.html('<select></select> was <input placeholder="response value" type="text" />')
+      select = @$el.find('select')
+      input = @$el.find('input')
+      survey = @model.parent.getSurvey()
+      surveyNames = survey.getNames()
 
-    $("<option>", {value: '-1', html: 'Question...'}).appendTo(select)
-    
-    for name in surveyNames
-      $("<option>", {value: name, html: name, disabled: name is @model.parent.parentRow.get('name').get('value')}).appendTo(select)
+      $("<option>", {value: '-1', html: 'Question...'}).appendTo(select)
+      
+      for name in surveyNames
+        $("<option>", {value: name, html: name, disabled: name is @model.parent.parentRow.get('name').get('value')}).appendTo(select)
 
-    wireUpInput(select, @model, 'questionName')
+      wireUpInput(select, @model, 'questionName')
 
-    wireUpInput(input, @model, 'criterion')
+      wireUpInput(input, @model, 'criterion')
 
-    disableDefaultOption = () -> 
-      $('option[value=-1]', select).prop('disabled', true)
-      select.off('change', disableDefaultOption)
-    
-    select.on('change', disableDefaultOption)
+      disableDefaultOption = () -> 
+        $('option[value=-1]', select).prop('disabled', true)
+        select.off('change', disableDefaultOption)
+      
+      select.on('change', disableDefaultOption)
+      $outerEl.append(@el)
+      @alreadyRendered = true
+    else
+      @$el.toggle()
     
     @
 

  ``

class XLF.SkipLogicClause extends Backbone.Model
  serialize: () ->
    if (@isValid())
      return "${" + @get('questionName') + "} = " + @get('criterion')

DetailViewMixins.relevant = 
  html: ->

    """

  afterRender: ->
    viewCreated = false
    view = undefined
    button = @$el.find("button")
    button.click () =>
      @skipLogicClause = new XLF.SkipLogicClause()
      @skipLogicClause.parent = @model
      @skipLogicClause.parse(@model.get('value'))
      @model.parentRow.skipLogicClause = @skipLogicClause

      if (!viewCreated)
        view = new XLF.SkipLogicView(relevantDetailView: @, model: @skipLogicClause)
        viewCreated = true

      view.render(@$el)

    viewUtils.makeEditable @, @model, 'code', {}

