Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    FormItem title-width issue in DynamicForms

    Hi Isomorphic,

    please see this testcase:


    Setup:
    Browser: Google Chrome Version 70.0.3538.110 (64-Bit) (set to Responsive)
    SmartClient Version: v12.0p_2018-12-06/PowerEdition Deployment (built 2018-12-06)


    Code:
    package com.smartgwt.sample.client;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.smartgwt.client.core.KeyIdentifier;
    import com.smartgwt.client.types.ReadOnlyDisplayAppearance;
    import com.smartgwt.client.util.Page;
    import com.smartgwt.client.util.PageKeyHandler;
    import com.smartgwt.client.util.SC;
    import com.smartgwt.client.widgets.form.DynamicForm;
    import com.smartgwt.client.widgets.form.fields.ComboBoxItem;
    import com.smartgwt.client.widgets.form.fields.TextAreaItem;
    import com.smartgwt.client.widgets.layout.VLayout;
    
    /**
     * Entry point classes define <code>onModuleLoad()</code>.
     */
    public class BuiltInDS implements EntryPoint {
    
        /**
         * This is the entry point method.
         */
        public void onModuleLoad() {
            KeyIdentifier debugKey = new KeyIdentifier();
            debugKey.setCtrlKey(true);
            debugKey.setKeyName("D");
    
            Page.registerKey(debugKey, new PageKeyHandler() {
                public void execute(String keyName) {
                    SC.showConsole();
                }
            });
    
            VLayout v = new VLayout();
            v.setWidth(300);
            v.setHeight100();
    
            ComboBoxItem cB = new ComboBoxItem();
            cB.setValue("ComboBoxItemValue");
            cB.setTitle("LonggggggggggggggggggggggggggoBoxItemTitle");
    
            DynamicForm dF = new DynamicForm();
            dF.setWidth(300);
            dF.setMaxWidth(300);
            dF.setClipStaticValue(false);
            dF.setColWidths("100", "*");
            dF.setNumCols(2);
            dF.setIsGroup(true);
            dF.setCanEdit(false);
            dF.setReadOnlyDisplay(ReadOnlyDisplayAppearance.STATIC);
            dF.setGroupBorderCSS("1px solid black");
            dF.setFields(cB);
    
            TextAreaItem ti = new TextAreaItem();
            ti.setTitle("TextItemTitle");
            ti.setValue("TextItemValue");
    
            DynamicForm dF2 = new DynamicForm();
            dF2.setClipStaticValue(true);
            dF2.setWidth(300);
            dF2.setColWidths("100", "*");
           dF.setNumCols(2);
            dF2.setIsGroup(true);
            dF2.setCanEdit(false);
            dF2.setReadOnlyDisplay(ReadOnlyDisplayAppearance.STATIC);
            dF2.setGroupBorderCSS("1px solid black");
            dF2.setFields(ti);
    
            v.addMember(dF);
            v.addMember(dF2);
            v.draw();
        }
    }
    I want to have both DynamicForms to have the exact same width, no matter how long the title of an item is. Is there an alternative to setWrapItemTitles? We have titles, that are very long and so the DynamicForm exceeds its width. WrapItemTitles is not appropriate in this case, because its just one word that cant be wrapped. Is there something that makes "LonggggggggggggggggggggggggggBoxItemTitle :" to something like "Longgggg..:" ? Like in the NavigationBar sample "Title Auto-Fit", if the title exceeds its width?

    Thanks in Advance

    Kind Regards

    #2
    Are you already aware of dynamicForm.clipItemTitles / formItem.clipTitle?

    Comment


      #3
      Thanks a lot, that was exactly what I was looking for!

      Comment

      Working...
      X