composite-component

Adding action methods to a composite component

无人久伴 提交于 2021-02-16 05:11:58
问题 I am learning about composite components with JSF 2.0 and i want my component to be able to trigger methods from backing beans, so i created a simple example, but something is wrong. This is the component i created: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:composite="http://java.sun.com/jsf/composite"> <composite:interface> <composite:attribute name="attribute1"/> <composite:attribute name="attribute2"/> <composite:attribute name="actionBtnText"/

Adding action methods to a composite component

让人想犯罪 __ 提交于 2021-02-16 05:10:13
问题 I am learning about composite components with JSF 2.0 and i want my component to be able to trigger methods from backing beans, so i created a simple example, but something is wrong. This is the component i created: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:composite="http://java.sun.com/jsf/composite"> <composite:interface> <composite:attribute name="attribute1"/> <composite:attribute name="attribute2"/> <composite:attribute name="actionBtnText"/

What is the difference between put and add method in statehelper in JSF 2

假如想象 提交于 2021-01-28 22:04:27
问题 What is the difference between: Object put(Serializable key, Object value) void add(Serializable key, Object value) methods in StateHelper in JSF? 回答1: I found the api documentation not that helpful myself and investigated it. Each time add is called it appends another value to a list which is saved under the given key. If you call a get on that key you get back a list. The add method saves you creating that list and watches for corner cases, ex. creating the list when the key is empty. The

Why does a commandLink within a facet within a composite component renders an error?

99封情书 提交于 2020-12-30 08:17:14
问题 When I create a composite component with a facet in it and place a command link within that facet, I get an error message: This link is disabled as it is not nested within a JSF form. A commandButton does not behave in the same way, so I am inclined to this this is a bug. index.xhtml : <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns

Why does a commandLink within a facet within a composite component renders an error?

Deadly 提交于 2020-12-30 08:16:26
问题 When I create a composite component with a facet in it and place a command link within that facet, I get an error message: This link is disabled as it is not nested within a JSF form. A commandButton does not behave in the same way, so I am inclined to this this is a bug. index.xhtml : <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns

How to make composite component similar to <h:selectOneRadio />

对着背影说爱祢 提交于 2020-02-03 11:38:50
问题 I have been searching a lot for a way to make a composite component similar to: <h:selectOneRadio /> but I did not succeed. I want something like: <myowntags:selectOneRadio> <f:selectItem itemValue="value0" itemLabel="This is the value 0" /> <f:selectItem itemValue="value1" itemLabel="This is the value 1" /> <f:selectItem itemValue="value2" itemLabel="This is the value 2" /> </myowntags:selectOneRadio> and: <myowntags:selectOneRadio> <f:selectItems value="#{controller.items}" /> </myowntags

How to make composite component similar to <h:selectOneRadio />

匆匆过客 提交于 2020-02-03 11:37:27
问题 I have been searching a lot for a way to make a composite component similar to: <h:selectOneRadio /> but I did not succeed. I want something like: <myowntags:selectOneRadio> <f:selectItem itemValue="value0" itemLabel="This is the value 0" /> <f:selectItem itemValue="value1" itemLabel="This is the value 1" /> <f:selectItem itemValue="value2" itemLabel="This is the value 2" /> </myowntags:selectOneRadio> and: <myowntags:selectOneRadio> <f:selectItems value="#{controller.items}" /> </myowntags

<my:foo> Tag Library supports namespace: http://java.sun.com/jsf/composite/mycomponents, but no tag was defined for name: foo

怎甘沉沦 提交于 2020-01-28 08:04:18
问题 I have a composite component named <my:foo> and I'm building another composite component named <my:bar> . But when I attempt to use <my:foo> inside the <cc:implementation> of <my:bar> , the following exception is been thrown: <my:foo> Tag Library supports namespace: http://java.sun.com/jsf/composite/mycomponents, but no tag was defined for name: foo How is this caused and how can I solve it? 回答1: This is caused by a bug which was introduced in Mojarra 2.1.8, continued in 2.1.9 and is fixed in

Composite Component with f:convertNumber won't work

时光怂恿深爱的人放手 提交于 2020-01-25 01:51:57
问题 I made a JSF composite component which uses f:convertNumber . However, it cannot convert value. How is this caused and how can I solve it? currency.xhtml <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:composite="http://java.sun.com/jsf/composite" xmlns:f="http://java.sun.com/jsf/core"> <composite:interface> </composite:interface>

java.lang.NullPointerException at com.sun.faces.application.view.FaceletViewHandlingStrategy$MethodRetargetHandlerManager

谁都会走 提交于 2020-01-15 12:23:49
问题 I'm using JSF Composite Component for reuse component. However, I keep getting a null-pointer error, I follow some of the tutorial I found but none mention this problem. The stack trace added: java.lang.NullPointerException at com.sun.faces.application.view.FaceletViewHandlingStrategy$MethodRetargetHandlerManager$ArbitraryMethodRegargetHandler.retarget(FaceletViewHandlingStrategy.java:1883) at com.sun.faces.application.view.FaceletViewHandlingStrategy.retargetMethodExpressions