How to use <ui:repeat> tag inside datalist: primefaces mobile? - jsf

Sorry im just a beginner both in english and primefaces mobile.
I want to use ui:repeat within a datalist to do something like:
<p:dataList id="data" var="tache" value="#{affect.listeDesTaches}">
<p:panel id="basic" header="Taches n° #{tache.idTache}" style="padding-bottom:40px">
<ui:repeat id="etapesId" var="etapes" value="#{taches.liste}" >
<p:panelGrid columns="6">
<p:commandButton value="#{etapes.idEtape}" type="button"/>
<p:commandButton value="#{etapes.name}" type="button"/>
<p:commandButton value="#{etapes.description}" type="button"/>
<p:commandButton value="#{etapes.dimension}" type="button"/>
<p:commandButton value="#{etapes.tempsFab}" type="button"/>
<p:commandButton value="#{etapes.reste}" type="button"/>
</p:panelGrid>
</ui:repeat>
</p:panel>
</p:dataList>
but it not working in primefaces mobile.I have no error message and all the information in the interior of "ui-repeat" are not displayed. please help.
PS: i'm using primefaces mobile 0.9.4 and primefaces 5.0

there is a typo. please use value="#{tache.liste}" instead of value="#{taches.liste}".

Related

Primefaces CommandLink target blank not work properly

I'm trying to open a new window from dataTable using primefaces. I've tried differents options:
h:commandLink
<h:form id="form" target="_blank">
<p:dataTable id="Table" var="var_row" value="#{bean.table}" sortBy="tableId" >
<p:column>
<h:commandLink action="#{bean.goToPage}" value="Open Page"
onblur="this.form.target='_self'">
<f:setPropertyActionListener value="#{var_row}" target="#{bean.rowSelected}" />
</h:commandLink>
</p:column>
</p:dataTable>
</h:form>
2.p:commandLInk
<h:form id="form" target="_blank">
<p:dataTable id="Table" var="var_row" value="#{bean.table}" sortBy="tableId" >
<p:column>
<p:commandLink action="#{bean.goToPage}" value="Open Page"
onblur="this.form.target='_self'"
process="#this" ajax="false" target="_blank">
<f:setPropertyActionListener value="#{var_row}" target="#{bean.rowSelected}" />
</p:commandLink>
</p:column>
</p:dataTable>
</h:form>
It works, but not correctly. I mean, I get the new page open, but the original page becomes useless, all methods in this pages are not invoked when you clicked on them.
Has anyone experimented this before? Any idea to solve this?
I tried and I still couldn't get a 'commandLink' to open in a new window while at the same time using 'setPropertyActionListener'. I think you have to modify the underlying Primefaces javascript to open in a new window (I didn't try that).
You can try passing a parameter argument.

JSF programmatically component in Primefaces Tab

I created some programmatily component in a Primefaces Tab.
<h:form>
<p:tabView id="documentDetailsTabs" dynamic="true" cache="true" >
<p:tab id="contenutoTab" title="#{msg['content']}" >
<p:panelGrid columns="4" style="width:100%"
styleClass="table-4col-noborder"
binding="#{documentContentController.propertiesGridComponentModify}"
columnClasses="label-col-4col, value-col-4col,label-col-4col, value- col4col">
</p:panelGrid>
<p:commandButton value="Save"
styleClass="buttonStyle"
process="#form"
action="#{documentContentController.checkInAction}"
/>
</p:tab>
</p:tabView>
</h:form>
The form data aren't setted in backing bean of components. If I move the p:panelGrid component out of the p:tabView the code works.
I'm using Primefaces 3.2 and JSF 2.1.
Can you help me, please?

EL parameter not working in primefaces tooltip

I get a javax.el.PropertyNotFoundException value="#{col.getValue(row)}": Property 'getValue' not found on the tooltip line. The other #{col.getValue(row)} in the outputPanel and outputText evaluate just fine, which makes me believe there might be a bug in primefaces. Am I doing something wrong? Is there a workaround?
<p:dataTable id="myTable" var="row" value="#{myBean.getRows(5)}">
<p:columns var="col" headerText="#{col.name}" value="#{myBean.columns}">
<p:outputPanel id="tableColumn">
#{col.getValue(row)}
</p:outputPanel>
<h:outputText value="#{col.getValue(row)}" />
<p:tooltip for="tableColumn" value="#{col.getValue(row)}" />
</p:columns>
</p:dataTable>
Using Tomcat 7.0.39 and Primefaces 3.5
Just write #{col.Value(row)} or #{col.value(row)}

Primefaces DataGrid - CommandLink is not working

i have an issue with nested UI components which is probably a known bug in PrimeFaces and Mojara. However I have no idea how can i solve it.
We have a image gallery with uploader and I want to be able to delete images from the datagrid, so
XHTML:
<h:form enctype="multipart/form-data">
<p:fileUpload fileUploadListener="#{pictureManagementBean.handleFileUpload}"
mode="advanced"
update="gallery messages"
auto="true"
allowTypes="/(\.|\/)(gif|jpe?g|png)$/"
/>
<p:growl id="messages" showDetail="true"/>
<p:dataGrid var="item" value="#{pictureManagementBean.pictures}" id="gallery">
<p:panel header="#{item.pictureName}" style="text-align:center">
<h:panelGrid columns="1" style="width:100%">
<p:graphicImage value="#{item.thumbnailDir}" />
<h:outputText value="#{item.createdate.toString()}" />
<p:commandLink value="Delete"
action="#{pictureManagementBean.removePicture(item.idpicture)}" ajax="false"/>
</h:panelGrid>
</p:panel>
</p:dataGrid>
</h:form>
Basically what is not working at the momment - at all - is the commandLink Delete in the DataGrid. The rest is fine.
Is there any walkaround to this? I've tried: columns, ajax, no ajax... nothing works. All i can do is get the button outside the DataGrid. But that's not really what I want.
Any help apprecieated.
[small thing: surprisingly I have used commandLink in DataTable and Columns with no problem! ]
Primefaces 3.4RC1 from maven. (didnt work on 3.3.1 either)
ok so I've found one thing:
inside <p:dataGrid> if I use anything BUT p:columns its not working.
But then the view is terrible... should I just use CSS to fix it?
#Maple_shaft you are so right!
correct code:
<p:dataGrid var="item" value="#{pictureManagementBean.pictures}" id="gallery">
<p:column>
<p:panel header="#{item.pictureName}" style="text-align:center">
<h:panelGrid columns="1" style="width:100%">
<p:graphicImage value="#{item.thumbnailDir}" />
<h:outputText value="#{item.createdate.toString()}" />
<p:commandLink value="Delete"
action="#{pictureManagementBean.removePicture(item.idpicture)}" ajax="false"/>
</h:panelGrid>
</p:panel>
</p:column>
</p:dataGrid>
So just simple column element. I've just places it wrong before. Thanks so much.
Of course backing bean is #ViewScoped!

Cannot find component with identifier in view

I have a problem are that when I try update a component that not are in same xhtml.
Somebody know how to do?
thx
PD: im using primefaces 3.2
Sorry for my english
I think that I dnot explain very well.
I have a xhtml father with tis structure:
<h:panelGrid id="tabla">
<h:form id="formTripu" prependId="false">
<h:panelGrid id="fichaTripulante">
<ui:include src="path1" />
<p:spacer height="5px" />
<p:tabView dynamic="false" cache="true">
<p:tab title="#{bundleTrip.datosAdministrativos}">
<ui:include
src="path2" />
</p:tab>
<p:tab title="Datos Operativos ">
<ui:include
src="path3" />
</p:tab>
I wish to do are when for example in path1 I use a h:selectBooleanCheckbox like:
<h:selectBooleanCheckbox inmediate="true" id="checkExt"
value="#{bean.Obj.field}">
<f:ajax render="estadoTripu"
actionListener="#{bean.method}" />
</h:selectBooleanCheckbox>
estadoTripu are in path2 (otherxthml but in same form).
<p:panel>
<h:panelGrid id="datos" columns="5">
<p:column>
<h:selectOneMenu id="estadoTripu"
value="#{bean.Obj.Field2}">
<f:selectItems
value="#{bean.list}" var="item"
itemValue="#{item.id}" immediate="true"
itemLabel="#{item.desc}">
</f:selectItems>
</h:selectOneMenu>
</h:panelGrid>
</p:column>
</h:panelGrid>
</p:panel>
Witch is paht in render o f:ajax????
thx everyone
try this: (Its a trick I learned from BalusC :) )
add binding="#{components.mySelecOneMenu}" to your h:selectOneMenu
<h:selectOneMenu binding="#{components.mySelecOneMenu}" .....
This how you button should look like (more or less)
<h:commandButton value="doSomeThing">
<f:ajax render="#{components.mySelecOneMenu.clientId}"/>
</<h:commandButton>
add this to your faces-config.xml
<managed-bean>
<description>Holder of all component bindings.</description>
<managed-bean-name>components</managed-bean-name>
<managed-bean-class>java.util.HashMap</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
Here some detailed explanation of what I just recommend you to do
How do I break the tyranny of the clientID?
JSF component binding without bean property
if they are not in the same xhtml, do you include one in the other? If not, just change page and it will show the correct one.
But I don't think I correctly understand your question.
Add some code please
I find that component should be in same form an call ids start in form to component, its prefered put id every panelgrid, panel, etc because you have to call every component englobe comoponent that you want render.

Resources