dynamic panels with ace:list and binding attribute not displaying panels  XML
Forum Index -> Components
Author Message

Joined: 03/Oct/2016 06:55:10
Messages: 3

Hello All,
I am creating dynamic panels with one child inside. The child is a textArea. I see that icefaces has an ace:list that lets change the order of the panels on the UI. I like this feature so I want to render the the dynamic panels using ace:list.

There is an issue though that i can not figure out with rendering with ace:list

Here is how i setup my panels. Very simple
List<Panel> panelList = new ArrayList<Panel>();
 Panel panel = new Panel();
 HtmlInputTextarea uiTextBox = new HtmlInputTextarea();

If i use a forach loop like this. It prints out the panels and it children successfully.
<ace:panel header="Foreach">
 	<c:forEach items="#{dynamicPanelBean.panelList}" var="panel" >
 		<ace:panel binding="#{panel}"/>

If i use an ace list to render the panels then an empty panel is rendered and none of children are rendered.
<ace:panel header="List">
 		<ace:list value="#{dynamicPanelBean.panelList}" var="panel">
 			 <ace:panel binding="#{panel}" ></ace:panel>

My thoughts

It does not seem that the binding attribute is read when ace list is printing the elements. Maybe the ace:list was not designed to do this.

Joined: 20/Feb/2007 00:00:00
Messages: 1396

It's more likely the problem is the binding attribute on the panel, but why use binding when it is not considered good design (and unneccessary?).

Your list is the only thing that needs to be dynamic in your backing bean. Since a textEntry takes a string as input, then you just need two List<String>...one for the original list and another for the one your user will create with the <ace:list> component and your originalList:-
<ace:listControl id="dualList".......">
<f:facet name="header">
Dual Header
<ace:list id="firstList" value="#{backing.stringFirstList}"/>

<ace:list id="secondList" value="#{backing.stringSecondList}"
<h:panelGrid columns="1" id="hurf">
<ace:textEntry value=#{item} />
<f:facet name="header">
<h:outputText value="If not simple String list can have a title too" /><hr/>
<ace:textEntry value=#{item} />

Of course, this is a list full on input components, so not sure that's what you actually meant....you may want a "readonly" attribute on there that you can modify if you actually want input ability, but you get the idea. You can use the f:facet for a header on the block item that you want in the list (no need for an ace:panel, but you could most likely use that as well with a header value in your list object).
lots of ways to do this without component binding. (which has limitations in JSF since it needs to be in Request scope, etc).
Forum Index -> Components
Go to:   
Powered by JForum 2.1.7ice © JForum Team