List of usage examples for com.google.gwt.dom.client LIElement getAttribute
@Override
public String getAttribute(String name)
From source file:com.horaz.client.widgets.ListView.java
License:Open Source License
/** * get the model behind a LI-Element. The li element must have to attribute data-modelid. * @param el//from w ww . jav a 2 s . co m * @return model or null * @throws IllegalArgumentException if data-modelid is not set */ public T getModel(LIElement el) { if (el.getAttribute("data-modelid") == null) { throw new IllegalStateException("LI Element needs the attribute data-modelid"); } int id = Integer.valueOf(el.getAttribute("data-modelid")); return modelsCache.get((long) id); }