Results 1 to 4 of 4

Thread: [CLOSED] El.setStyleAttribute(String, Object) causes strange behaviour

  1. #1

    Default [CLOSED] El.setStyleAttribute(String, Object) causes strange behaviour

    I used El.setStyleAttribute("left", 123) to position Components and get strange behaviour in Firefox. In certain circumstances the attribute was not set. The Error was only in Firefox not in IE.

    After a lot of debuggin and tryin if found the components are always placed correct when using El.setStyleAttribute("left", "123")

    Why is the method overloaded? (El.El.setStyleAttribute(String, Object), El.El.setStyleAttribute(String, String))

    I suggest to declare El.setStyleAttribute(String, Object) deprecated.

  2. #2
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976

    Default

    123 what? "123px" for example would be correct.

  3. #3

    Default

    Thanks for the reply.

    Why is the method overloaded? (El.setStyleAttribute(String, Object), El.setStyleAttribute(String, String))

    Is there any reason to use El.setStyleAttribute(String, Object) instead of El.setStyleAttribute(String, String)

  4. #4

    Red face Text Align

    I need to set the Text Align....But can't...I have highligthed it up in the Red Colour...Pls help me ...I have to use the ...

    Code:
    ---------
    TextField<String> text = new TextField<String>();
    text.setStyleAttribute("textAlign", "right");
    ---------

    Real Coding :

    package com.extjs.gxt.samples.client;

    import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
    import com.extjs.gxt.ui.client.widget.LayoutContainer;
    import com.extjs.gxt.ui.client.widget.TabItem;
    import com.extjs.gxt.ui.client.widget.TabPanel;
    import com.extjs.gxt.ui.client.widget.VerticalPanel;
    import com.extjs.gxt.ui.client.widget.button.Button;
    import com.extjs.gxt.ui.client.widget.form.DateField;
    import com.extjs.gxt.ui.client.widget.form.FieldSet;
    import com.extjs.gxt.ui.client.widget.form.FormPanel;
    import com.extjs.gxt.ui.client.widget.form.TextField;
    import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
    import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
    import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
    //import com.extjs.gxt.ui.client.widget.layout.FormData;
    import com.extjs.gxt.ui.client.widget.layout.FormLayout;
    import com.google.gwt.user.client.Element;
    import com.extjs.gxt.ui.client.widget.layout.ColumnData;

    publicclass PolluxSystemDesign extends LayoutContainer {

    private VerticalPanel vp;

    public PolluxSystemDesign() {
    vp = new VerticalPanel();
    vp.setSpacing(10);
    }

    @Override
    protectedvoid onRender(Element parent, int index) {
    super.onRender(parent, index);
    createForm2 ();
    add(vp);
    }

    privatevoid createForm2() {

    //FormData formData = new FormData("100%");
    FormPanel form2 = new FormPanel();
    form2.setFrame(true);
    TabItem personal = new TabItem ();
    personal.setText("Household Details");
    form2.setWidth(1000);
    form2.setLayout(new FlowLayout());
    FieldSet fieldSet = new FieldSet();
    FormLayout layout = new FormLayout();
    layout.setLabelWidth(75);
    fieldSet.setLayout(layout);

    LayoutContainer main = new LayoutContainer();
    main.setLayout(new ColumnLayout());

    LayoutContainer left = new LayoutContainer();

    layout.setLabelAlign(LabelAlign.TOP);
    left.setLayout(layout);

    TabPanel folder = new TabPanel();
    folder.setWidth(1000);
    folder.setAutoHeight(true);

    fieldSet.setHeading("Household Information");
    fieldSet.setCollapsible(true);

    TextField<String> surname = new TextField<String>();
    surname.setFieldLabel("Surname");
    left.add(surname);
    fieldSet.add(surname);

    TextField<String> status = new TextField<String>();
    status.setFieldLabel("Status");
    left.add(status);
    fieldSet.add(status);

    TextField<String> socialgrade = new TextField<String>();
    socialgrade.setFieldLabel("Social Grade");
    left.add(socialgrade);
    fieldSet.add(socialgrade);

    LayoutContainer right = new LayoutContainer();

    layout = new FormLayout();
    layout.setLabelAlign(LabelAlign.TOP);
    right.setLayout(layout);

    TextField<String> secondaryaddress = new TextField<String>();
    secondaryaddress.setFieldLabel("Secondary Address");
    right.add(secondaryaddress);
    fieldSet.add(secondaryaddress);

    TextField<String> subarea = new TextField<String>();
    subarea.setFieldLabel("Subarea");
    right.add(subarea);
    fieldSet.add(subarea);

    main.add(left, new ColumnData(.5));
    main.add(right, new ColumnData(.5));
    form2.add(main);

    personal.add(fieldSet);
    folder.add(personal);

    FieldSet fieldSet1 = new FieldSet();
    FormLayout layout1 = new FormLayout();
    layout1.setLabelWidth(75);
    fieldSet1.setLayout(layout1);

    fieldSet1.setHeading("Primary Address");
    fieldSet1.setCollapsible(true);

    TextField<String> address = new TextField<String>();
    address.setFieldLabel("Address");
    fieldSet1.add(address);

    TextField<String> number = new TextField<String>();
    number.setFieldLabel("Number");
    fieldSet1.add(number);

    TextField<String> floor = new TextField<String>();
    floor.setFieldLabel("Floor");
    fieldSet1.add(floor);

    TextField<String> map = new TextField<String>();
    map.setFieldLabel("Map");
    fieldSet1.add(map);

    TextField<String> postcode = new TextField<String>();
    postcode.setFieldLabel("Post Code");
    fieldSet1.add(postcode);

    TextField<String> country = new TextField<String>();
    country.setFieldLabel("Country");
    fieldSet1.add(country);

    TextField<String> admin = new TextField<String>();
    admin.setFieldLabel("Admin District Code");
    fieldSet1.add(admin);

    TextField<String> city = new TextField<String>();
    city.setFieldLabel("City Size");
    fieldSet1.add(city);

    TextField<String> latitude = new TextField<String>();
    latitude.setFieldLabel("Latitude");
    fieldSet1.add(latitude);

    TextField<String> longitude = new TextField<String>();
    longitude.setFieldLabel("Longitude");
    fieldSet1.add(longitude);

    personal.add(fieldSet1);
    folder.add(personal);

    FieldSet fieldSet11 = new FieldSet();
    FormLayout layout11 = new FormLayout();
    layout11.setLabelWidth(75);
    fieldSet1.setLayout(layout11);

    fieldSet11 = new FieldSet();
    fieldSet11.setHeading("Secondary Address");
    fieldSet11.setCollapsible(true);

    personal.add(fieldSet11);
    folder.add(personal);

    FieldSet fieldSet111 = new FieldSet();
    FormLayout layout111 = new FormLayout();
    layout111.setLabelWidth(75);
    fieldSet111.setLayout(layout111);

    fieldSet111.setHeading("Phone Numbers");
    fieldSet111.setCollapsible(true);

    TextField<String> phone = new TextField<String>();
    phone.setFieldLabel("Phone");
    fieldSet111.add(phone);

    TextField<String> coutesyphone = new TextField<String>();
    coutesyphone.setFieldLabel("Courtesy Phone");
    fieldSet111.add(coutesyphone);

    TextField<String> phoneownership = new TextField<String>();
    phoneownership.setFieldLabel("Phone Ownership");
    fieldSet111.add(phoneownership);

    personal.add(fieldSet111);
    folder.add(personal);

    FieldSet fieldSet1111 = new FieldSet();
    FormLayout layout1111 = new FormLayout();
    layout1111.setLabelWidth(75);
    fieldSet1111.setLayout(layout1111);

    fieldSet1111.setHeading("Installation Date");
    fieldSet1111.setCollapsible(true);

    DateField loaddate = new DateField();
    loaddate.setFieldLabel("Load Date");
    fieldSet1111.add(loaddate);

    DateField installdate = new DateField();
    installdate.setFieldLabel("Installation Date");
    fieldSet1111.add(installdate);

    DateField disinstalldate = new DateField();
    disinstalldate.setFieldLabel("Disinstallation Date");
    fieldSet1111.add(disinstalldate);

    personal.add(fieldSet1111);
    folder.add(personal);

    FieldSet fieldSet11111 = new FieldSet();
    FormLayout layout11111 = new FormLayout();
    layout11111.setLabelWidth(75);
    fieldSet11111.setLayout(layout11111);

    fieldSet11111.setHeading("Meter Data");
    fieldSet11111.setCollapsible(true);

    TextField<String> meterserial = new TextField<String>();
    meterserial.setFieldLabel("Meter Serial Number");
    fieldSet11111.add(meterserial);

    TextField<String> mainshopper = new TextField<String>();
    mainshopper.setFieldLabel("Main Shopper");
    fieldSet11111.add(mainshopper);

    TextField<String> technician = new TextField<String>();
    technician.setFieldLabel("Technician");
    fieldSet11111.add(technician);

    TextField<String> technicianarea = new TextField<String>();
    technicianarea.setFieldLabel("Technician Area");
    fieldSet11111.add(technicianarea);

    TextField<String> numbertv = new TextField<String>();
    numbertv.setFieldLabel("Number of TV Sets");
    fieldSet11111.add(numbertv);

    TextField<String> numbermeters = new TextField<String>();
    numbermeters.setFieldLabel("Number of Meters TV Sets");
    fieldSet11111.add(numbermeters);

    TextField<String> numberVCR = new TextField<String>();
    numberVCR.setFieldLabel("Number of VCRs");
    fieldSet11111.add(numberVCR);

    personal.add(fieldSet11111);
    folder.add(personal);

    FieldSet fieldSet111111 = new FieldSet();
    FormLayout layout111111 = new FormLayout();
    layout111111.setLabelWidth(75);
    fieldSet111111.setLayout(layout111111);

    fieldSet111111 = new FieldSet();
    fieldSet111111.setHeading("Individuals");
    fieldSet111111.setCollapsible(true);

    TabItem numbers = new TabItem();
    numbers.setText("Individual Information");
    fieldSet.setLayout(new FormLayout());

    numbers.add(fieldSet111111);
    folder.add(numbers);

    FieldSet fieldSet1111111 = new FieldSet();
    FormLayout layout1111111 = new FormLayout();
    layout1111111.setLabelWidth(75);
    fieldSet1111111.setLayout(layout1111111);

    fieldSet1111111.setHeading("Individual Informations");
    fieldSet1111111.setCollapsible(true);

    TextField<String> id = new TextField<String>();
    id.setFieldLabel("ID");
    fieldSet1111111.add(id);

    TextField<String> ButtonNumber = new TextField<String>();
    ButtonNumber.setFieldLabel("Button Number");
    fieldSet1111111.add(ButtonNumber);

    TextField<String> Name = new TextField<String>();
    Name.setFieldLabel("Name");
    fieldSet1111111.add(Name);

    DateField birthdate = new DateField();
    birthdate.setFieldLabel("Birth Date");
    fieldSet1111111.add(birthdate);

    TextField<String> age = new TextField<String>();
    age.setFieldLabel("Age");
    fieldSet1111111.add(age);

    TextField<String> relationship = new TextField<String>();
    relationship.setFieldLabel("Relationship");
    fieldSet1111111.add(relationship);

    TextField<String> sex = new TextField<String>();
    sex.setFieldLabel("Sex");
    fieldSet1111111.add(sex);

    TextField<String> profession = new TextField<String>();
    profession.setFieldLabel("Profession");
    fieldSet1111111.add(profession);

    TextField<String> education = new TextField<String>();
    education.setFieldLabel("Education");
    fieldSet1111111.add(education);

    TextField<String> Lifestyle = new TextField<String>();
    Lifestyle.setFieldLabel("Life Style");
    fieldSet1111111.add(Lifestyle);

    TextField<String> status1 = new TextField<String>();
    status1.setFieldLabel("Status");
    fieldSet1111111.add(status1);

    TextField<String> maritalstatus = new TextField<String>();
    maritalstatus.setFieldLabel("Marital Status");
    fieldSet1111111.add(maritalstatus );

    TextField<String> custom1 = new TextField<String>();
    custom1.setFieldLabel("Custom 1");
    fieldSet1111111.add(custom1);

    TextField<String> custom2 = new TextField<String>();
    custom2.setFieldLabel("Custom 2");
    fieldSet1111111.add(custom2);

    TextField<String> custom3 = new TextField<String>();
    custom3.setFieldLabel("Custom 3");
    fieldSet1111111.add(custom3);

    TextField<String> custom4 = new TextField<String>();
    custom4.setFieldLabel("Custom 4");
    fieldSet1111111.add(custom4);

    TextField<String> custom5 = new TextField<String>();
    custom5.setFieldLabel("Custom 5");
    fieldSet1111111.add(custom5);

    TextField<String> custom6 = new TextField<String>();
    custom6.setFieldLabel("Custom 6");
    fieldSet1111111.add(custom6);

    TextField<String> custom7 = new TextField<String>();
    custom7.setFieldLabel("Custom 7");
    fieldSet1111111.add(custom7);

    TextField<String> custom8 = new TextField<String>();
    custom8.setFieldLabel("Custom 8");
    fieldSet1111111.add(custom8);

    TextField<String> extra1 = new TextField<String>();
    extra1.setFieldLabel("Extra 1");
    fieldSet1111111.add(extra1);

    TextField<String> extra2 = new TextField<String>();
    extra2.setFieldLabel("Extra 2");
    fieldSet1111111.add(extra2);

    TextField<String> extra3 = new TextField<String>();
    extra3.setFieldLabel("Extra 3");
    fieldSet1111111.add(extra3);

    TextField<String> extra4 = new TextField<String>();
    extra4.setFieldLabel("Extra 4");
    fieldSet1111111.add(extra4);

    TextField<String> extra5 = new TextField<String>();
    extra5.setFieldLabel("Extra 5");
    fieldSet1111111.add(extra5);

    TextField<String> extra6 = new TextField<String>();
    extra6.setFieldLabel("Extra 6");
    fieldSet1111111.add(extra6);

    TextField<String> extra7 = new TextField<String>();
    extra7.setFieldLabel("Extra 7");
    fieldSet1111111.add(extra7);

    TextField<String> extra8 = new TextField<String>();
    extra8.setFieldLabel("Extra 8");
    fieldSet1111111.add(extra8);

    TextField<String> extra9 = new TextField<String>();
    extra9.setFieldLabel("Extra 9");
    fieldSet1111111.add(extra9);

    TextField<String> extra10 = new TextField<String>();
    extra10.setFieldLabel("Extra 10");
    fieldSet1111111.add(extra10);

    TextField<String> extra11 = new TextField<String>();
    extra11.setFieldLabel("Extra 11");
    fieldSet1111111.add(extra11);

    numbers.add(fieldSet1111111);
    folder.add(numbers);

    FieldSet fieldSet11111111 = new FieldSet();
    FormLayout layout11111111 = new FormLayout();
    layout11111111.setLabelWidth(75);
    fieldSet11111111.setLayout(layout11111111);

    fieldSet11111111.setHeading("Eurisko Information");
    fieldSet11111111.setCollapsible(true);

    TextField<String> Cluster = new TextField<String>();
    Cluster.setFieldLabel("Cluster");
    fieldSet11111111.add(Cluster);

    TextField<String> cell = new TextField<String>();
    cell.setFieldLabel("Cell");
    fieldSet11111111.add(cell);

    TextField<String> x = new TextField<String>();
    x.setFieldLabel("X");
    fieldSet11111111.add(x);

    TextField<String> y = new TextField<String>();
    y.setFieldLabel("Y");
    fieldSet11111111.add(y);

    DateField birthdate1 = new DateField();
    birthdate1.setFieldLabel("Birth Date");
    fieldSet11111111.add(birthdate1);

    TextField<String> situation = new TextField<String>();
    situation.setFieldLabel("Situation");
    fieldSet11111111.add(situation);

    TextField<String> srm = new TextField<String>();
    srm.setFieldLabel("SRM");
    fieldSet11111111.add(srm);

    numbers.add(fieldSet11111111);
    folder.add(numbers);

    form2.add(folder);
    form2.setButtonAlign(HorizontalAlignment.CENTER);
    form2.addButton(new Button("Save"));
    form2.addButton(new Button("Reload"));


    add(vp);
    vp.add(folder);
    vp.add(form2);

    }


    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •