[Bug #1260] Improved horizontal scaling of assigned materials

Material listboxes now expand gracefully, giving the unused space to code and category
labels. When the grid is empty, however, the headers don't occupy all the space. A perfect
solution would cover also this case.

FEA: ItEr75S04BugFixing
This commit is contained in:
Lorenzo Tilve Álvaro 2011-11-16 15:39:50 +01:00
parent 32c5554981
commit 5c074529f3
2 changed files with 14 additions and 17 deletions

View file

@ -20,24 +20,22 @@
-->
<newdatasortablegrid id="gridMaterials"
fixedLayout="false"
model="@{assignedMaterialsController.assignedMaterials}" >
<columns>
<newdatasortablecolumn label="${i18n:_('Code')}" />
sizedByContent="true"
model="@{assignedMaterialsController.assignedMaterials}">
<columns width="100%">
<newdatasortablecolumn label="${i18n:_('Code')}" hflex="1" />
<newdatasortablecolumn label="${i18n:_('Receipt date')}" />
<newdatasortablecolumn label="${i18n:_('Units')}" />
<newdatasortablecolumn label="${i18n:_('Unit type')}" />
<newdatasortablecolumn label="${i18n:_('Unit price')}" />
<newdatasortablecolumn label="${i18n:_('Total price')}" />
<newdatasortablecolumn label="${i18n:_('Category')}" />
<newdatasortablecolumn label="${i18n:_('Category')}" hflex="1"/>
<newdatasortablecolumn label="${i18n:_('Status')}" />
<newdatasortablecolumn label="${i18n:_('Op.')}" />
</columns>
<rows>
<row self="@{each='assignedMaterial'}" value="@{assignedMaterial}">
<textbox value="@{assignedMaterial.material.code}"
constraint="no empty:${i18n:_('cannot be null or empty')}"
readonly="true" />
<label value="@{assignedMaterial.material.code}" hflex="true" />
<datebox value="@{assignedMaterial.estimatedAvailability}" />
<doublebox value="@{assignedMaterial.units}"
onChange="assignedMaterialsController.updateTotalPrice(self.parent)" />
@ -48,7 +46,7 @@
<doublebox value="@{assignedMaterial.unitPrice}"
onChange="assignedMaterialsController.updateTotalPrice(self.parent)" />
<doublebox value="@{assignedMaterial.totalPrice}" disabled="${true}"/>
<label value="@{assignedMaterial.material.category.name}" width="150px" />
<label value="@{assignedMaterial.material.category.name}" />
<listbox mold="select" model="@{materialStatus}"
selectedItem="@{assignedMaterial.status}"
itemRenderer="org.libreplan.web.common.EnumsListitemRenderer" />

View file

@ -74,15 +74,14 @@
<tabpanel>
<!-- Material search -->
<hbox hflex="min">
<hbox width="100%" hflex="1">
<!-- Categories -->
<vbox>
<vbox hflex="1">
<panel title="${i18n:_('Categories')}" border="normal">
<panelchildren>
<toolbarbutton style="text-decoration: none" label="${i18n:_('Unselect')}"
onClick="assignedMaterialsController.clearSelectionAllCategoriesTree()" />
<tree id="allCategoriesTree"
width="280px" rows="10" vflex="true" multiple="false">
<tree id="allCategoriesTree" rows="10" vflex="true" multiple="false">
<treecols>
<treecol label="Name" />
</treecols>
@ -91,7 +90,7 @@
</panel>
</vbox>
<vbox hflex="min">
<vbox hflex="1">
<!-- Found materials -->
<panel title="${i18n:_('Materials')}" border="normal">
@ -111,10 +110,10 @@
<listbox id="lbFoundMaterials"
multiple="true"
sizedByContent="true"
model="@{assignedMaterialsController.matchingMaterials}">
<listhead sizable="true">
model="@{assignedMaterialsController.matchingMaterials}" >
<listhead sizable="true" >
<listheader label="${i18n:_('Code')}" />
<listheader label="${i18n:_('Name')}" />
<listheader label="${i18n:_('Name')}" hflex="1"/>
<listheader label="${i18n:_('Unit type')}" />
<listheader label="${i18n:_('Unit price')}" />
<listheader label="${i18n:_('Category')}" />