composite-component

Extended @FacesComponent as composite interface componentType renders nothing

纵饮孤独 提交于 2019-12-18 04:28:10
问题 I'm trying to extend JSF's component class (let it be one of h:panelGroup ) and render it via composite component: Step 1: @FacesComponent(value="customPanel") public class CustomPanel extends HtmlPanelGroup { // or UIPanel } Step 2: <!-- INTERFACE --> <composite:interface componentType="customPanel"/> <!-- IMPLEMENTATION --> <composite:implementation> <h:outputText value="Some text:"/> <composite:insertChildren/> </composite:implementation> And step 3: <xyz:panel>Hello world!</xyz:panel>

Backing bean in composite component is recreated on every request

☆樱花仙子☆ 提交于 2019-12-18 03:45:45
问题 I have two variables "userId" and "name". When I click for example the "SHOW USERID" button it works fine and sets "renderUserId=true" and it shows it with the "render", but then if I click the other "SHOW" button, the Bean is reconstruct and I loose the "renderUserId=true" and it becomes "false" and "renderName=true" so it shows ok, but the USERID is hidden. My question is, how can I avoid loosing the bean values when I render the xhtml? This is a simple simulation of my code. NOTE: if I use

Primefaces outputLabel for composite component

泪湿孤枕 提交于 2019-12-17 22:42:53
问题 I have an issue with using p:outputLabel when used with composite component. I have composite component with p:inputText field (I removed irrelevant parts from component): <cc:interface> <cc:editableValueHolder name="myInput" targets="myInput"/> <cc:attribute name="required" required="true" type="java.lang.Boolean" default="false"/> </cc:interface> <cc:implementation> <p:inputText id="myInput" required="#{cc.attrs.required}"/> </cc:implementation> Now, I wont to use this component with p

Initialize a composite component based on the provided attributes

一个人想着一个人 提交于 2019-12-17 15:51:36
问题 I'm writing my custom table composite component with Mojarra JSF. I'm also trying to bind that composite to a backing component. The aim is to be able to specify the number of elements the table has in a composite attribute, later on the bound backing component will autogenerate the elements itself before view gets rendered. I've this sample code: Main page: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:comp=

Pass Argument to a composite-component action attribute

点点圈 提交于 2019-12-17 08:53:36
问题 The title really says it all. I have made an attempt which failed with the error: Illegal attempt to pass arguments to a composite component lookup expression (i.e. cc.attrs.[identifier]). My attempt looks like this: <composite:interface> <composite:attribute name="removeFieldAction" method-signature="void action(java.lang.String)" /> </composite:interface> <composite:implementation> <h:commandButton value="Remove" action="#{cc.attrs.removeFieldAction('SomeString')}"/> </composite

How to save state when extending UIComponentBase

 ̄綄美尐妖づ 提交于 2019-12-17 06:14:31
问题 I'm creating a composite component that will wrap a datatable to implement very simple paging. I need to save state (the current page number) between ajax requests. I tried creating fields in my FacesComponent, but I discovered they are wiped out during the JSF lifecycle: @FacesComponent(value = "bfTableComponent") public class BFTableComponent extends UIComponentBase implements NamingContainer { private int currentPageNumber; ... I can't seems to find a concise guide to doing this anywhere!

How to make a grid of JSF composite component?

懵懂的女人 提交于 2019-12-16 20:06:12
问题 I have lot's of outputLabel and inputText pairs in panelGrids <h:panelGrid columns="2"> <h:outputLabel value="label1" for="inputId1"/> <h:inputText id="inputId1/> <h:outputLabel value="label2" for="inputId2"/> <h:inputText id="inputId2/> ... </h:panelGrid> I want to have some behaviour for all of them: like same validation or same size for every inputText. So I have created a composite component which just includes an outputLabel and and an inputText <my:editField value="field1"/> <my

Get rendered html code in Backing Component from Composite Component

南楼画角 提交于 2019-12-14 04:20:07
问题 How can I get the posted form data in the backing component in the processUpdates method? @Override public void processUpdates(FacesContext context) { //get here rendered html code } Or can I get the posted form data in the decode method? [Edit]: My goal is to get the posted form data - Not to get the generated html code (Sry I wasn't precisely) 回答1: It is unclear what you want to achive, yet. I mean, at high level. UIComponent.decode and processUpdates are medium-level lifecycle APIs which

JavaScript composite component nested forms

纵然是瞬间 提交于 2019-12-13 20:54:24
问题 I have a simple composite component, which is nested in some form etc. I would like to bind the click event for all radio buttons in the <h:selectOneRadio> of this composite component. I am trying to bind this event by name property of inputs which will be created after <h:selectOneRadio id> . Unfortunetly it is nested, so this code doesn't work, because the generated radio button ID is like: "form:someid:someid:someid etc ect." Composite component code: <cc:implementation> <..some forms etc.

After adding second composite component Error <f:ajax> contains an unknown id

自作多情 提交于 2019-12-13 20:49:41
问题 I try to use composite components in my application. When i have added first component it has worked, but when i have added component once again, i have gotten error: "javax.servlet.ServletException: contains an unknown id 'j_idt202:kladrRegion-dctKladrRegion' - cannot locate it in the context of the component searchButton" This is code of implementation: <cc:interface> <!-- properties --> <cc:attribute name="isDisabled" type="java.lang.Boolean" /> <cc:attribute name="freeForm" type="java