Help creating buttons with actions

I am looking for a way to program buttons with actions and conditional outputs. As an example: After populating a set number of cells, I would like to be able to program a button to copy the contents of those cellsto another set of cells. Also, a button programmed to clear the contents of the cellswould be nice.
anyone?

Buttons are typically associated to macros (VBA or other). As Numbers 1.0 does not support any macros, I am afraid that you are out of look.
To copy values is very simple with formulas of course (=a1 and so on), but you probably know that, and need something more powerful.

Similar Messages

  • Custom button with action listener - will not invoke action listener

    Hi
    For whatever reason, I cannot find a concise example of a simple custom component that can invoke an action listener. The tutorials I've read so far either ignore this fundamental topic or only make the slightest make reference to it.
    The best I have come up with - in terms of a simple prototype is below... but, the action listener is never invoked.... Can someone tell me what I am missing (full code below). Hopefully, what is missing or incorrect will be obvious to you JSF experts out there.
    Thanks for any help!!
    -f
    tld
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
    <taglib>
      <tlib-version>0.01</tlib-version>
      <jsp-version>1.2</jsp-version>
      <short-name>jsfcustomcomponent</short-name>
      <uri>http://jsfcustomcomponent/</uri>
      <description><![CDATA[jsf custom component tags]]>  </description>
      <tag>
        <name>specialBtnTag</name>
        <tag-class>jsfcustomcomponent.SpecialBtnTag</tag-class>
        <attribute>
          <name>value</name>
          <required>true</required>
          <rtexprvalue>true</rtexprvalue>
          <description><![CDATA[button value]]></description>
        </attribute>
        <attribute>
          <name>actionListener</name>
          <required>true</required>
          <rtexprvalue>true</rtexprvalue>
          <description><![CDATA[action listener]]> </description>
        </attribute>
      </tag>
    </taglib>
    SpecialBtnComponent
    package jsfcustomcomponent;
    import javax.faces.component.*;
    import javax.faces.context.*;
    import javax.faces.el.*;
    import javax.faces.event.*;
    public class SpecialBtnComponent
        extends UIComponentBase implements ActionSource
        public static final String COMPONENT_TYPE = "SpecialBtnComponent";
        public static final String RENDERER_TYPE = "SpecialBtnRenderer";
        public String getFamily()
            return COMPONENT_TYPE;
        public SpecialBtnComponent()
            super();
            setRendererType(SpecialBtnComponent.RENDERER_TYPE);
        private String value;
        public void setValue(String value, FacesContext facesContext)
            this.value = value;
        public String getValue()
            if (null != value)
                return value;
            ValueBinding _vb = getValueBinding("value");
            if (_vb != null)
                return (String) _vb.getValue(getFacesContext());
            else
                return null;
        private MethodBinding action = null;
        public MethodBinding getAction()
            return action;
        public void setAction(MethodBinding methodBinding)
            this.action = action;
        private MethodBinding actionListener = null;
        public MethodBinding getActionListener()
            return (this.actionListener);
        public void setActionListener(MethodBinding methodBinding)
            this.actionListener = actionListener;
        public boolean isImmediate()
            return false;
        public void setImmediate(boolean _boolean)
            //this.immediate = immediate;
        public void addActionListener(ActionListener actionListener)
            addFacesListener(actionListener);
        public ActionListener[] getActionListeners()
            return (ActionListener[]) getFacesListeners(ActionListener.class);
        public void removeActionListener(ActionListener actionListener)
            removeFacesListener(actionListener);
        public Object saveState(FacesContext context)
            Object values[] = new Object[5];
            values[0] = super.saveState(context);
            values[1] = value;
            values[2] = saveAttachedState(context, action);
            values[3] = saveAttachedState(context, actionListener);
            return ( (Object) (values));
        public void restoreState(FacesContext context, Object state)
            Object values[] = (Object[]) state;
            super.restoreState(context, values[0]);
            value = (String) values[1];
            action = (MethodBinding) restoreAttachedState(context, values[2]);
            actionListener = (MethodBinding) restoreAttachedState(context, values[3]);
        public void broadcast(FacesEvent event) throws AbortProcessingException
            super.broadcast(event);
            if (event instanceof ActionEvent)
                FacesContext context = getFacesContext();
                MethodBinding mb = getActionListener();
                if (mb != null)
                    mb.invoke(context, new Object[]
                              {event});
                ActionListener listener = context.getApplication().getActionListener();
                if (listener != null)
                    listener.processAction( (ActionEvent) event);
        public void queueEvent(FacesEvent e)
            if (e instanceof ActionEvent)
                if (isImmediate())
                    e.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
                else
                    e.setPhaseId(PhaseId.INVOKE_APPLICATION);
            super.queueEvent(e);
    SpecialBtnRenderer
    package jsfcustomcomponent;
    import java.util.*;
    import javax.faces.component.*;
    import javax.faces.context.*;
    import javax.faces.event.*;
    import javax.faces.render.*;
    public class SpecialBtnRenderer
        extends Renderer
        String value;
        public SpecialBtnRenderer()
        public void decode(FacesContext context, UIComponent component)
            Map requestMap = context.getExternalContext().getRequestParameterMap();
            String clientId = component.getClientId(context);
            SpecialBtnComponent specialBtnComponent = (SpecialBtnComponent) component;
            String value = (String) requestMap.get(clientId);
            if (null != value)
                specialBtnComponent.setValue(value, context);
            ActionEvent actionEvent = new ActionEvent(specialBtnComponent);
            specialBtnComponent.queueEvent(actionEvent);
        public void encodeEnd(FacesContext context, UIComponent component) throws java.io.IOException
            SpecialBtnComponent specialBtnComponent = (SpecialBtnComponent) component;
            ResponseWriter writer = context.getResponseWriter();
            String clientId = component.getClientId(context);
            value = (String) component.getAttributes().get("value");
            if (value == null)
                value = "defaultValue";
            buildSpecialBtn(writer, value, clientId, specialBtnComponent);
        private void buildSpecialBtn(ResponseWriter writer, String value, String clientId, SpecialBtnComponent component) throws java.io.IOException
            writer.startElement("table", component);
            writer.startElement("tbody", component);
            writer.startElement("tr", component);
            writer.startElement("td", component);
            value = String.valueOf(value);
            writer.startElement("input", component);
            writer.writeAttribute("type", "submit", null);
            writer.writeAttribute("name", clientId, "clientId");
            writer.writeAttribute("value", value, null);
            writer.endElement("input");
            writer.endElement("td");
            writer.endElement("tr");
            writer.endElement("tbody");
            writer.endElement("table");
    SpecialBtnTag
    package jsfcustomcomponent;
    import javax.faces.component.*;
    import javax.faces.el.*;
    import javax.faces.webapp.*;
    import com.sun.faces.util.*;
    public class SpecialBtnTag
        extends UIComponentTag
        public String value = null;
        public String actionListener = null;
        public String getComponentType()
            return SpecialBtnComponent.COMPONENT_TYPE;
        public String getRendererType()
            return SpecialBtnComponent.RENDERER_TYPE;
        protected void setProperties(UIComponent component)
            super.setProperties(component);
            if (! (component instanceof SpecialBtnComponent))
                throw new IllegalStateException("Component " + component.toString() +
                                                " not expected type.  Expected: jsfcustomcomponent.SpecialBtnComponent.  Perhaps you�re missing a tag?");
            SpecialBtnComponent specialBtnComponent = (SpecialBtnComponent) component;
            if (value != null)
                if (isValueReference(value))
                    ValueBinding vb = Util.getValueBinding(value);
                    specialBtnComponent.setValueBinding("value", vb);
                else
                    throw new IllegalStateException("The value for �value� must be a ValueBinding.");
            if (actionListener != null)
                if (isValueReference(actionListener))
                    ValueBinding vb = Util.getValueBinding(actionListener);
                    specialBtnComponent.setValueBinding("actionListener", vb);
                else
                    throw new IllegalStateException("The value for �actionListener� must be a ValueBinding.");
        public void release()
            super.release();
            value = null;
            actionListener = null;
        public void setValue(String value)
            this.value = value;
        public String getValue()
            return this.value;
        public void setActionListener(String actionListener)
            this.actionListener = actionListener;
        public String getActionListener()
            return this.actionListener;
    jsp1.jsp
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@taglib uri="http://jsfcustomcomponent/" prefix="j"%>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
    <link rel="stylesheet" type="text/css" href="./stylesheet.css" title="Style">
    </head>
    <body>
    <f:view>
      <h:form id="form01">
        <h:outputText value="test special button with action listener"/>
        <j:specialBtnTag value="#{specialBtnBacking.specialBtnValue}" actionListener="#{specialBtnBacking.specialBtnActionListener}"/>
        <h:messages/>
        <h:outputText value="#{specialBtnBacking.outcome}"/>
      </h:form>
    </f:view>
    </body>
    </html>
    SpecialBtnBacking
    package specialbtn;
    import javax.faces.context.*;
    import javax.faces.event.*;
    public class SpecialBtnBacking
        private FacesContext context;
        public SpecialBtnBacking()
            this.setSpecialBtnValue("Special Button with action listener");
        private String specialBtnValue;
        public String getSpecialBtnValue()
            return this.specialBtnValue;
        public void setSpecialBtnValue(String specialBtnValue)
            this.specialBtnValue = specialBtnValue;
        private String outcome="actionlistener NOT invoked: click specialBtn above to test";
        public String getOutcome()
            return outcome;
        public void setOutcome(String outcome)
            this.outcome = outcome;
        public void specialBtnActionListener(ActionEvent evt)
            System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Jsp1Backing/specialBtnActionListener()!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
            this.outcome="***action listener invoked!!!***";
    faces-config.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config>
      <managed-bean>
        <managed-bean-name>specialBtnBacking</managed-bean-name>
        <managed-bean-class>specialbtn.SpecialBtnBacking</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
      </managed-bean>
      <component>
        <component-type>SpecialBtnComponent</component-type>
        <component-class>jsfcustomcomponent.SpecialBtnComponent</component-class>
        <component-extension>
          <renderer-type>SpecialBtnRenderer</renderer-type>
        </component-extension>
      </component>
      <render-kit>
        <renderer>
          <component-family>SpecialBtnComponent</component-family>
          <renderer-type>SpecialBtnRenderer</renderer-type>
          <renderer-class>jsfcustomcomponent.SpecialBtnRenderer</renderer-class>
        </renderer>
      </render-kit>
    </faces-config>
    web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
      <display-name>pagerWEB</display-name>
      <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
      </servlet>
      <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.faces</url-pattern>
      </servlet-mapping>
      <jsp-config>
        <taglib>
          <taglib-uri>http://jsfcustomcomponent/</taglib-uri>
          <taglib-location>/WEB-INF/jsfcustomcomponent.tld</taglib-location>
        </taglib>
      </jsp-config>
      <servlet>
        <description>Added by JBuilder to compile JSPs with debug info</description>
        <servlet-name>debugjsp</servlet-name>
        <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
        <init-param>
          <param-name>classdebuginfo</param-name>
          <param-value>true</param-value>
        </init-param>
        <load-on-startup>3</load-on-startup>
      </servlet>
      <servlet-mapping>
        <servlet-name>debugjsp</servlet-name>
        <url-pattern>*.jsp</url-pattern>
      </servlet-mapping>
    </web-app>

    got it working....
    The changes were:
    in "SpecialBtnRenderer"...
    --new--
                        mb.invoke(context, new Object[1]);
    --old--
                        mb.invoke(context, new Object[0]);
    in "SpecialBtnTag"...
    --new--
    import javax.faces.event.ActionEvent;
    --new--
                    MethodBinding mb = FacesContext.getCurrentInstance().getApplication().createMethodBinding(specialBtnListener, new Class[]{ActionEvent.class});
    --old--
                    MethodBinding mb = FacesContext.getCurrentInstance().getApplication().createMethodBinding(specialBtnListener, null);
    -Below is the entire application, again -- for those (like myself) who need concrete examples...
    I hope this helps someone else! --f
    jsp1.jsp
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@taglib uri="http://jsfcustomcomponent/" prefix="j"%>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
    <link rel="stylesheet" type="text/css" href="./stylesheet.css" title="Style">
    </head>
    <body>
    <f:view>
        <h:messages/>
      <h:form id="form01">
        <h:outputText value="test special button with action listener"/>
        <j:specialBtnTag value="#{specialBtnBacking.specialBtnValue}" specialBtnListener="#{specialBtnBacking.specialBtnActionListener}"/>
        <h:outputText value="#{specialBtnBacking.outcome}"/>
      </h:form>
    </f:view>
    </body>
    </html>
    SpecialBtnBacking
    package specialbtn;
    import javax.faces.context.*;
    import javax.faces.event.*;
    public class SpecialBtnBacking
        private FacesContext context;
        public SpecialBtnBacking()
            this.setSpecialBtnValue("Special Button with action listener");
        private String specialBtnValue;
        public String getSpecialBtnValue()
            return this.specialBtnValue;
        public void setSpecialBtnValue(String specialBtnValue)
            this.specialBtnValue = specialBtnValue;
        private String outcome = "actionlistener NOT invoked: click specialBtn above to test";
        public String getOutcome()
            return outcome;
        public void setOutcome(String outcome)
            this.outcome = outcome;
        public void specialBtnActionListener(ActionEvent evt)
            System.out.println("\n\n");
            System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Jsp1Backing/specialBtnActionListener()!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
            System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Jsp1Backing/specialBtnActionListener()!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
            System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Jsp1Backing/specialBtnActionListener()!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
            System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Jsp1Backing/specialBtnActionListener()!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
            System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Jsp1Backing/specialBtnActionListener()!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n");
            this.outcome = "***action listener invoked!!!***";
    jsfcustomcomponent.tld
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
    <taglib>
      <tlib-version>0.01</tlib-version>
      <jsp-version>1.2</jsp-version>
      <short-name>jsfcustomcomponent</short-name>
      <uri>http://jsfcustomcomponent/</uri>
      <description><![CDATA[jsf custom component tags]]>  </description>
      <tag>
        <name>specialBtnTag</name>
        <tag-class>jsfcustomcomponent.SpecialBtnTag</tag-class>
        <attribute>
          <name>value</name>
          <required>true</required>
          <rtexprvalue>true</rtexprvalue>
          <description><![CDATA[button value]]></description>
        </attribute>
        <attribute>
          <name>specialBtnListener</name>
          <required>true</required>
          <rtexprvalue>true</rtexprvalue>
          <description><![CDATA[action listener]]> </description>
        </attribute>
      </tag>
    </taglib>
    faces-config.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config>
      <managed-bean>
        <managed-bean-name>specialBtnBacking</managed-bean-name>
        <managed-bean-class>specialbtn.SpecialBtnBacking</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
      </managed-bean>
      <component>
        <component-type>SpecialBtnComponent</component-type>
        <component-class>jsfcustomcomponent.SpecialBtnComponent</component-class>
        <component-extension>
          <renderer-type>SpecialBtnRenderer</renderer-type>
        </component-extension>
      </component>
      <render-kit>
        <renderer>
          <component-family>SpecialBtnComponent</component-family>
          <renderer-type>SpecialBtnRenderer</renderer-type>
          <renderer-class>jsfcustomcomponent.SpecialBtnRenderer</renderer-class>
        </renderer>
      </render-kit>
    </faces-config>
    SpecialBtnComponent.java
    package jsfcustomcomponent;
    import javax.faces.component.*;
    import javax.faces.context.*;
    import javax.faces.el.*;
    import javax.faces.event.*;
    public class SpecialBtnComponent
        extends UIComponentBase implements ActionSource
        public static final String COMPONENT_TYPE = "SpecialBtnComponent";
        public static final String RENDERER_TYPE = "SpecialBtnRenderer";
        public String getFamily()
            return COMPONENT_TYPE;
        public SpecialBtnComponent()
            super();
            setRendererType(SpecialBtnComponent.RENDERER_TYPE);
        private String value;
        public void setValue(String value, FacesContext facesContext)
            this.value = value;
        public String getValue()
            if (null != this.value)
                return this.value;
            ValueBinding _vb = getValueBinding("value");
            if (_vb != null)
                return (String) _vb.getValue(getFacesContext());
            else
                return null;
        private MethodBinding specialBtnListener = null;
        public MethodBinding getActionListener()
            return (this.specialBtnListener);
        public void setActionListener(MethodBinding actionListener)
            this.specialBtnListener = actionListener;
        public Object saveState(FacesContext context)
            Object values[] = new Object[3];
            values[0] = super.saveState(context);
            values[1] = saveAttachedState(context, this.specialBtnListener);
            values[2] = this.value;
            return (values);
        public void restoreState(FacesContext context, Object state)
            Object values[] = (Object[]) state;
            super.restoreState(context, values[0]);
            this.specialBtnListener = (MethodBinding) restoreAttachedState(context, values[1]);
            this.value = (String) restoreAttachedState(context, values[2]);
        public void broadcast(FacesEvent event) throws AbortProcessingException
            super.broadcast(event);
            if (event instanceof ActionEvent)
                FacesContext context = getFacesContext();
                MethodBinding mb = this.getActionListener();
                if (mb != null)
                    try
                        mb.invoke(context, new Object[]
                                  {event});
                    catch (EvaluationException ex)
                        System.out.println("SpecialBtnComponent/broadcast(FacesEvent event)...EvaluationException encountered - ex.getMessage()=" + ex.getMessage());
                        ex.printStackTrace();
                ActionListener actionListener = context.getApplication().getActionListener();
                if (actionListener != null)
                    actionListener.processAction( (ActionEvent) event);
        public void queueEvent(FacesEvent e)
            if (e instanceof ActionEvent)
                e.setPhaseId(PhaseId.INVOKE_APPLICATION);
            super.queueEvent(e);
        public MethodBinding getAction()
            return null;
        public void setAction(MethodBinding methodBinding)
        public boolean isImmediate()
            return false;
        public void setImmediate(boolean _boolean)
        public void addActionListener(ActionListener actionListener)
            addFacesListener(actionListener);
        public ActionListener[] getActionListeners()
            return (ActionListener[]) getFacesListeners(ActionListener.class);
        public void removeActionListener(ActionListener actionListener)
            removeFacesListener(actionListener);
    SpecialBtnTag.java
    package jsfcustomcomponent;
    import javax.faces.component.*;
    import javax.faces.el.*;
    import javax.faces.webapp.*;
    import com.sun.faces.util.*;
    import javax.faces.context.FacesContext;
    import javax.faces.event.ActionEvent;
    public class SpecialBtnTag
        extends UIComponentTag
        public String value = null;
        public String specialBtnListener = null;
        private SpecialBtnComponent specialBtnComponent;
        public SpecialBtnTag()
            super();
        public String getComponentType()
            return SpecialBtnComponent.COMPONENT_TYPE;
        public String getRendererType()
            return SpecialBtnComponent.RENDERER_TYPE;
        protected void setProperties(UIComponent component)
            super.setProperties(component);
            if (! (component instanceof SpecialBtnComponent))
                throw new IllegalStateException("Component " + component.toString() +
                                                " not expected type.  Expected: jsfcustomcomponent.SpecialBtnComponent.  Perhaps you�re missing a tag?");
            specialBtnComponent = (SpecialBtnComponent) component;
            if (value != null)
                if (isValueReference(value))
                    ValueBinding vb = Util.getValueBinding(value);
                    specialBtnComponent.setValueBinding("value", vb);
                else
                    throw new IllegalStateException("The value for �value� must be a ValueBinding.");
            if (specialBtnListener != null)
                if (isValueReference(specialBtnListener))
                    MethodBinding mb = FacesContext.getCurrentInstance().getApplication().createMethodBinding(specialBtnListener, new Class[]{ActionEvent.class});
                    ( (SpecialBtnComponent) component).setActionListener(mb);
                else
                    MethodBinding mb = Util.createConstantMethodBinding(specialBtnListener);
                    ( (SpecialBtnComponent) component).setActionListener(mb);
        public void release()
            super.release();
            value = null;
            specialBtnListener = null;
        public void setValue(String value)
            this.value = value;
        public String getValue()
            return this.value;
        public void setSpecialBtnListener(String specialBtnListener)
            this.specialBtnListener = specialBtnListener;
        public String getSpecialBtnListener()
            return this.specialBtnListener;
    SpecialBtnRenderer
    package jsfcustomcomponent;
    import java.util.*;
    import javax.faces.component.*;
    import javax.faces.context.*;
    import javax.faces.event.*;
    import javax.faces.render.*;
    import javax.faces.el.MethodBinding;
    import javax.faces.el.*;
    public class SpecialBtnRenderer
        extends Renderer
        String value;
        public SpecialBtnRenderer()
            super();
        public void decode(FacesContext context, UIComponent component)
            try
                Map requestMap = context.getExternalContext().getRequestParameterMap();
                String clientId = component.getClientId(context);
                SpecialBtnComponent specialBtnComponent = (SpecialBtnComponent) component;
                String value = (String) requestMap.get(clientId);
                if (null != value)
                    specialBtnComponent.setValue(value, context);
                    MethodBinding mb = specialBtnComponent.getActionListener();
                    if (mb != null)
                        System.out.println("SpecialBtnRenderer/decode...mb.getExpressionString()=" + mb.getExpressionString());
                        //mb.invoke(context, new Object[0]);
                        mb.invoke(context, new Object[1]);
                    ActionEvent actionEvent = new ActionEvent(specialBtnComponent);
                    specialBtnComponent.queueEvent(actionEvent);
            catch (EvaluationException ex)
                ex.printStackTrace();
        public void encodeEnd(FacesContext context, UIComponent component) throws java.io.IOException
            SpecialBtnComponent specialBtnComponent = (SpecialBtnComponent) component;
            ResponseWriter writer = context.getResponseWriter();
            String clientId = component.getClientId(context);
            value = (String) component.getAttributes().get("value");
            if (value == null)
                value = "defaultValue";
            buildSpecialBtn(writer, value, clientId, specialBtnComponent);
        private void buildSpecialBtn(ResponseWriter writer, String value, String clientId, SpecialBtnComponent component) throws java.io.IOException
            writer.startElement("table", component);
            writer.startElement("tbody", component);
            writer.startElement("tr", component);
            writer.startElement("td", component);
            value = String.valueOf(value);
            writer.startElement("input", component);
            writer.writeAttribute("type", "submit", null);
            writer.writeAttribute("name", clientId, "clientId");
            writer.writeAttribute("value", value, null);
            writer.endElement("input");
            writer.endElement("td");
            writer.endElement("tr");
            writer.endElement("tbody");
            writer.endElement("table");
    web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
      <display-name>pagerWEB</display-name>
      <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
      </servlet>
      <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.faces</url-pattern>
      </servlet-mapping>
      <jsp-config>
        <taglib>
          <taglib-uri>http://jsfcustomcomponent/</taglib-uri>
          <taglib-location>/WEB-INF/jsfcustomcomponent.tld</taglib-location>
        </taglib>
      </jsp-config>
    </web-app>

  • Creating button with gotoPage(action) and tooltip in Indesign CS4

    Hi,
      I want to create the button with gotopage(action) and tool tip for specific text for pdf generation, using the javascript/AppleScript .If any of you know ,Please do reply for my question.

    Dave is correct. Go to Page isn't available in PDF.
    Instead, use the Hyperlink panel and select an object or text and choose Create New Destination and give it a name.
    Then set the action for the button to be Go to Destination. Select the destination you saved.

  • Possible to create buttons with Pages '09?

    I am currently working on a project that requires the input of interviewees. This is only a project for an upper-division class at the undergraduate level, so formal methods are kind of thrown out the window. Nevertheless, it's for 35% of my final grade so hopefully someone can help.
    I would just interview people in person, but I am interviewing people across the country (friends and family). Because of schedule conflicts, I need to create a questionnaire that they can fill out digitally and then return to me via email. I would like to create buttons for their responses (i.e., Yes, No, Maybe, etc.), but cannot find any way to do so. I know it is possible to do in Microsoft Word (which I do not have because I swore of all Microsoft products as soon as I got my Mac back in fall of 2009). Is there a way to do this in Pages? If not, any suggestions how I may format my document so that answers can be marked with an X, or possible web-based solutions?
    Thanks in advance for any and all suggestions. You will be saving me a lot of time and effort!

    Mitchapalooza wrote:
    I am currently working on a project that requires the input of interviewees. This is only a project for an upper-division class at the undergraduate level, so formal methods are kind of thrown out the window. Nevertheless, it's for 35% of my final grade so hopefully someone can help.
    I would just interview people in person, but I am interviewing people across the country (friends and family). Because of schedule conflicts, I need to create a questionnaire that they can fill out digitally and then return to me via email. I would like to create buttons for their responses (i.e., Yes, No, Maybe, etc.), but cannot find any way to do so. I know it is possible to do in Microsoft Word (which I do not have because I swore of all Microsoft products as soon as I got my Mac back in fall of 2009). Is there a way to do this in Pages? If not, any suggestions how I may format my document so that answers can be marked with an X, or possible web-based solutions?
    Feature unavailable.
    I wish to add that building such document with an application which may be run only on a macintosh is probably not a good design.
    Yvan KOENIG (VALLAURIS, France) jeudi 25 novembre 2010 21:50:06

  • Need help creating a folder action for creating folders based on filenames.

    I want to create a folder action that will monitor a folder and every time a file is added to the folder it will create a directory using the filename (minus the extension) and move the file the that directory

    on run {input, parameters} -- create folders from file names and move
      set output to {} -- this will be a list of the moved files
      repeat with anItem in the input -- step through each item in the input
        set {theContainer, theName, theExtension} to (getTheNames from anItem)
        try
          set destination to (makeNewFolder for theName at theContainer)
          tell application "Finder"
            move anItem to destination
            set the end of the output to the result as alias -- success
          end tell
        on error errorMessage -- duplicate name, permissions, etc
          log errorMessage
          # handle errors if desired - just skip for now
        end try
      end repeat
      return the output -- pass on the results to following actions
    end run
    to getTheNames from someItem -- get a container, name, and extension from a file item
      tell application "System Events" to tell disk item (someItem as text)
        set theContainer to the path of the container
        set {theName, theExtension} to {name, name extension}
      end tell
      if theExtension is not "" then
        set theName to text 1 thru -((count theExtension) + 2) of theName -- just the name part
        set theExtension to "." & theExtension
      end if
      return {theContainer, theName, theExtension}
    end getTheNames
    to makeNewFolder for theChild at theParent -- make a new child folder at the parent location if it doesn't already exist
      set theParent to theParent as text
      if theParent begins with "/" then set theParent to theParent as POSIX file as text
      try
        return (theParent & theChild) as alias
      on error errorMessage -- no folder
        log errorMessage
        tell application "Finder" to make new folder at theParent with properties {name:theChild}
        return the result as alias
      end try
    end makeNewFolder
    This script almost does what I need except for the fact that it screws up on files with periods in them
    for example
    1.2.3.4.txt
    will create the directorys 1, 2, 3, and 4 instead of 1.2.3.4

  • How to Create Buttons With some operation

    Hello friends How can create button so that when i click that button it should open another new window so that i can select some options in that new window and do some calculations.
    Kindly help me .
    byee

    Hi JN,
    I have created a Frame which has some checkboxes , a button and text field. when i check some checkboxes and press the Button (ie in my program Metrics level Button ) it should display the result as number of checkboxes that are checked divided by total number of chechboxes. ie if i check some 6 check boxes and press the Metrics level button it should display 6 divided by 12 ie 0.5 in the Result Textfield.
    I am sending the code i have written.
    Thanks in advance.
    public class Frame extends java.awt.Frame {
    /** Creates new form Frame */
    public Frame() {
    initComponents();
    setSize(800, 800);
    private void initComponents() {
    label1 = new java.awt.Label();
    checkbox1 = new java.awt.Checkbox();
    checkbox2 = new java.awt.Checkbox();
    checkbox3 = new java.awt.Checkbox();
    checkbox4 = new java.awt.Checkbox();
    checkbox5 = new java.awt.Checkbox();
    checkbox6 = new java.awt.Checkbox();
    checkbox7 = new java.awt.Checkbox();
    checkbox8 = new java.awt.Checkbox();
    checkbox9 = new java.awt.Checkbox();
    checkbox10 = new java.awt.Checkbox();
    checkbox11 = new java.awt.Checkbox();
    checkbox12 = new java.awt.Checkbox();
    button1 = new java.awt.Button();
    textField1 = new java.awt.TextField();
    setLayout(null);
    addWindowListener(new java.awt.event.WindowAdapter() {
    public void windowClosing(java.awt.event.WindowEvent evt) {
    exitForm(evt);
    label1.setText("Select the Metrics below");
    add(label1);
    label1.setBounds(320, 20, 136, 20);
    checkbox1.setLabel("Architecture Metrics");
    add(checkbox1);
    checkbox1.setBounds(240, 80, 84, 20);
    checkbox2.setLabel("Runtime Metrics");
    add(checkbox2);
    checkbox2.setBounds(240, 200, 115, 20);
    checkbox3.setLabel("Documentation Metrics");
    add(checkbox3);
    checkbox3.setBounds(240, 320, 152, 20);
    checkbox4.setLabel("Size");
    add(checkbox4);
    checkbox4.setBounds(280, 110, 49, 20);
    checkbox5.setLabel("Structure");
    add(checkbox5);
    checkbox5.setBounds(280, 130, 75, 20);
    checkbox6.setLabel("Complexity");
    add(checkbox6);
    checkbox6.setBounds(280, 150, 86, 20);
    checkbox7.setLabel("Size");
    add(checkbox7);
    checkbox7.setBounds(290, 230, 49, 20);
    checkbox8.setLabel("Structure");
    add(checkbox8);
    checkbox8.setBounds(290, 250, 75, 20);
    checkbox9.setLabel("Complexity");
    add(checkbox9);
    checkbox9.setBounds(290, 270, 86, 20);
    checkbox10.setLabel("Size");
    add(checkbox10);
    checkbox10.setBounds(300, 350, 49, 20);
    checkbox11.setLabel("Structure");
    add(checkbox11);
    checkbox11.setBounds(300, 370, 75, 20);
    checkbox12.setLabel("Complexity");
    add(checkbox12);
    checkbox12.setBounds(300, 390, 86, 20);
    button1.setLabel("Metrics level");
    add(button1);
    button1.setBounds(290, 470, 83, 24);
    textField1.setText("Result");
    textField1.setName("Result");
    add(textField1);
    textField1.setBounds(400, 470, 60, 20);
    pack();
    public void actionPerformed(ActionEvent e) {
    ****** I think code should be added here for the button pressed event*******
    /** Exit the Application */
    private void exitForm(java.awt.event.WindowEvent evt) {
    System.exit(0);
    * @param args the command line arguments
    public static void main(String args[]) {
    new Frame().show();
    // Variables declaration - do not modify
    private java.awt.Button button1;
    private java.awt.Checkbox checkbox1;
    private java.awt.Checkbox checkbox10;
    private java.awt.Checkbox checkbox11;
    private java.awt.Checkbox checkbox12;
    private java.awt.Checkbox checkbox2;
    private java.awt.Checkbox checkbox3;
    private java.awt.Checkbox checkbox4;
    private java.awt.Checkbox checkbox5;
    private java.awt.Checkbox checkbox6;
    private java.awt.Checkbox checkbox7;
    private java.awt.Checkbox checkbox8;
    private java.awt.Checkbox checkbox9;
    private java.awt.Label label1;
    private java.awt.TextField textField1;
    // End of variables declaration
    this is the output when i execute the program

  • Need tech help creating project with PE11, Windows 7

    I still need help creating a slideshow set to music for DVD playback at my 50th high school reunion. 
    Video Media = 700 still images in .jpg or .tff format.  Pixel sizes range from 200x200 to over 3000x4000.
    I first created this project using PE's presets and original image sizes.  Images added to PE were more blurred than originals & images burned to DVD were even more blurred so I asked for advice.
    Last week several people in the forum tried to help.  I really appreciate everyone's suggestions but would still appreciate further advice. 
    Forum experts said to restart my project with project settings changed to DV 720x480...and to resize my images to 1000x750 pixels.  Then today in a PE11 chat session, I was told something different: use project settings changed to DVD 720p 30 and resize only larger images down to 1280 x 720 (leave smaller images alone). 
    So what project settings and resizing should I use for better image clarity?  How do I change project settings?  By clicking on "new" under "file" >change project settings >DVD 720p 30 or something else?

    Up-rezzing small Still Images, regardless of the program and the Scaling algorithm used, can lead to a diminished quality. As Steve says, pixels are created, where none existed. I try to stay away from up-rezzing, whenever possible, due to that diminished qualtiy.
    If I have to work with very small Images, I often use another workflow, and a different asethetic choice. When faced with the prospect of using small Images, I will create a background of some sort (many options here), and then use that small Image at its original size, "framed" within that background - no Scaling involved, but obviously, that small Image will not fill the screen. The viewer usually has fewer problems with the small Image, than one that is larger, but has started to fall apart, due to the up-rezzing.
    One "trick" that I use is to use that small Image AS the background, but alter it greatly, probably dropping its contrast and upping its brightness, and even adding a Blur to it, then do a PiP (Picture in Picture) of the Image at its original size. I might even create a "picture frame" in Photoshop, to really set that small Image apart from the background. That is but one of dozens of such possible treatments, and one is only limited by their imagination.
    Another possible treatment would be to do a "photo wall" with several of the small Images in say a 3 x 2 matrix of PiP's. Sort of like a Contact Sheet.
    Good luck,
    Hunt

  • Help Creating Starburst With Randomized Rays

    Check out this background image below (or view larger size at this link:http://i3.campaignmonitor.com/themes/site_themes/default/img/bg_site-home.jpg) . I would like to know how they created the "randomized" effect of the rays behind the gray box.   I already know how to make your standard starburst using Abealls auto shape extension, but that creates uniform rays.  The rays of light in the below example are seemingly random.  I know this can be easily done in Photoshop using filters, but can it not be easily done in Fireworks?

    Here's my try ( btw, welcome to the forums! ) and even if it is not random, it is close to the desired effect.
    Save the file to your computer and de-construct. I have added a Noise filter effect, a bit of Gaussian blur and there is a half-transparent rectangle on top of the rays, with gradient (rays use gradient, too).
    Now, I suppose you could combine two Sunrays autoshapes, slightly shift one of them, make both half-transparent, and apply a bit different effects to both. You could also create a complex vector mask on top of the sunrays, with a complex gradient with varaible areas of half-transparency, and this could help create this "random effect" that you are going after...
    I hope that some wiser than me Fireworks guru will be able to help you more...
    Message was edited by: Michel (two more variants added)

  • Java Help on buttons with counter

    public Keypad(Display myMonitor)
            // initialise instance variables
            monitor = myMonitor;
            JPanel p = new JPanel();
            p.setLayout(new GridLayout(5,4));
            String [] buttonLabels={"One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve",
            "Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen","Twenty"};
            JButton [] buttons = new JButton[buttonLabels.length];
            for(int i = 0; i < buttonLabels.length; i++)
                buttons[i] = new JButton( buttonLabels[ i ] );
                buttons[i].addActionListener(this);
                p.add(buttons[i]);
                setFont(new Font("SansSerif",Font.BOLD,18));
              add("Center",p);
    I need help on using the buttons to have a counter for example when someone clicks  the button "One" 5 times it display something like this : [5] One. So far the buttons work, but I cannot get a counter associate with them. Big Help is extremely needed.  Also the buttons need to be reset to zero; I dont want the counter to keep increasing forever.
    Thanks Cheikh

    You should create two new integer variables.
    count and lastPressed
    let lastPressed be set to a different numeric value for each button you have (button1 = 0, button2 = 1, and etc)
    you set lastPressed each time a button is pressed (in the handler) to its specific associated value, and then set count to 1. If lastPressed is = to the integer button index of the current button, then you pressed the button last time, so we increment count (count++).
    I hope this helps. I might not be explaining it well enough.
    example:
    if( lastPressed == 0 )
    count++
    else // we're in button 0, and lastPressed != to it.
    count = 1;
    lastPressed = 0;
    // handle other stuff ,and return

  • Flash buttons with action script working but I don't understand them enough to use

    My addy is www.abdezines.com firstly otherwise i will forget.
    Can anyone explain to me how my buttons work as I have pulled
    them apart many a time and can not get my ead around them to be
    able to re create in a similar idea. Someone built them for me
    previously but will no longer help when all I want to do is
    understand them so I can do them myself. I can change the wording
    when they are in my current website, the speed it moves and the
    same with the arrows but I cant see how to start it elsewhere
    despite all my digginh around in it.
    If someone can perhaps talk me through it, I have the files
    for it if wanted.
    Many thanks

    My msn addy is [email protected] if anyone can help
    me

  • Create Button With Mouseover AND Sound

    Hey - I know zilch about FLASH...just enough to fade pictures
    in, etc.
    Have a button created that changes on mouseover. That works
    fine...but now want to add a sound on mouseover or on click. I
    right-clicked on the button and did "edit in place". Then added a
    new layer to the button and at "over" set a new key frame and added
    the sound.
    However the corresponding swf file opens into this mean loop
    of pressing down and unpressing on it's own while playing only part
    of the sound and cutting it off.
    dang it...can anyone help? THANKS.

    Hi,
    it ought to be quite a simple task. Give to these buttons MouseListeners like
    button.addMouseListener(MouseListener listener) and MouseListener class has methods mouseEntered and mouseExited. Maybe you should use MouseAdapter instead of MouseListener class.
    Hope it helps.
    L.P.

  • Help creating a custom action

    I have a series of steps that I need to do for a large amount of PDFs. I figure the most efficient way to do this is to make a custom action so that I can just do it all in 1-2 presses of a button. However, Im having trouble figuring out how to do certain steps.
    1. OCR the document - done
    2. Add a drag and droppable signiture to the document  - Seems this cant be done via actions
    3. Flatten the document - done
    4. Send this document as an email to an address listed on the document and BCC a to a constant email.
    It seems like step 2 cant be done using actions, which sucks but no choice I guess, so that can be done manually. Step 4 though seems to be givng me some trouble and I think it should be doable. Ideally what I would like is for the user to select a string on the document, and that selected string would be copied to the to field of an email, concated with a domain name, and then a BCC field would be added. Because of this, I figure I would need to make 2 seperate actions. One for steps 1 and 2, then have the user select the email, then one for steps 3 and 4. But Im not sure how to get the email stuff working. Do anyone know how?

    You can use the JavaScript method this.mailDoc() to attach a copy of the currently-active PDF to your mail client. Getting the email address depends on where it is - form field contents are easy to extract with JavaScript but text on the page itself is next-to-impossible.
    See the SDK for details on how mailDoc() works - http://bit.ly/AXISDKH

  • I need help creating documents with framemaker 9

    I have been using Words for all the manuals that i have created and i need to transfer them into framemaker and then be able to rewrite them directly into framemaker. I need some help with that please

    Anna,
    You might want to have a peak at some of these tutorials and papers:
    http://www.adobe.com/devnet/framemaker/articles/word_conversion.html
    http://www.techknowledgecorp.com/public/word2frame.pdf
    http://www.io.com/~tcm/etwr2472/guides/frame/frame6/frame_conversion6.html
    http://www.ivanwalsh.com/2009/10/how-to-convert-microsoft-word-documents-into-adobe-framem aker/
    There's also an online webinar [nominal fee] coming up on Feb.10th presented by Shlomo Perets that will be covering this topic. [Highly recommend]
    See: http://www.microtype.com/training.html#ImproveFM

  • Need help creating component with 'application.createComponent'

    I am trying to create a button component by doing the following
    application.createcomponent("javax.faces.command") ;
    However it does not seem to work. I can create pretty much any other component by this method but for some reason I am unable to do this with the 'javax.faces.command' component family. Shouldn't this work?

    I think that the component type of the commandButton is "javax.faces.HtmlCommandButton"

  • Help creating tables with multi line cells (variable height cells)

    Hi -
    I am trying to create a table where the row height of various rows might not
    be one unit (i.e. there would be wrap around text) but I DO NOT want every cell
    to be the same height. i.e. I only want rows with wrap around to be taller.
    What I have done already is
    - Create a new text renderer and set it as default table renderer.
    - played around with the table.serRowHeight method.
    what I noticed is this. If i call
    table.setRowHeight (32);
    All the rows will be a height of 32 which is expected.
    However, if I do something like:
    table.setRowHeight (0,16);
    table.setRowHeight (1,32);
    All the rows render as height 16.
    I am trying to do this on the fly so to speak. I am setting the table model
    fully and then listening to the tableModelChanged event and then want to
    adjust the rows accordingly.
    I have below listed the code snippit and what i WANT to do and what only seems
    to work:
    public void tableChanged(TableModelEvent e) {
    int rows = table.getRowCount();
    //// Using the api i would expect this to make each row taller
    for (int i = 0; i < rows; ++i) {
    table.setRowHeight(i,16+16*i);
    //// However this one alone makes then all the same height.
    //// I do not want this but want the snippit of code above to work
    //// if possible
    table.setRowHeight(32);
    Thanks in advance....
    matt

    Hi bbrita
    Sorry for the confusion. But basically yes the code below in my system does NOT
    work. In my model i have
    public class ApplicationTableModel extends AbstractTableModel {
    //// other stuff here
    public void setApplicationData(SimpleApplication[] appData) {
    //// set the new data here
    this.fireTableDataChanged();
    and then it does call :
    tableChanged(TableModelEvent e)
    and in there i DO change the heights of the cells but they still all render the same height.
    The basic code snippits I am useing are:
    //// in my table model
    public class ApplicationTableModel extends AbstractTableModel {
    //// other stuff here
    public void setApplicationData(SimpleApplication[] appData) {
    //// set the new data here
    this.fireTableDataChanged();
    //// in the panel i create the table
    public class ApplicationDataTablePanel extends JPanel
    implements ListSelectionListener, TableModelListener {
    //// other stuff here...
    public ApplicationDataTablePanel() {
    appModel = new ApplicationTableModel();
    table = new JTable(appModel);
    table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    table.getSelectionModel().addListSelectionListener(this);
    table.getModel().addTableModelListener(this);
    // not used at the moment
    // table.setDefaultRenderer(Object.class, new MultiLineCellRenderer());
    this.add(new JScrollPane(table));
    public void tableChanged(TableModelEvent e) {
    System.err.println("GET Row count="+table.getRowCount());
    for (int i=0; i<table.getRowCount(); i++) table.setRowHeight(i,i*3+10);
    /// not used
    // table.invalidate();
    for (int i=0; i<table.getRowCount(); i++)
    System.err.println("HEIGHT="+table.getRowHeight(i));
    This does dump to the screen the following (i have triggered something in the
    system to update the model):
    GET Row count=5
    HEIGHT=10
    HEIGHT=13
    HEIGHT=16
    HEIGHT=19
    HEIGHT=22
    Which is what I expect BUT the cells do not change in height (they are all the
    standard size). This is what is baffling me because it seems to be the thing
    you suggested below but does not work. Which seems like exactly what
    should work.
    I was wondering if there was somewhere else in the event flow that I should be
    making these modifications or if I needed to for force any refresh or anything on
    the graph cells. ???
    Thanks so much for the help and any more you might have.
    matt

Maybe you are looking for

  • FI link to IOM

    My FI (6248s) have 4 link-connections to IOM (2208XP) and the chassis discovery has been done. The above links are configured as server ports.  So, do we leave them as individual server ports or do we use portchannel on the FI and IOM? In other words

  • Numbers not sorting date/time correctly

    I would be grateful if someone can chime in - it's very simple thing and maybe I'm overlooking something. I have 3 columns: DATE - DESCRIPTION - TIME I need to sort them out by date, then by time. It works only for date cells - upon inspection I have

  • I want to display  parameters when i check check box

    hi, i want to display select options when i check check in the selection screen . if the check box was not checked then those parameters should not be seen.

  • With out inbound Idoc can we post the data using we19

    Hi,         with out inbound idoc can we post the data using we 19......... for testing any idoc type particular to inbound FM is posting application data..in TABLES..... Regards, Raghunadh.

  • Cannot shorten Audio or VideoClips

    I have iMovie HD 6.0.3 (267.2) I cannot shorten audio or movie clips by dragging the 'cursor' in from either end of the clip. I can split the clips but not shorten. When I click on the end/beginning of the clip I cannot get the T laying on its side -