¿Custom button with different size/shape for rollover state in Muse?
Hello, i'm trying to make a custom button, that has one size/shape when normal, and other size/shape when rollover.
The problem is that the area not visible in normal state is a hot area, so when then mouse rollover anywhere near, activates the button rollover state.
So i think what i need is mask or something like that
Is there a work around to do this? Is even possible in normal CSS - HTML5?
Here is the website:
http://www.audime.com/prueba/
And here what i'm talking about:
Thanks in advance!
I'm not fully understanding the screenshot, but what you're describing sounds more like a Composition:Tooltip widget than a button.
Similar Messages
-
Where can I purchase 2d characters that come with different mouth shapes for various phonemes
I would like to create an animated video that features a 2d character who speaks. I have been searching all over for a website that sells 2d characters that include the mouth shapes needed to represent the various phonemes, but I can't find any.
Does anyone know of any websites that might sell 2d characters that I can import into AE without creating any of the graphics myself?
Thanks
PaulHi,
If you google (under images) for "Phonemes" you will get hundreds of tables, filled with different expression and standard mouth shapes. You can then either use these to create your own versions (there will be several ways to do this), or, since you are willing to spend some money to buy the characters, why not check out http://aescripts.com/auto-lip-sync/
We use this tool extensively for our project, and it is very user-friendly. The mouths will look a lot better with this, them standard phoneme mouth shapes.
If you want to go the phoneme way for specific reasons, try this link : http://library.creativecow.net/articles/rabinowitz_aharon/lip_synch.php - it contains a downloadable character face and mouth shapes. I think you can use it, just check to make sure it is allowed.
Pierre -
Disjointed rollover with different size images?
Every tutorial says the disjointed rollover images MUST be the same size, etc. But for the type of photos I'm working with, it's impossible to make them the same height. This site is exactly what I'm going for with the different sized images being used: http://www.warmbloods-for-sale.com/HorseDetail.asp?HorseID=21333&UserID=1775. Any idea how they accomplish this? Or any ideas on how I can manage the same effect with different sizes in Dreamweaver CS4?
Do a Google search for Lightbox, litebox, floatbox or look at Project Seven's Image Gallery Magic.
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
www.alt-web.com/
www.twitter.com/altweb
www.alt-web.com/blogspot.com -
I want to use a customized photoshop button with my composition and have rollover effect
I'm trying to place a photoshop button into a blank composition widget trigger. When I cut a paste the image into the trigger it looses its fuctionality and no longer switches colors during rollover. It works fine in the lightbox composition, but the problem with lightbox composition is that it does not have rollover options to display the target only click. How do I get around this problem. I want to have my own customized button with the composition effect within muse cc.
You should check the design layout and states defined for the trigger , if the state is defined properly then it should show the rollover state, but the target container corresponding to the trigger is on the page then it would show you the active state not the rollover state.
Thanks,
Sanjit -
Is it possible to create a customer master with different address
Hi Gurus,
Is it possible to create a customer master with different address as we maintain in SAP CRM.
Kindly help me onthis issue \
Regards
KannanHi Kannan,
There are no multiple addresses but you can use multiple unloading ponts for the same address for the ship to Party.
So when you create a Sales order the system will give a pop up with the unloading points allowing you to select the desired one.
I hope I understand your query correctly.
Regards
Yogesh -
Can a single HID report descriptor support multiple touch screens with different sizes?
Hi Experts:
I have a question for specifying touch monitor sizes in the HID report descriptor:
Can ONE HID report descriptor support multiple touch monitors with different sizes ?
Thanks in advance
leoMy screen shot is from AA9, and I have seen that the UI for AAX is vastly different, but...
Choose Paper Source from Page Size should be the "one-touch" solution your looking for.
In my test, my Konica-Minolta Bizhub failed to detect the proper paper trays, but Acrobat correctly spooled the pages. -
Help!! Buttons with different actions on IPAD
Why is in Ipad a button with different actions does not respond to these actions at the same time, but one at a time? In Android works fine!!
What is happening is that in ipad I have to touch more than once on the button to go to the different actions that this button has!
Help...Hi Tomas
thanks for the quick response. I think mine Adobe Content Viewer is the last update, from February 21, so the problem is not due to this.
II'll explain the situation better, i have several identical situations. For example, I have a square that hides an image and I want that when you tap this square this image appears behind him, then i did the following: I selected at first the square and the image and transformed a multi- State Object, in which the first state is the box (State1) and the second is the image (state 2) then made a transparent button on top of this square and it gave the following actions - on release go to state 2 (image) here everything goes well, the problem is that as I have more buttons / squares that do the same and show different images, that when I turned the other one the next hide her image. So all the buttons in addition to the state that shows the picture / object matching (state 2) - i have also- go to state (name of the object: state 1) causes other squares hide their files, as they get the state 1. Here lies the problem, in ipad these actions do not react automatically but in different touches, it seems that it reads a touch for action and not all at once.
I apologize for my English but I'm Portuguese, I hope you can understand everything explained.
Marta -
Can I use two different devices with different apple ID for backing up data on one machine without losing any data that was backed up with one device earlier?
The link is to a discussion started on 12/18 in the FiOS Internet forum. Here's the link I get now, however it is different than the link I pulled a few hours ago. If this system changes the link again, it may not work.
http://forums.verizon.com/t5/FiOS-Internet/Frustration-and-just-confused-with-internet-help-please/t...
You can also look for the topic, "frustration and just confused" in the FiOS Internet forum.
Here's a link that is in the thread that gives more detail.
https://secure.dslreports.com/faq/15984
Good Luck!
P.S. "Copper Contributor" is my "rank." gs0b is my user name.
If a forum member gives an answer you like, give them the Kudos they deserve. If a member gives you the answer to your question, mark the answer as Accepted Solution so others can see the solution to the problem. -
Multiple masters with DIFFERENT sizes?
Hi,
I think this is a NO, but I have to ask.
Is it possible to have different master pages in a single document, each with a different size?
If not, how do I tackly my problem?
I am making a sales matrix and it will be comprised of 3.5 inch by 7 inch pages with some 3.5 by 3.5 inch pages interspersed throughout.
I don't want to have two InDesign files, so it would be great if I could have masters with different sizes, OR if there was a way to use the larger of the two sizes, 3.5x7 and then set my square 3.5x3.5 pages doubled up on the larger page.
I know I can use the 'book' feature, but sometimes that is more trouble than it's worth, especially with different size pages. What do you suggest?Peter,
why do you say easier to work the other way?
I think this spread thing may just work.
I normally have facing pages in all of my saddlestitched letter size docs and output via Export to PDF with trim marks on. That gives me a pdf and eachpage has trim marks.
Doing it this way with a 3.5x3.5 document and outputting spreads, I get exactly what I want. A pdf with one 7 inch page and 4 3.5 inch pages all with trim marks at the right places.
Before I proceed though, I want to hear why this might be a bad idea.... -
Custom JButton with different states, any ideas??
Hey, hope you guys can help.
What I want to do is to implement a custom JButton class with different states for the button. The button should have a "pressed" state, where the user has pressed it, and if the action triggered by this pressing gets approved, it should get selected. It will then get a different color and border.
I will have several buttons of this type in one panel, and they can all have different states at any time.
I do not want to use JToggleButton, as it is not the user that decides if it should be selected or not, but the logic "behind" (the dataflow).
So I want like a combination of JButton and JToggleButton...
How do I do this, any ideas, please?I am not to sure if this is the idea you have in mind but...
This is something i have used before it is a tool bar. the button could be managed by another event it is an event listener at the moment.
As well as update only a specified button rather than all?
public class ToolBar extends JToolBar {
public ToolBar(EventListener el) {
this.setName("ToolBar");
String[] imageFiles = { "Left.gif", "Relationgif", "Reload.gif", "TrafficRed.gif", "Home.gif", "Print.gif", "Help.gif" };
String[] toolbarLabels = { "Entity", "Relationship", "Reload", "Stop", "Home", "Print", "Help" };
Insets margins = new Insets(3, 3, 3, 3);
for(int counter = 0; counter < toolbarLabels.length; counter++) {
ToolBarButton button = new ToolBarButton(imageFiles[counter]);
button.setToolTipText(toolbarLabels[counter]);
button.setMargin(margins);
button.setName(imageFiles[counter]);
button.setVerticalTextPosition(BOTTOM);
button.setHorizontalTextPosition(CENTER);
// button.setMnemonic(KeyStroke.VK_CAPS_LOCK);
button.addActionListener(el);
add(button);
public void setTextLabels(boolean showLabels) {
Component c;
int i = 0;
while((c = getComponentAtIndex(i++)) != null) {
ToolBarButton button = (ToolBarButton)c;
if (showLabels)
button.setText(button.getToolTipText());
else
button.setText("");
//each button on the tool bar is an object of this class
public class ToolBarButton extends JButton {
private static final Insets margins = new Insets(3, 3, 3, 3);
//user selected to view tool bar as image only (default)
public ToolBarButton(Icon icon) {
super(icon);
setMargin(margins);
//user selected to view tool bar as text only
public ToolBarButton(String iconName) {
this(new ImageIcon(iconName));
//user selected to view tool bar as image and text
public ToolBarButton(String iconImage, String iconName) {
this(new ImageIcon(iconImage));
setText(iconName);
} -
Array of buttons with different boolean text ?
I'm looking for a method of displaying a 2D button matrix with
different boolean text on each button. It seems an array of booleans
must all have the same text. Perhaps a cluster could be used, but the
array makes button alignment easy and easy to determine which had been
pressed (radiobutton style with only one button true at a time).
SteveOn 6 Dec 2002 05:31:21 -0800, [email protected] (humenik) wrote:
>[email protected] (Steve Parus) wrote in message news:<[email protected]>...
>> I'm looking for a method of displaying a 2D button matrix with
>> different boolean text on each button. It seems an array of booleans
>> must all have the same text. Perhaps a cluster could be used, but the
>> array makes button alignment easy and easy to determine which had been
>> pressed (radiobutton style with only one button true at a time).
>It's easy to make them individuals in a cluster, and on the block
>diagram use Cluster To Array to get it into array form for
>manipulation. This can be superior to an array of buttons, not merely
>because the buttons can thereby have differing colors and text. An
>array of buttons cannot have the buttons Latched When Pressed; when in
>a cluster, however, the latching action is available.
When might that Latched When Pressed behavior be useful ? Using a 2D
array of buttons (not cluster), in LV 6.1, a Value Changed event for
the array can be used as you mention below to XOR the event's OldValue
and NewValue and wire that to a local variable copy of the array.
This easily gives a radio button effect for the entire 2D button
matrix. The array control automatcially arranges the visual
alignment of the buttons.
For the cluster method, I'd like to programmatically change which
button is true. All the approaches I come up with end up using
Array-to-Cluster which then requires the cluster size to be specified.
I may end up wanting to programmatically vary the number of buttons in
both dimensions and hence the cluster size. LV's Align Objects and
Distribue Objects ends up making the button visual alignment not
difficult (for a 12 x 8 matrix).
>Try this: take a cluster of four PB's (latched when pressed) put
>inside a while loop. Initialize a boolean array of 4 to FALSE outside
>the while loop, and attach it to a shift register input on the left
>side of loop. Inside the loop, convert your cluster to an array. XOR
>the shift register with this array from the buttons, and wire this to
>the output shift register and to an indicator array. Set the boolean
>to the loop so it will run free and start it up; on the control panel,
>click on the PB's and you will see the outputs toggle.
>
>Greg -
Create custom document with wrong size
Hi,
I have a problem (on Sun Solaris 5.8) when I create custom document with more than 10MB size.
I've created an agent which detects the events on a custom data type
MYDOCUMENT (extension .mydoc).
When I put a new document test1.mydoc (size of 10MB for example), my agent detects the new document, creates a copy, sets the class object to
MYDOCUMENT , removes the original document and puts the copy into the same folder.
But sometimes, the copy created has a wrong size (less then 10MB).
How can I configure the nfs server to be sure that the agent waits for the complete size of the added document.
I need HELP !!!!
ThanksHi Pavithra,
yeah you can create your custom table by entering fields in Standard. for more details
refer below screen shots
Regards,
Thangam.P -
Creating / updating Custom infotype with different screen
Hi All,
I have created custom infotype having different screen for different subtype(1,2).
From Subtype 1, indotype is automatically updated as it is a standard program. But for subtype 2 i am using HR_INFOTYPE_OPERATION for updating the record which is ending with error, as employee which i am trying to update is already locked by me only through PA30. So this function module ends with Complex error. Please suggest how to update the infotype with subtype 2.
Thanking you..
Best regards
AkshayHi All,
I have created custom infotype having different screen for different subtype(1,2).
From Subtype 1, indotype is automatically updated as it is a standard program. But for subtype 2 i am using HR_INFOTYPE_OPERATION for updating the record which is ending with error, as employee which i am trying to update is already locked by me only through PA30. So this function module ends with Complex error. Please suggest how to update the infotype with subtype 2.
Thanking you..
Best regards
Akshay -
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> -
Naming buttons in different mc's for eval obj
Hi
I'm quite new to flash, from a design background. I'd really appreciate help with this. this is my first web site in flash and I'm getting really confused with movie clips, I made my menu as a collection of buttons in a new movie clip. I wanted to re use this on each page of my site but found that if I edited it the edit rippled all the way through each instance. So I made different movieclips for each page each with my navigation buttons in them. Now I want to use the eval obj to reference these buttons from my event listener, I know I must give each button a unique name, will it be ok to use the same name eg "home" for different buttons in different movie clips on different pages and still use one piece of code with the eval obj pointing to the correct label to jump to when it is clicked?
Also , how do you use one single movie clip for navigation accross different pages if you need to slightly change it for each page ?
cheers
chelseaplace your buttons in their own layer in frame 1 of your main timeline and extend that layer across your entire main timeline.
then add code for each button to direct the main timeline to the appropriate frame label or number.
Maybe you are looking for
-
How to print in black and white only on hp photosmart 6520
Cannot find a place to select print in black and white only on my HP Photosmart 6520 printer. It prints color just fine, but sometimes I do not want to use my color cartridges. I selected B&W instead of gray scale, but cannot stop the color printing.
-
Does anyone know how to find the Bulletin Board on a A505-6980? The advertisement for this machine says that the Bulletin Board in available on this machine but I cannot find in on the computer.
-
Hello I've made a Planning data form but figures on the form have different font size (see screenshot) - figures on total elements have a bigger font size than figures on leaf elements. How can I change the font on form to the one size? Screenshot ht
-
When first using photo stream I was told I could store my photos and they would stay till I moved them. Now a lot of my holiday photos have disappeared. Can I recover them?
-
KMC didn´t work with pcd write-protect mode
Hello, I have activated the write-protect mode for the PCD in our Portal. Everything is working fine. After restarting the portal-server, the kmc-component didn´t work anymore. After disabling the write-protect mode and restarting the server, kmc wor