List view does not refresh probably

List view does not refresh probably

Hi,
I create multiple buttons for list view rows as the following:
<ul data-role="listview">
  <li id='li-1'>
        <h2>title</h2>
        <p>test text</p>
        <p class='ui-li-aside' id='p-def-1'>aside text</p>

        <div position='relative' align='right' data-role='controlgroup' data-type='horizontal'>
            <a href='#' data-role='button' data-icon='gear'>change</a>
            <a href='#' data-role='button' data-icon='delete'>delete</a>
            <a href='#' data-role='button' data-icon='check' id='btn-def-1' data-addr-id='1' onclick='btn_def_click(event);'>set default</a>
        </div>

    </li>
</ul>
The three buttons can be shown when this is a static page. but if I generate the rows dynamically  and refresh the listview manually, the listview itself can show probably, but not the three buttons. Can you help pointing out what's problem is.