Search in sources :

Example 16 with HtmlDataTable

use of javax.faces.component.html.HtmlDataTable in project TNTConcept by autentia.

the class PublicationBean method letterClicked.

/**
 * Handle an ABC pager letter click: filter objects by specified starting letter
 */
public void letterClicked() {
    if (letter != null) {
        UIComponent comp = FacesUtils.getComponent("publications:list");
        HtmlDataTable tabla = (HtmlDataTable) comp;
        tabla.setFirst(0);
        search.setName(letter + "%");
    } else {
        search.unsetName();
    }
}
Also used : HtmlDataTable(javax.faces.component.html.HtmlDataTable) UIComponent(javax.faces.component.UIComponent)

Example 17 with HtmlDataTable

use of javax.faces.component.html.HtmlDataTable in project TNTConcept by autentia.

the class TutorialBean method letterClicked.

/**
 * Handle an ABC pager letter click: filter objects by specified starting letter
 */
public void letterClicked() {
    if (letter != null) {
        UIComponent comp = FacesUtils.getComponent("tutorials:list");
        HtmlDataTable tabla = (HtmlDataTable) comp;
        tabla.setFirst(0);
        search.setName(letter + "%");
    } else {
        search.unsetName();
    }
}
Also used : HtmlDataTable(javax.faces.component.html.HtmlDataTable) UIComponent(javax.faces.component.UIComponent)

Example 18 with HtmlDataTable

use of javax.faces.component.html.HtmlDataTable in project TNTConcept by autentia.

the class FinancialRatioBean method letterClicked.

/**
 * Handle an ABC pager letter click: filter objects by specified starting letter
 */
public void letterClicked() {
    if (letter != null) {
        UIComponent comp = FacesUtils.getComponent("financialRatios:list");
        HtmlDataTable tabla = (HtmlDataTable) comp;
        tabla.setFirst(0);
        search.setTitle(letter + "%");
    } else {
        search.unsetTitle();
    }
}
Also used : HtmlDataTable(javax.faces.component.html.HtmlDataTable) UIComponent(javax.faces.component.UIComponent)

Example 19 with HtmlDataTable

use of javax.faces.component.html.HtmlDataTable in project liferay-faces-alloy by liferay.

the class ColumnRenderer method encodeBegin.

@Override
public void encodeBegin(FacesContext facesContext, UIComponent uiComponent) throws IOException {
    ResponseWriter responseWriter = facesContext.getResponseWriter();
    UIComponent parent = uiComponent.getParent();
    if (!((parent instanceof HtmlDataTable) || (parent instanceof HtmlPanelGrid))) {
        responseWriter.startElement("div", uiComponent);
        String clientId = uiComponent.getClientId(facesContext);
        responseWriter.writeAttribute("id", clientId, null);
        Column column = (Column) uiComponent;
        StringBuilder classNames = new StringBuilder();
        String size = column.getSize();
        size = getColumnCSSClassSize(size);
        Integer span = column.getSpan();
        if (span != null) {
            if ((span < 1) || (span > Column.COLUMNS)) {
                throw new IOException("span number must be between 1 and " + Column.COLUMNS);
            }
        }
        Integer width = column.getWidth();
        if (width != null) {
            if ((width < 1) || (width > 100)) {
                throw new IOException("width must be between 1 and 100");
            }
            span = getColumnUnitSize(width);
        }
        classNames.append("col-");
        classNames.append(size);
        classNames.append("-");
        classNames.append(span);
        Integer offset = column.getOffset();
        if (offset != null) {
            if ((offset < 1) || (offset > Column.COLUMNS)) {
                throw new IOException("offset must be between 1 and " + Column.COLUMNS);
            }
        }
        Integer offsetWidth = column.getOffsetWidth();
        if (offsetWidth != null) {
            if ((offsetWidth < 1) || (offsetWidth > 100)) {
                throw new IOException("offsetWidth must be between 1 and 100");
            }
            offset = getColumnUnitSize(offsetWidth);
        }
        if (offset != null) {
            classNames.append(" ");
            classNames.append("col-");
            classNames.append(size);
            classNames.append("-offset-");
            classNames.append(offset);
        }
        RendererUtil.encodeStyleable(responseWriter, column, classNames.toString());
    }
}
Also used : HtmlDataTable(javax.faces.component.html.HtmlDataTable) ResponseWriter(javax.faces.context.ResponseWriter) Column(com.liferay.faces.alloy.component.column.Column) UIComponent(javax.faces.component.UIComponent) HtmlPanelGrid(javax.faces.component.html.HtmlPanelGrid) IOException(java.io.IOException)

Example 20 with HtmlDataTable

use of javax.faces.component.html.HtmlDataTable in project gdmatrix by gdmatrix.

the class AgendaBean method nextEvents.

// ACTIONS
/**
 * Loads <code>eventsTable</code> and <code>eventTypes</code> with data.
 * Could be invoked in first request from menu or coming back from an event
 * description view.
 * In this second case, <code>currentFirstPage</code> is asigned to
 * <code>eventsTable</code><code>first</code> property to recover current
 * page of the scroller.
 *
 * @return outcome to the agenda (event list) view
 */
public String nextEvents() {
    Map requestParameters = getExternalContext().getRequestParameterMap();
    String eventId = (String) requestParameters.get("eventid");
    if (eventId != null) {
        try {
            currentEvent = loadEvent(eventId);
            eventPlaces = findEventPlaces();
            eventDocuments = findEventDocuments();
            return "goEvent";
        } catch (Exception ex) {
            ex.printStackTrace();
            getExternalContext().log(ex.getMessage());
        }
    } else {
        // Component constructions
        eventsTable = new HtmlDataTable();
        eventsTable.setValue(find());
        if (currentFirstPage != 0)
            eventsTable.setFirst(currentFirstPage);
        eventTypes = new UISelectItems();
    // eventTypes.setValue(findEventTypes());
    }
    return "agenda";
}
Also used : HtmlDataTable(javax.faces.component.html.HtmlDataTable) UISelectItems(javax.faces.component.UISelectItems) Map(java.util.Map) FileTypeMap(javax.activation.FileTypeMap) MimeTypeMap(org.santfeliu.util.MimeTypeMap)

Aggregations

HtmlDataTable (javax.faces.component.html.HtmlDataTable)35 UIComponent (javax.faces.component.UIComponent)33 HtmlPanelGrid (javax.faces.component.html.HtmlPanelGrid)2 ResponseWriter (javax.faces.context.ResponseWriter)2 Column (com.liferay.faces.alloy.component.column.Column)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1 FileTypeMap (javax.activation.FileTypeMap)1 UISelectItems (javax.faces.component.UISelectItems)1 MimeTypeMap (org.santfeliu.util.MimeTypeMap)1