problem updating whole datatable with commanbutton.

UI Components for JSF
Post Reply
obilir
Posts: 3
Joined: 20 Oct 2010, 08:52

20 Oct 2010, 09:14

Hi,

First of all, thx for this great FW.

I have a problem with updating the whole datatable with one commanbutton.
(I`ve tried several ways using h:commandButton, a4j:commandButton and p:commandButton ;) )
The problem i; the data in the p:dataTable is posted null even though I fill the inputTexts in rows.
There is no problem when I use rich:dataTable or h:dataTable.

Here is the code;

Code: Select all

	<ui:define name="content">
		<h:outputText value="Sayfayı kullanmaya yetkiniz yok" rendered="#{sessionBean.user.faUserType != 0 && sessionBean.user.faUserType != 2 && sessionBean.user.faUserType != 3}"/>
		
		<rich:panel header="Raporlar / Ntf Raporu" rendered="#{sessionBean.user.faUserType == 0 || sessionBean.user.faUserType == 2 || sessionBean.user.faUserType == 3}">	
			<table>
				<h:form id="myform" prependId="false">
					<tr>
						<td><b>Liste</b></td>
						<td>
							<h:selectOneMenu value="#{reportNtfBean.listCode}" styleClass="input" >
								<f:selectItem />
								<f:selectItems value="#{reportNtfBean.listCodes}"/>
							</h:selectOneMenu>
						</td>
					</tr>

					<a4j:outputPanel rendered="#{sessionBean.user.faUserType == 0 || sessionBean.user.faUserType == 2}">
						<tr>
							<td><b>Kullanici</b></td>
							<td>
								<h:selectOneMenu value="#{reportNtfBean.userCode}" styleClass="input" >
									<f:selectItem />
									<f:selectItems value="#{reportNtfBean.userCodes}"/>
								</h:selectOneMenu>
							</td>
						</tr>
					</a4j:outputPanel>

					<tr>
						<td><b>Raporlama Tarihi</b></td>
						<td>
							<rich:calendar id="startDate" firstWeekDay="1"
								value="#{reportNtfBean.startDate}" inputClass="input"
								datePattern="ddMMyyyy" locale="tr" inputStyle="width:70px;"
								enableManualInput="false"/>
							<h:outputText value=" - " />						
							<rich:calendar id="endDate" firstWeekDay="1"
								value="#{reportNtfBean.endDate}" inputClass="input"
								datePattern="ddMMyyyy" locale="tr" inputStyle="width:70px;"
								enableManualInput="false"/>						
						</td>
					</tr>
					<tr>
						<td colspan="3">
							<h:commandButton action="#{reportNtfBean.generateReport}" value="RAPOR" styleClass="rich-button" onclick="showLoading();"/>
							<h:outputText value=" "/>
							<h:commandButton value="EXCEL" styleClass="rich-button" rendered="#{reportNtfBean.reportGenerated}">
								<p:dataExporter type="xls" target="mytable" fileName="reportNtf" />
							</h:commandButton>
						</td> 
					</tr>
					<tr>
						<td colspan="3">
							<h:messages id="errorMessages" errorClass="messageerror" fatalClass="messagefatal" infoClass="messageinfo" warnClass="messagewarn" />
						</td>
					</tr>
					<tr>
						<td colspan="3">
							<p:dataTable var="row" id="mytable" value="#{reportNtfBean.list}" paginator="false" rendered="#{reportNtfBean.reportGenerated}">
								<p:column>
									<f:facet name="header">
										<h:outputText value="Bağlı Bilet No" />
									</f:facet>
									<h:outputText value="#{row.idTktLast}" />
								</p:column>
								<p:column>
									<f:facet name="header">
										<h:outputText value="Bilet No" />
									</f:facet>
									<h:outputText value="#{row.idTktNo}" />
								</p:column>
								<p:column>
									<f:facet name="header">
										<h:outputText value="Ofis" />
									</f:facet>
									<h:outputText value="#{row.office}" />
								</p:column>
								<p:column>
									<f:facet name="header">
										<h:outputText value="Acente" />
									</f:facet>
									<h:outputText value="#{row.dsAgent}" />
								</p:column>
								
								<p:column>
									<f:facet name="header">
										<h:outputText value="NTF Düz. Mahal" />
									</f:facet>
									<h:outputText value="#{row.ntfOfficeExp}" />
								</p:column>
								<p:column>
									<f:facet name="header">
										<h:outputText value="NTF Düz. Ofis/Acente" />
									</f:facet>
									<h:outputText value="#{row.ntfAgency}" />
								</p:column>
								<p:column>
									<f:facet name="header">
										<h:outputText value="Açıklama" />
									</f:facet>
									<h:outputText value="#{row.descTrk}" />
								</p:column>
								<p:column>
									<f:facet name="header">
										<h:outputText value="Ntf Açıklaması" />
									</f:facet>
									<h:outputText value="#{row.ntfReasonExp}" />
								</p:column>
								<p:column>
									<f:facet name="header">
										<h:outputText value="Ntf Açıklaması" />
									</f:facet>
									<h:outputText value="#{row.chkTxt}" />
								</p:column>
								<p:column parser="number" styleClass="right">
									<f:facet name="header">
										<h:outputText value="Ntf Miktarı" />
									</f:facet>
									<h:outputText value="#{row.ntfAmount}" />
								</p:column>
								<p:column>
									<f:facet name="header">
										<h:outputText value="Kur" />
									</f:facet>
									<h:outputText value="#{row.ntfCurr}" />
								</p:column>
								<p:column>
									<f:facet name="header">
										<h:outputText value="NTF / ADM No" />
									</f:facet>
									<h:outputText value="#{row.ntfAdmNo}" rendered="#{sessionBean.user.faCode != row.userCode}"/>
									<h:inputText value="#{row.ntfAdmNo}" rendered="#{sessionBean.user.faCode == row.userCode}" styleClass="input" size="15" maxlength="10"/> 
								</p:column>
								<p:column>
									<f:facet name="header">
										<h:outputText value="Maliye Bakanlığı No" />
									</f:facet>
									<h:outputText value="#{row.ministryOfFinanceNo}" rendered="#{sessionBean.user.faCode != row.userCode}"/>
									<h:inputText value="#{row.ministryOfFinanceNo}" rendered="#{sessionBean.user.faCode == row.userCode}" styleClass="input" size="8" maxlength="6"/> 
								</p:column>
								<p:column>
									<f:facet name="header">
										<h:outputText value="Liste" />
									</f:facet>
									<h:outputText value="#{row.assignmentName}" />
								</p:column>
								<p:column>
									<f:facet name="header">
										<h:outputText value="Kullanıcı" />
									</f:facet>
									<h:outputText value="#{row.userName}" />
								</p:column>
							</p:dataTable>
						</td>
					</tr>
					<tr>
						<td>
							<h:commandButton action="#{reportNtfBean.save}" value="KAYDET" rendered="#{reportNtfBean.reportGenerated}" styleClass="rich-button" onclick="showLoading();"/>
						</td>
					</tr>
				</h:form>		
			</table>
		</rich:panel>		
	</ui:define>

Code: Select all

...
	public String save() {
		TkUtil.write("SAVE()");
		for(int i=0; i < list.size(); i++) {
			TkUtil.write(list.get(i).getIdTktNo()+" "+list.get(i).getNtfAdmNo());  //here is the part I get null for the part I`ve filled int the rows
		}
                ....
		return "";
	}
...

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

20 Oct 2010, 09:56

Hi,

Which PrimeFaces and JSF version are you using?

Please see;

http://primefaces.prime.com.tr/forum/vi ... f=3&t=1194

obilir
Posts: 3
Joined: 20 Oct 2010, 08:52

20 Oct 2010, 10:13

Hi,

I`m using
PrimeFaces 1.1.3
JSF 1.2.13
RichFaces 3.3.3

Tomcat 6.0
Jdk 1.5.0_11

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

20 Oct 2010, 10:31

1.1.3? I'm not aware of such a release? Do you mean 1.1? Note that PF 1.x for JSF 1.2 is not developed/maintained anymore, PrimeFaces is actively developed for JSF 2.0. So when you face bugs, they won't be fixed or fixed already in PrimeFaces 2.x.

obilir
Posts: 3
Joined: 20 Oct 2010, 08:52

20 Oct 2010, 10:35

Sorry, PF 1.1

I hope this is not a bug and it`s something I`ve coded wrong, couse we are using JSF 1.2 and have to use PF 1.1...

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 8 guests