Vroom Framework - Some Useful JavaScript Functions

Some Useful JavaScript Functions

Following are the list of JavaScript functions which can be used with vroom-config.xml file, while writing script type calls:

  • VroomUtils.triggerEvent(elemId, event); // This method can be used to trigger events of an element. E.g. VroomUtils.triggerEvent('btnSubmit', 'onclick');
  • VroomUtils.populateSelect(elemId, jsonString); // This method is used to populated Select from JSON string, the JSON string must be array of net.openkoncept.vroom.bean.LabelValueBean object.
  • VroomUtils.populateSelect(elemId, jsonString, labelVar, valueVar); // The method is similar to the above method except jsonString can be array of any Java Bean, the labelVar and valueVar are the java * bean properties.
  • VroomUtils.generateRadioGroup(elemId, name, jsonString, cols, styleClass); // This method is used to generate a radio group. The cols is used to specify the no. of radio buttons in one line. The styleClass is CSS class to decorate the radio buttons. The jsonString must be array of net.openkoncept.vroom.bean.LabelValueBean.
  • VroomUtils.generateRadioGroupEx(elemId, name, jsonString, labelVar, valueVar, cols, styleClass); // This method is similar to the above method except jsonString can be array of any Java Bean, the labelVar and valueVar are the java bean properties.
  • VroomUtils.generateCheckBoxGroup(elemId, name, jsonString, cols, styleClass); // This method is used to generate check box group. The cols is used to specify the no. of radio buttons in one line. The styleClass is CSS class to decorate the radio buttons. The jsonString must be array of net.openkoncept.vroom.bean.LabelValueBean.
  • VroomUtils.generateCheckBoxGroupEx(elemId, name, jsonString, labelVar, valueVar, cols, styleClass); // This method is similar to the above method except jsonString can be array of any Java Bean, the labelVar and valueVar are the java bean properties.
  • VroomUtils.getElement(elemIdOrName); // This method finds the element by name. If the element is not found, it finds it by id.
  • VroomUtils.getElementByTagName(tagName); // This method is used to return on the first element of the array of elements of the specified tag name.
  • VroomUtils.getElementsByTagName(tagName); // This method returns array of elements of specified tag name.
  • JSON.parse(jsonString); // This method takes a jsonString and returns the JSON object.

Read more about this topic:  Vroom Framework

Famous quotes containing the word functions:

    One of the most highly valued functions of used parents these days is to be the villains of their children’s lives, the people the child blames for any shortcomings or disappointments. But if your identity comes from your parents’ failings, then you remain forever a member of the child generation, stuck and unable to move on to an adulthood in which you identify yourself in terms of what you do, not what has been done to you.
    Frank Pittman (20th century)