'Update the user\'s sequential position given the context and the
number_of_display_items'

def _update_position(self, context, number_of_display_items):

    if (context.get('requested_child') == 'first'):
        self.position = 1
    elif (context.get('requested_child') == 'last'):
        self.position = (number_of_display_items or 1)
    elif ((self.position is None) or (self.position > number_of_display_items)):
        self.position = 1
