Package org.apache.click

Examples of org.apache.click.Context


    // Event Handlers ---------------------------------------------------------

    @Override
    public void onInit() {
        super.onInit();
        Context context = getContext();

        // Restore form and table state from the session
        form.restoreState(context);
        table.restoreState(context);
View Full Code Here


        // Clear table state
        table.setPageNumber(0);
        table.setSortedColumn(null);

        // Remove table and form state from the session
        Context context = getContext();
        form.removeState(context);
        table.removeState(context);
        return true;
    }
View Full Code Here

            // Include the prototype.js library which is made available under
            // the web folder "/click/prototype/"
            headElements.add(new JsImport("/click/prototype/prototype.js"));

            Context context = getContext();

            // Create a model to pass to the Page JavaScript template. The
            // template recognizes the following Velocity variables:
            // $context, $path, $selector and $target
            Map<String, Object> jsModel = ClickUtils.createTemplateModel(this, context);
View Full Code Here

            // Include the prototype.js library which is made available under
            // the web folder "/click/prototype/"
            headElements.add(new JsImport("/click/prototype/prototype.js"));

            Context context = getContext();

            // Create a model to pass to the Page JavaScript template. The
            // template recognizes the following Velocity variables:
            // $context, $path, $selector and $target
            Map<String, Object> model = ClickUtils.createTemplateModel(this, context);
View Full Code Here

     * Return the current Client instance in the session.
     *
     * @return the current Client instance in the session
     */
    public static Client getClientFromSession() {
        Context context = Context.getThreadLocalContext();
        Client client = (Client) context.getSessionAttribute(CLIENT_ATTR);
        return client;

    }
View Full Code Here

     * Save the Client instance in the session.
     *
     * @param client the client to store in the session
     */
    public static void saveClientInSession(Client client) {
        Context context = Context.getThreadLocalContext();
        context.setSessionAttribute(CLIENT_ATTR, client);
    }
View Full Code Here

    /**
     * Remove the currently stored Client instance from the session.
     */
    public static void removeClientFromSession() {
        Context context = Context.getThreadLocalContext();
        context.removeSessionAttribute(CLIENT_ATTR);
    }
View Full Code Here

        Context context = Context.getThreadLocalContext();
        context.removeSessionAttribute(CLIENT_ATTR);
    }

    public static void saveActiveStepIndex(int index) {
        Context context = Context.getThreadLocalContext();
        context.setSessionAttribute(STEP_INDEX, index);
    }
View Full Code Here

        Context context = Context.getThreadLocalContext();
        context.setSessionAttribute(STEP_INDEX, index);
    }

    public static int restoreActiveStepIndex() {
        Context context = Context.getThreadLocalContext();
        Object value = context.getSessionAttribute(STEP_INDEX);
        int index = value == null ? 0 : (Integer) value;
        return index;
    }
View Full Code Here

     * the Session ID if required.
     *
     * @return the form "action" attribute URL value.
     */
    public String getActionURL() {
        Context context = getContext();
        HttpServletResponse response = context.getResponse();
        if (actionURL == null) {
            HttpServletRequest request = context.getRequest();
            return response.encodeURL(ClickUtils.getRequestURI(request));

        } else {
            return response.encodeURL(actionURL);
        }
View Full Code Here

TOP

Related Classes of org.apache.click.Context

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.