java - Is there a way to get the captions in Vaadin to appear on the left side without using FormLayout? -
is there way captions in vaadin appear on left side without using formlayout
? bolded because i'm trying avoid being first answer. understand formlayout
offers ability in cases need use gridlayout
able have 2 columns of data (for example firstname , lastname, start date , end date, , on).
there no easy way it, because every layout generates appropriate space components inside them. can change order of caption , corresponding component inside "box" generated layout using simple css rules hard dynamically determine size of box - thats layouts do. demonstrate in following image:
as can see, able swap order of caption , textfield using css:
#your-id .v-caption { position: relative !important; top: 10px !important; } #your-id .your-component { top: 0px !important; left: 0px !important; position: absolute !important; }
and code
gridlayout l = new gridlayout(2,2); l.addstylename("your-id"); for(int i=0; i<4; i++){ textfield qq = new textfield(); qq.setcaption("dududu"); qq.addstylename("your-component"); l.addcomponent(qq); }
(i've applied these rules in firefox css editor 1 slot has changed) possible because didin't have change size of v-gridlayout-slot
. size dynamically generated vaadin , can't tell vaadin "generate me slot textfield , caption , want caption on left/right side".
Comments
Post a Comment