listbox not updating on the fly. refresh issue? - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

listbox not updating on the fly. refresh issue?

Last post 09-28-2005 08:48 AM by Agni Jonnalagadda. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 09-22-2005 08:07 AM

    listbox not updating on the fly. refresh issue?

    I am trying to set up my listbox control to add data entries from a textbox using an add button. The data is getting added as a new node under my listbox control, but isn't showing up in the listbox.


    <InfoPathEventHandler(MatchPath:="CTRL20_5", EventType:=InfoPathEventType.OnClick)> _
    Public Sub CTRL20_5_OnClick(ByVal e As DocActionEvent)
    Dim new_claim As IXMLDOMNode, claims_list As IXMLDOMNode
    claims_list = thisXDocument.DOM.selectSingleNode("//my:Claims_Listbox")
    'clone previous entry in listbox for formatting purposes
    new_claim = claims_list.lastChild.cloneNode(True)
    'update new node text with textbox text
    new_claim.text = thisXDocument.DOM.selectSingleNode("//my:Claim_Description").text()
    'update new node value with textbox text
    new_claim.nodeValue = thisXDocument.DOM.selectSingleNode("//my:Claim_Description").text()
    'remove text from textbox
    thisXDocument.DOM.selectSingleNode("//my:Claim_Description").text() = ""
    'append listbox with new child
    claims_list.appendChild(new_claim)
    'verify that number of children increases by 1 with each entry
    MsgBox(claims_list.childNodes.length)
    'verify that lastchild text is in fact the text that was just entered in the textbox before adding
    MsgBox(claims_list.lastChild.text)
    End Sub


    It appears that the children are getting added correctly, is there something else I need to do to get the listbox to display these additions? (obviously there is)
  • 09-28-2005 08:48 AM In reply to

    Re: listbox not updating on the fly. refresh issue?

    Hi jeremyj,
    Welcome to the Forum!
    Did you bind your list box to "my:Claims_Listbox" to select one of the values or did you bind it to "my:Claims_Listbox" to save the selected value?
    You need to add the value to the XML which the listbox is binded to select the values.

    Agni
    InfoPath Dev India
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.