You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Michael Südkamp <mi...@docware.de> on 2006/08/17 16:11:09 UTC
adding checkbox to tomahawk treetable
Hi,
I have the following question. I'm modifying the treetable example from the
tomahawk samples. For a columns you would find blocks like this.
<h:column>
<f:facet name="header">
<h:outputText value="Description" />
</f:facet>
<h:outputText value="#{treeItem.description}" />
</h:column>
Now I would like to display a checkbox rather then a static text. So I
modified this to
<h:column>
<f:facet name="header">
<h:outputText value="" />
</f:facet>
<h:selectBooleanCheckbox value="#{treeItem.selected}"
styleClass="checkbox"/>
</h:column>
This displays fine. But there's a problem with the name attribute of the
checkboxes. They all have the same name, e.g. "f:_id5" and this leads
obviously to confusion when submitting the form.
My questions are
1. why does JSF not apply different name attributes automatically?
2. I tried to set the IDs manually by
<h:column>
<f:facet name="header">
<h:outputText value="" />
</f:facet>
<h:selectBooleanCheckbox id="cb#{treeItem.id}"
value="#{treeItem.selected}" styleClass="checkbox"/>
</h:column>
But it seems that you cannot set ID attributes by expression language. I
always get errors like "# is not allowed character"
Can you help?
Michael
Re: adding checkbox to tomahawk treetable
Posted by nimisha sharma <ni...@gmail.com>.
Hi Michael,
I am myself struggling with the jenia-dataTools jar.. coz we are using jsf
with spring and it is not compatible with that (jsf-spring jar provided by
de.mindmatters) .. I dissected the jar file.. :-) and found out that in
META-INF, the file jenia-dataTools-config.xml does not have a doc type
declaration.. This file has been accessed in faces-config.xml in META-INF
folder... still trying to get this working. will let you know if i find
anything.. In the mean time, you can also try modifying that and keep in
touch with any observations that you have.. :-)
Best Regards,
Nimisha.
On 8/18/06, Michael Südkamp <mi...@docware.de> wrote:
>
> Thanks Nimisha,
>
> First, from
> http://myfaces.apache.org/impl/tlddoc/h/selectBooleanCheckbox.html I
> learned
> that the component ID indeed can not be set by EL :-(
>
> I had a look at www.jenia.org. I saw their table multiple selection
> example
> which you are probably refering to. I am able to deploy their demo war to
> see the same examples as on their website.
> However, So far I have been unable to integrate the
> jdt:multipleRowsSelector
> tag into the Tomahawk treeview example. I added a column as follows.
>
> <h:column>
> <jdt:multipleRowsSelector
> selectionList="#{treeTable.selectedList}"/>
> </h:column>
>
> When executing I get the exception
>
> java.lang.NullPointerException
> at
>
> org.jenia.faces.datatools.renderkit.html.MultipleRowsSelectorRenderer.encode
> Begin(MultipleRowsSelectorRenderer.java:86)
> at
> javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java
> :317)
> at
> org.apache.myfaces.renderkit.RendererUtils.renderChild(RendererUtils.java
> :48
> 5)
> at
> org.apache.myfaces.renderkit.RendererUtils.renderChildren(
> RendererUtils.java
> :471)
> at
> org.apache.myfaces.renderkit.RendererUtils.renderChild(RendererUtils.java
> :49
> 2)
> at
>
> org.apache.myfaces.custom.tree.renderkit.html.HtmlTreeRenderer.renderChildre
> n(HtmlTreeRenderer.java:329)
> at
>
> org.apache.myfaces.custom.tree.renderkit.html.HtmlTreeRenderer.renderChildre
> n(HtmlTreeRenderer.java:250)
> at
> org.apache.myfaces.custom.tree.renderkit.html.HtmlTreeRenderer.encodeEnd
> (Htm
> lTreeRenderer.java:108)
> at
> javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:341)
> at org.apache.myfaces.custom.tree.HtmlTree.encodeEnd(HtmlTree.java
> :755)
> ....
>
> Can you help?
>
> Michael
>
>
Debugging into MyFaces with Intellij IDEA
Posted by Michael Südkamp <mi...@docware.de>.
Hello,
I set up a MyFaces 1.1.5-snapshot with Intellij IDEA as described here
http://wiki.apache.org/myfaces/JetBrains_IntelliJ_IDEA.
First of all thanks for the excellent description and the Maven build
process.
I can now run the web modules, e.g. myfaces-examples-simple, from the IDE.
But what I can't is to debug into MyFaces. I would like to debug the
renderer classes for a better understanding.
What I saw is that the web modules have the MyFaces libs set up as module
libraries, so it's obvious why my source code breakpoints will be ignored.
Does anyone want to discuss with me how to change the IDEA project setup?
Michael
AW: adding checkbox to tomahawk treetable
Posted by Michael Südkamp <mi...@docware.de>.
Thanks Nimisha,
First, from
http://myfaces.apache.org/impl/tlddoc/h/selectBooleanCheckbox.html I learned
that the component ID indeed can not be set by EL :-(
I had a look at www.jenia.org. I saw their table multiple selection example
which you are probably refering to. I am able to deploy their demo war to
see the same examples as on their website.
However, So far I have been unable to integrate the jdt:multipleRowsSelector
tag into the Tomahawk treeview example. I added a column as follows.
<h:column>
<jdt:multipleRowsSelector
selectionList="#{treeTable.selectedList}"/>
</h:column>
When executing I get the exception
java.lang.NullPointerException
at
org.jenia.faces.datatools.renderkit.html.MultipleRowsSelectorRenderer.encode
Begin(MultipleRowsSelectorRenderer.java:86)
at
javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:317)
at
org.apache.myfaces.renderkit.RendererUtils.renderChild(RendererUtils.java:48
5)
at
org.apache.myfaces.renderkit.RendererUtils.renderChildren(RendererUtils.java
:471)
at
org.apache.myfaces.renderkit.RendererUtils.renderChild(RendererUtils.java:49
2)
at
org.apache.myfaces.custom.tree.renderkit.html.HtmlTreeRenderer.renderChildre
n(HtmlTreeRenderer.java:329)
at
org.apache.myfaces.custom.tree.renderkit.html.HtmlTreeRenderer.renderChildre
n(HtmlTreeRenderer.java:250)
at
org.apache.myfaces.custom.tree.renderkit.html.HtmlTreeRenderer.encodeEnd(Htm
lTreeRenderer.java:108)
at
javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:341)
at org.apache.myfaces.custom.tree.HtmlTree.encodeEnd(HtmlTree.java:755)
....
Can you help?
Michael
Debugging into MyFaces with Intellij IDEA
Posted by Michael Südkamp <mi...@docware.de>.
Hello,
I set up a MyFaces 1.1.5-snapshot with Intellig IDEA as described here
http://wiki.apache.org/myfaces/JetBrains_IntelliJ_IDEA.
First of all thanks for the excellent description and the Maven build
process.
I can now run the web modules, e.g. the Tomahawk samples, from the IDE. But
what I can't is to debug into MyFaces. I would like to debug the renderer
classes.
What I saw is that the web modules have the MyFaces libs set up as module
libraries, so it's obvious why my source code breakpoints will be ignored.
Can you tell me how to change the setup?
Michael
Re: adding checkbox to tomahawk treetable
Posted by nimisha sharma <ni...@gmail.com>.
if you want to display the checkboxes only, i dont think you would be having
a prob but if u want to submit the page n get the values of the selected
checkboxes in your bean.. i think it wud b a lil prob.. coz i cudnt use
checkboxes in a datatable even.. tree table is still ahead of that..
for the datatable, i used jars provided by jenia.. you can check that out if
that helps..
Regards,
Nimisha.
On 8/17/06, Michael Südkamp <mi...@docware.de> wrote:
>
> Hi,
>
> I have the following question. I'm modifying the treetable example from
> the
> tomahawk samples. For a columns you would find blocks like this.
>
> <h:column>
> <f:facet name="header">
> <h:outputText value="Description" />
> </f:facet>
> <h:outputText value="#{treeItem.description}" />
> </h:column>
>
> Now I would like to display a checkbox rather then a static text. So I
> modified this to
>
> <h:column>
> <f:facet name="header">
> <h:outputText value="" />
> </f:facet>
> <h:selectBooleanCheckbox value="#{treeItem.selected}"
> styleClass="checkbox"/>
> </h:column>
>
> This displays fine. But there's a problem with the name attribute of the
> checkboxes. They all have the same name, e.g. "f:_id5" and this leads
> obviously to confusion when submitting the form.
>
> My questions are
>
> 1. why does JSF not apply different name attributes automatically?
>
> 2. I tried to set the IDs manually by
>
> <h:column>
> <f:facet name="header">
> <h:outputText value="" />
> </f:facet>
> <h:selectBooleanCheckbox id="cb#{treeItem.id}"
> value="#{treeItem.selected}" styleClass="checkbox"/>
> </h:column>
>
> But it seems that you cannot set ID attributes by expression language. I
> always get errors like "# is not allowed character"
>
> Can you help?
>
> Michael
>
>