2 Replies Latest reply on Oct 26, 2010 4:15 PM by Devtron

    Programmatically setting the width of a component to 100%

    JoshBeall Level 1

      Hi All,


      I've got a view in my app where the user specifies one or more people who will be "instructors".  There is a dropdownlist that lets them indicate how many instructors there are.  Then, for each instructor, there is a component that is displayed that allows them to enter the required information for that instructor.


      I'm planning to set it up so that it adds/removes the "instructor" components as necessary, so that the number of instructor components matches the number they selected from the "number of instructors" dropdownlist.


      I want to set the width of the component to 100%.  But I'm not sure how do to that.  Here's my code:'


      var ic:InstructorInfo = new InstructorInfo();
      ic.width = "100%"; // This causes a compile error--can't convert a String to a Number


      The problem is that the width property is of type "Number" and wants an explicit pixel value.  But I don't want to give it an explicit value, I want it to be sized to 100%.  How can I do that?