Announcement

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

    setMinWidth and setWidth100 does not work together

    I want a widget that resizes to the size of the screen (using setWidth100), but cannot be smaller than 1000 using setMinWidth(1000). It doesn't seem to work how I want it to though. It ignores the setMinWidth and just resizes regardless.

    Is there any other way I can achieve what I want?

    #2
    Howdy, I'm trying to achieve a similar effect. Have you had any luck?

    What I'm trying to do is much like the showcase's sample fullscreen application. A Window is used to contain everything and is maximised to fit the browser's space, but if the browser (and hence Window) is resized past a certain point the Window stops getting smaller forcing the browser's scroll bars to show instead.

    Comment


      #3
      Hi, Have you solved that problem.. i am also facing similar issue in my app.... i.e. i have set setwidth100().. but i need to maintain min width for all layout so i set setminwidth but its not working what shall i do ?

      Comment


        #4
        Add one more requester to the list. I also spent hours today trying to achieve this, but in vain. Good to know that I'm not the only one having this problem.

        Surprisingly, there's no simple solution to such a common requirement.

        Comment


          #5
          Post Code....

          Comment


            #6
            Same Issue here also, I hope that Isomorphic answer us on this issue.

            Comment


              #7
              how can i use setMinWidth , with setwidth100() Or "*" ??????

              Comment


                #8
                Hi All
                We've made this change in the 3.0 branch (will be present in nightly builds in that branch going forward). If a percentage width is specified that would shrink below a specified minWidth, the minWidth will now be respected.

                Regards
                Isomorphic Software

                Comment


                  #9
                  Thanks for fast reply ,
                  i would like to ask , after this changes can i use this to achieve minimum resolution , so i will set Width to 100% or "*" to the application (page) and setMinWidth(1000) and this will show the scrolllbar when the the width of the page is less than 1000 ?

                  just like this thread http://forums.smartclient.com/showthread.php?t=19214



                  thanks in advance !

                  Comment


                    #10
                    If you have a component with width specified via 'setWidth100()', and minWidth specified via "setMinWidth(1000)", the widget will be sized to the width of the page, unless the page is < 1000 px wide, in which case the widget will size to 1000px wide.
                    Native page level scrollbars would be introduced unless they were suppressed in the HTML via style="overflow:hidden" on your body tag or similar.

                    Comment


                      #11
                      Thanks , very mach for fast response ,

                      its now working very well and the scrollbars now appear as i want , but i need more info about the 3.0 branch build what is the big differences between it and 2.5 build , should i make some changes to my application to make it consistent with 3.0 build ? is it save to move from 2.5 to 3.0 ? .


                      Thanks in advice .

                      Comment


                        #12
                        This issue still appears on FF 5.0

                        Comment


                          #13
                          Has this been resolved? Using the current version of SmartGWT 3.0 GA, ie., -->

                          SmartClient Version: SC_SNAPSHOT-2011-12-05/PowerEdition Deployment (built 2011-12-05)
                          Browser: Mozilla Firefox 4.0.1

                          we still save this problem in Mozilla Firefox 4, Chrome 17.0.963.56 m, and IE 8 under the following conditions:

                          1) we use a HLAyout
                          2) we add components to it
                          3) we add teh HLaout to a VLayout.

                          Code is as below:

                          Code:
                          public class HlIAHeader extends HLayout {
                          
                          	/**
                          	 * 
                          	 */
                          	public HlIAHeader() {
                          		// TODO Auto-generated constructor stub
                          		this.setHeight("2%");
                          		this.setMinWidth(1600);
                          		this.setWidth("100%");
                          	this.setBackgroundColor("yellow");
                          		//this.setWidth(3000);
                          		//this.setOverflow(Overflow.AUTO);
                          	this.setOverflow(Overflow.VISIBLE);
                          
                          		final  Img imgLogo = new Img("ia_logo_48.png", 119, 75);
                          		this.addMember(imgLogo);
                          
                          		final  Label lblWelcomeMsg = new Label("<b>(v7.23)</b>");
                          		//final  Label lblWelcomeMsg = new Label("<b>Welcome back, Dr. Smith. </b>");
                          		//lblWelcomeMsg.setWidth("150");
                          		lblWelcomeMsg.setWidth("450");
                          		lblWelcomeMsg.setHeight("40");
                          		lblWelcomeMsg.setLayoutAlign(VerticalAlignment.TOP);
                          
                          		final Img imgLogOut = new Img("icons/LogOut.png",32,32);  
                          		//imgLogOut.linkHTML("href=\"<spring:url value=\"/j_spring_security_logout\" htmlEscape=\"true\" />\">Logout\"");
                          		//imgLogOut.linkHTML("\"<spring:url value=\"/j_spring_security_logout\" htmlEscape=\"true\"");
                          		imgLogOut.addClickHandler(new ClickHandler() {
                          			
                          			@Override
                          			public void onClick(ClickEvent event) {
                          				System.out.println("Logging out");
                          				Window.Location.assign("/BuiltInDS/j_spring_security_logout");	
                          			}
                          		});
                          		
                          
                          
                          		LayoutSpacer layoutSpacer = new LayoutSpacer();
                          		this.addMember(layoutSpacer);
                          		this.addMember(lblWelcomeMsg);
                          		this.addMember(imgLogOut);
                          	       
                          	}
                          and

                          Code:
                          	final VLayout vlRoot = new VLayout();
                          
                          				vlRoot.setLeft("0%");
                          				vlRoot.setTop("0%");
                          				vlRoot.setWidth("100%");
                          				vlRoot.setHeight("100%");
                          				//vlRoot.setWidth(3000);
                          				//vlRoot.setHeight(3000);
                          				vlRoot.setMembersMargin(5);
                          				vlRoot.setLayoutTopMargin(10);
                          				vlRoot.setLayoutBottomMargin(5);
                          				vlRoot.setLayoutLeftMargin(10);
                          				vlRoot.setLayoutRightMargin(10);
                          				vlRoot.setOverflow(Overflow.VISIBLE);
                          				vlRoot.setBackgroundImage("bkg.jpg");
                          				vlRoot.setStyleName("ia_bkg_img");
                          				vlRoot.setOverflow(Overflow.VISIBLE);
                          				//vlRoot.setsr
                          				// vStack.setBackgroundColor("#B0C4DE");
                          
                          				final HLayout hlIAHeader = new HlIAHeader();
                          				vlRoot.addMember(hlIAHeader);
                          Our current thought is to workaround the problem by setting min widths in the members of the HLayout and then to add a layoutspacer. This seems to work, but is this the right approach? Presumably, this is a bug in the "setminwidth" method?

                          Comment

                          Working...
                          X