def get_display(self):
    from tactic.ui.widget import ActionButtonWdg
    top = self.top
    mode = 'checkbox'
    titles = self.get_option('options')
    actual_titles = []
    if titles:
        titles = titles.split('|')
        actual_titles = self.get_option('titles')
        if actual_titles:
            actual_titles = actual_titles.split('|')
            if (len(actual_titles) != len(titles)):
                raise TacticException('titles count have to match the options count in the Checkbox Filter Element in Simple Search.')
        else:
            actual_titles = titles[:]
    else:
        titles = []
    table = Table()
    table.add_color('color', 'color')
    top.add(table)
    table.add_row()
    if (mode == 'button'):
        text = HiddenWdg('button')
        top.add(text)
        text.add_class('spt_text')
        for title in titles:
            button = ActionButtonWdg(title=title)
            table.add_cell(button)
            button.add_behavior({'type': 'click_up', 'title': title, 'cbjs_action': self.get_set_js_action()})
    else:
        for (i, title) in enumerate(titles):
            td = table.add_cell()
            if (i != 0):
                div = DivWdg()
                div.add_style('float: left')
                td.add(div)
                div.add_style('height: 30px')
                div.add_style('border-style: solid')
                div.add_style('border-width: 0px 1px 0px 0px')
                div.add_style('margin-right: 15px')
                div.add_style(('border-color: %s' % div.get_color('border')))
            button_title = ('button_%s' % title)
            checkbox = CheckboxWdg(button_title)
            td.add(checkbox)
            actual_title = actual_titles[i]
            td.add(actual_title)
            if self.values.get(button_title):
                checkbox.set_checked()
    return top
def get_display(self):
    from tactic.ui.widget import ActionButtonWdg
    top = self.top
    mode = 'checkbox'
    titles = self.get_option('options')
    actual_titles = []
    if titles:
        titles = titles.split('|')
        actual_titles = self.get_option('titles')
        if actual_titles:
            actual_titles = actual_titles.split('|')
            if (len(actual_titles) != len(titles)):
                raise TacticException('titles count have to match the options count in the Checkbox Filter Element in Simple Search.')
        else:
            actual_titles = titles[:]
    else:
        titles = []
    table = Table()
    table.add_color('color', 'color')
    top.add(table)
    table.add_row()
    if (mode == 'button'):
        text = HiddenWdg('button')
        top.add(text)
        text.add_class('spt_text')
        for title in titles:
            button = ActionButtonWdg(title=title)
            table.add_cell(button)
            button.add_behavior({'type': 'click_up', 'title': title, 'cbjs_action': self.get_set_js_action()})
    else:
        for (i, title) in enumerate(titles):
            td = table.add_cell()
            if (i != 0):
                div = DivWdg()
                div.add_style('float: left')
                td.add(div)
                div.add_style('height: 30px')
                div.add_style('border-style: solid')
                div.add_style('border-width: 0px 1px 0px 0px')
                div.add_style('margin-right: 15px')
                div.add_style(('border-color: %s' % div.get_color('border')))
            button_title = ('button_%s' % title)
            checkbox = CheckboxWdg(button_title)
            td.add(checkbox)
            actual_title = actual_titles[i]
            td.add(actual_title)
            if self.values.get(button_title):
                checkbox.set_checked()
    return top