code: private void changeEntityValue(String value, int valueIndex) {
  
          if (getEntityType().isChoice()) {
              CmsEntity choice = m_entity.getAttribute(CmsType.CHOICE_ATTRIBUTE_NAME).getComplexValues().get(valueIndex);
              String attributeName = getChoiceName(valueIndex);
              if (attributeName != null) {
                  choice.setAttributeValue(attributeName, value, 0);
              }
          } else {
              m_entity.setAttributeValue(m_attributeName, value, valueIndex);
          }
      }
docs: Changes the attribute value.<p>
  
  @param valueIndex the attribute value index
  @param value the value