Announcement

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

    FormItem invisible to visible error.

    Hello,

    I have a dynamic shape and form items.

    The positive items have to be invisible when the form is opened.
    That's why I put the values ​​of form items to invisible

    After the push of a button, all fields are displayed.
    That is why I set the values ​​for the button to visible.

    But I always get the following error message.

    "
    com.smartgwt.client.core.JsObject$SGWT_WARN: 12:39:36.947:TMR6[E]:WARN:HTMLPane:isc_HTMLPane_1:This widget has overflow specified as "clip_h". This overflow setting is not supported - defaulting to overflow:"visible".
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)"


    What does this mean?
    How to bring the fields of state is not displayed to displayed ?

    #2
    Code:
    Window w = new Window();
    		
    		final DynamicForm f = new DynamicForm();
    		List<FormItem> fields = new ArrayList<FormItem>();
    		for (int i = 0; i < 10; i++)
    		{
    			FormItem item = new TextItem();
    			fields.add(item);
    			if(i%2==0)
    				item.setVisible(false);
    		}
    		f.setFields(fields.toArray(new FormItem[fields.size()]));
    		
    		w.addItem(f);
    		
                    IButton b = new IButton("sd");
    		b.setTitle("Visible/Invisible");
    		b.addClickHandler(new ClickHandler()
    		{
    			
    			private Boolean	isVisible = true;
    
    			@Override
    			public void onClick(ClickEvent event)
    			{
    				FormItem[] fieldsArray = f.getFields();
    				for (FormItem formItem : fieldsArray)
    				{
    					
    					formItem.setVisible(isVisible);
    					isVisible = !isVisible;					
    				}
    				f.redraw();
    				System.out.println(isVisible);
    				
    			}
    		});
    		w.addItem(b);
    		
    		w.show();

    Comment

    Working...
    X