Wednesday 15 September 2010

flex - MXML: combobox width is larger than parent width -


I have a width blank box set to 100% However, when one of its elements is larger, Equally grows, making scrollbars and other ugly in my app! How do I keep the combobox within my parents?
NB, that's fine if the list that falls below becomes bigger when the closed cubbocox is small.

Sample:

   & Lt ;! - This text box should be spread in both forms, this is why it is in a separate HBox - & gt; & Lt; Mx: text input height = "20" width = "100%" /> & Lt; / Mx: hbox & gt; & Lt; Mx: HBox id = "formsHbox" x = "8" y = "{8 + tagsHBox.height}" width = "{this.width-16}" & gt; & Lt; Mx: form id = "left form" width = "50%" & gt; & Lt ;! - Personal details - & gt; & Lt; Mx: formhiding label = "personal details" width = "100%" /> & Lt; Mx: formystem label = "first name" width = "100%" & gt; & Lt; Mx: text input text = "{person first name}" width = "100%" /> & Lt; / Mx: FormItem & gt; & Lt; Mx: form item label = "last name" width = "100%" & gt; & Lt; Mx: text input text = "{person.lest name}" width = "100%" /> & Lt; / Mx: FormItem & gt; & Lt ;! - and 15 additional form items :) - & gt; & Lt; / Mx: form & gt; & Lt; Mx: form id = "correct" width = "50%" & gt; & Lt ;! - address - & gt; & Lt; Mx: form heading label = "address" width = "100%" /> & Lt; Mx: formitium label = "street" width = "100%" & gt; & Lt; Mx: text input text = "{person.address.street}" width = "100%" /> & Lt; / Mx: FormItem & gt; & Lt; Mx: formystem label = "city" width = "100%" & gt; & Lt; Mx: text input text = "{person.address.city}" width = "100%" /> & Lt; / Mx: FormItem & gt; & Lt; Mx: formystem label = "country" width = "100%" & gt; & Lt ;! - This Cambodia is painful here, 'South Georgia and the South Sandwich Islands' is a country that has names of some small islands of the South Pacific and is a name that is too long for my innocent unheard boxed box - & gt; & Lt; Form: Combo box ID = "CountryCompono" height = "20" width = "100%" Detector = "{model.cethodDataModel.countries}" /> & Lt; / Mx: FormItem & gt; & Lt ;! - and 15 additional form items :) - & gt; & Lt; / Mx: form & gt; & Lt; / Mx: hbox & gt; & Lt; / Mx: canvas & gt;  

You may be able to use the minwidth instead. Set it to zero or any other less value I know that it works with containers like HBOX and Vbox to stop growing your parent's container larger, so it can also work with the combo box. . Basically, what happens is that Minwath = "0" overrides the measured minwd, which is a value that the parent container generally considers as the minimum possible size, and it can be larger than its container limit.


No comments:

Post a Comment