Skip to content

Instantly share code, notes, and snippets.

@uklance
Created June 28, 2013 07:34
Show Gist options
  • Save uklance/5883104 to your computer and use it in GitHub Desktop.
Save uklance/5883104 to your computer and use it in GitHub Desktop.
@Property
private Country country;
@Property
private City city;
public Country[] getCountries() {
return new Country[] { ... };
}
public List<City> getNonEmptyCities() {
if (country.getCities().isEmpty()) {
return Collections.singletonList(new City(null));
}
return country.getCities();
}
public List<Street> getNonEmptyStreets() {
if (city.getStreets().isEmpty()) {
return Collections.singletonList(new Street(null, 0)
}
return city.getStreets();
}
}
<t:grid source="countries" row="country" add="cities" t:mixins="stitch/GridCollapse" collapseColumn="cities">
<p:citiesCell>
<t:grid source="nonEmptyCities" row="city" add="streets" t:mixins="stitch/GridCollapse,stitch/DisableSort" collapseColumn="streets">
<p:streetsCell>
<t:grid source="nonEmptyStreets" t:mixins="stitch/DisableSort" />
</p:streetsCell>
</t:grid>
</p:citiesCell>
</t:grid>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment