composite-component


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

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

萝らか妹 提交于 2020-01-15 12:23:39
问题 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

JSF2: limiting cc:attribute to a given object type within a List

非 Y 不嫁゛ 提交于 2020-01-12 05:53:33
问题 If I had a managed bean as follows: @ManagedBean @RequestSchoped public class Example { private List<String> stringList; private List<Long> longList; // getters, setters, etc. down here } and had a custom component which accepted a List as an attribute: <?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:cc="http://java.sun.com/jsf

JSF2: limiting cc:attribute to a given object type within a List

假装没事ソ 提交于 2020-01-12 05:53:13
问题 If I had a managed bean as follows: @ManagedBean @RequestSchoped public class Example { private List<String> stringList; private List<Long> longList; // getters, setters, etc. down here } and had a custom component which accepted a List as an attribute: <?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:cc="http://java.sun.com/jsf

JSF2: limiting cc:attribute to a given object type within a List

与世无争的帅哥 提交于 2020-01-12 05:53:05
问题 If I had a managed bean as follows: @ManagedBean @RequestSchoped public class Example { private List<String> stringList; private List<Long> longList; // getters, setters, etc. down here } and had a custom component which accepted a List as an attribute: <?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:cc="http://java.sun.com/jsf

How to disable elements from within a ViewHandler after jsf has embedded the composite component?

喜欢而已 提交于 2020-01-11 12:32:35
问题 I'm using a ViewHandler to block all input elements on any accessed page, if certain criteria is met. This works great for the input elements in the 'primary' xhtml files, but the input elements within composite components aren't being blocked. I figured it has to do with the fact that JSF embeds these components only after my ViewHandler has finished it's job. Does anyone have an idea of how I can disable the elements in the composite as well? 回答1: A ViewHandler is the wrong tool for the job

In JSF2, how to know if composite component has children?

杀马特。学长 韩版系。学妹 提交于 2020-01-11 05:29:08
问题 I'm writing a composite component, you have a special tag named: <composite:insertChildren /> Which inserts all the component's children there. Is there any way to know whether the component has children? Like a boolean value that could go on a "rendered" attribute. 回答1: The basic expression you're after is the following: #{cc.childCount} or more elaborately: #{component.getCompositeComponentParent(component).childCount} E.g. the following composite component: <html xmlns="http://www.w3.org

Passing EL expression to composite component

血红的双手。 提交于 2020-01-11 04:16:12
问题 we are still in a JSF 1.2 to 2.0 migration scenario and we are now facing a problem related to c:set or ui:param variables used inside an EL expression. Here are the facts. There is a button as composite component: <cc:interface name="button" shortDescription="A button."> ... <cc:attribute name="disabled" required="false" default="false" shortDescription="The disabled flag." /> ... </cc:interface> <cc:implementation> <ice:commandButton ... disabled="#{cc.attrs.disabled}" ... /> </cc

JSF ui:repeat in ui:repeat with dynamically assigned var-value

限于喜欢 提交于 2020-01-06 01:33:08
问题 We created a JSF table component for our projects which uses <ui:repeat> to create the table. A new requirement to add a table inside a table (the second table resides in a row and is collapsable) has gotten us into trouble as the <ui:repeat var="row" ...> is set statically inside the table componenten and the inner table uses the row variable of the outer table when iterating through the list. Now what i want to create is something like this: <div> <myfw:mytable dataModel="#{bean.user}"

Expose items of a list while iterating within composite component

浪子不回头ぞ 提交于 2020-01-05 20:23:30
问题 I'm iterating over a list of items in composite component. I want to expose each item of the list so that they could be used within the child component of this composite component, to create a template for how to display all items in the list. Here is my Composite Component implementation: customList.xhtml <ui:component xmlns="http://www.w3.org/1999/xhtml" xmlns:cc="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets"> <cc:interface> </cc:interface> <cc

工具导航Map