assignViewIdIfNeeded