hi I'm working with PrimeFaces. When I encountered this problem. I want to display the values I entered in the form while clicking the save button
and the XHTML file is
<!DOCTYPE html>
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
<title>
calender popup problem
</title>
</h:head>
<body>
<h:form>
<TABLE>
<tr>
<td><h:outputText value="*"/></td>
<td><h:outputText value="COUPOUN NAME" /></td>
<td><p:inputText id="coupounname" maxlength="50" value="#{office.coupounname}"/></td>
</tr>
<tr style="padding-top: 10px">
<td><h:outputText value="*"/></td>
<td><h:outputText value="COUPOUN CODE" /></td>
<td><p:inputText id="couponcode" value="#{office.coupouncode}"/></td>
</tr>
<tr style="padding-top:10px">
<td><h:outputText value="*"/></td>
<td><h:outputText value="COUPOUN DESCRIPTION"/></td>
<td><p:inputTextarea id="coupoundes" value="#{office.coupouncode}"/></td>
</tr>
<tr style="padding-top: 10px">
<td><h:outputText value= "*"/></td>
<td><h:outputText value="Discount"/></td>
<!-- <td>
<p:selectOneRadio id="radiobuttons" value="#{office.percentage}">
<f:selectItem itemLabel="in ruppes" itemValue="ByCash"/>
<f:selectItem itemLabel="inpercentage" itemValue="InPercentage"/>
</p:selectOneRadio>
</td> -->
</tr>
<tr>
<td><h:outputText value="*"/></td>
<td><h:outputText value="Validity"/></td>
<td><p:calendar value="#{office.startdate}"/></td>
<td><p:calendar value="#{office.enddate}"/></td>
</tr>
<tr>
<td><p:commandButton id="save" value="save" action="#{officebean.save}"/></td>
<td><p:commandButton id="cancel" value="cancel"/></td>
</tr>
</TABLE>
</h:form>
<ui:include src="dialogs.xhtml"/>
</body>
</html>
and the dialog is stored in the file
<p:dialog id="listdialog" visible="${officebean.dialogvisible eq 'Bean'} " dynamic="true" minHeight="120">
<h:form id="dialogform">
<h:outputText value=" the value entered by the users were"/>
<table>
<tr>
<td>name:=<h:outputText value="#{office.coupounname}"/></td>
<td>code:<h:outputText value="#{officebean.dialogvisible}"/</td>
</tr>
</table>
</h:form>
</p:dialog>
now the bean class which contains the action for save button which sets the condition which makes the dialog visible
#ManagedBean(name="officebean")
#RequestScoped
public class Officebean {
private List<Office>officeList;
private Office office;
private String Dialogvisible;
public void save() {
Dialogvisible="Bean";
}
public List<Office> getOfficeList() {
return officeList;
}
public void setOfficeList(List<Office> officeList) {
this.officeList = officeList;
}
public Office getOffice() {
return office;
}
public void setOffice(Office office) {
this.office = office;
}
public String getDialogvisible() {
return Dialogvisible;
}
public void setDialogvisible(String dialogvisible) {
Dialogvisible = dialogvisible;
}
}
but dialog is not showing up when save button is clicked any held would be appreciated
I'd guess you need to use
<h:body> instead of <body>
<p:dialog id="listdialog" widgetVar="listdialog".... >
<p:commandButton oncomplete="PF('listdialog').show()" ... />
and maybe remove visible from the dialog.
try
<p:commandButton id="save" value="save" action="#{officebean.save}" update="listdialog"/>
but if you want to show as a popup you are going to have to use
<p:commandButton id="save" value="save" action="#{officebean.save}" update="listdialog" oncomplete="#{p:widgetVar('listDialog')}.show();"/>
First you have to know that a dialog doesn't show until you call in some way the show() function...
if the other answers don't work for you maybe you can add in dialogs.xhtml this:
firt you have to add the widgetVar variable at the dialog like something like:
<p:dialog id="listdialog" visible="${officebean.dialogvisible eq 'Bean'} " dynamic="true" minHeight="120" widgetVar="listdialog">
Then outside the dialog something like:
<p:remoteCommand id="rc1" name="showDialog"oncomplete="PF('listdialog').show();" />
And to finish:
<script type="text/javascript">
showDialog();
</script>
This should open your dialog as soon you open the dialogs.xhtml....
Good luck!
Related
I have a JSF page where I can add or delete "planes" in my database (JBDC). To help with that I have two beans (Both #RequestScoped), one "controller" and one "backing bean".
Here is the JSF page:
And with some inputs:
After inputting info and adding a photo, the "airplane" is added to my page, and I reload the page.
Here is how the page looks after submitting:
My issue here is that, the input textfields gets "populated" from the bean with the info, and also the delete plane field gets populated with the airplane id. I want these fields to be empty after refreshing, and thats why I thought using #RequestScoped would be useful. Also, If I try to refresh the page from my web browser, it just tries to resend the form.
How can I avoid the fields being populated with data from the bean?
Also, here is bean code:
#Named
#RequestScoped
public class AddAirplaneCtrl implements Serializable{
#Inject
private FlightModel flightModel;
private ListAirplaneBB listAirplaneBB;
protected AddAirplaneCtrl(){
;
}
#Inject
public void addListAirplaneBB(ListAirplaneBB listAirplaneBB){
this.listAirplaneBB = listAirplaneBB;
}
public String addPlane(){
listAirplaneBB.setError(null);
listAirplaneBB.setMessage(null);
if(failed any of the validation parts){
return /some/site?faces-redirect=false";
}
//add plane
return /some/site?faces-redirect=true";
}
}
And the Backing Bean:
#Named
#RequestScoped
public class ListAirplaneBB implements Serializable{
#Inject
private FlightModel flightModel;
//private variable fields
public List<Airplane> getAllPlanes(){
return flightModel.getAirplaneList().findAll();
}
public int getTotalPlanes(){
return getAllPlanes().size();
}
//GETTERS and SETTERS
}
And finally my jsf page:
<div class="contbox">
<h3>
<h:outputLabel value="Edit Planes" />
</h3>
<c:if test="#{not empty listAirplaneBB.error}">
<div class="alert alert-danger"
id="success-alert">
<span class="glyphicon glyphicon-remove" />
<h:outputText value="#{listAirplaneBB.error}" />
<button type="button"
class="close"
data-dismiss="alert">
<h:outputLabel value="x" />
</button>
</div>
</c:if>
<c:if test="#{not empty listAirplaneBB.message}">
<div class="alert alert-success">
<span class="glyphicon glyphicon-remove" />
<h:outputText value="#{listAirplaneBB.message}" />
<button type="button"
class="close"
data-dismiss="alert">
<h:outputLabel value="x" />
</button>
</div>
</c:if>
<h4>Add A Plane</h4>
<h:form enctype="multipart/form-data">
<table id="addtable"
class="table">
<thead>
<tr>
<th>
<h:outputLabel value="Plane Make" />
</th>
<th colspan="1">
<h:outputLabel value="Plane Model" />
</th>
<th colspan="1">
<h:outputLabel value="Plane Seats" />
</th>
<th colspan="1">
<h:outputLabel value="Plane Photo" />
</th>
</tr>
</thead>
<tr>
<td>
<h:inputText value="#{listAirplaneBB.make}">
</h:inputText>
</td>
<td>
<h:inputText value="#{listAirplaneBB.model}">
</h:inputText>
</td>
<td>
<h:inputText value="#{listAirplaneBB.seats}">
</h:inputText>
</td>
<td>
<h:inputFile value="#{listAirplaneBB.file}" >
</h:inputFile>
</td>
<td>
<h:commandButton value="Add Plane"
class="btn btn-primary"
action="#{addAirplaneCtrl.addPlane()}" >
</h:commandButton>
</td>
</tr>
</table>
</h:form>
<h4>Delete Plane</h4>
<h:form>
<h:panelGrid columns="3" class="table">
<h:outputLabel value="Plane ID" />
<h:inputText value="#{listAirplaneBB.airPlaneId}"/>
<h:commandButton value="Delete"
class="btn btn-primary"
action="#{addAirplaneCtrl.deleteAirplane}" >
</h:commandButton>
</h:panelGrid>
</h:form>
</div>
Your browser cache the inputs.
JSF 2.2 Solution
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:pt="http://xmlns.jcp.org/jsf/passthrough">
...
<f:passThroughAttribute name="autocomplete" value="off"/>
...
jQuery Solution:
<h:form styleClass="form">...</h:form>
<script>
$(function(){
$(".form").attr("autocomplete", "off");
});
</script>
You can find more information here.
I am using to enter address field .by default am setting active-index="-1" so the panel will be closed when the page gets loaded.After the details has been entered by user i want the panel area which means i want the accordion panel to be closed on button(save) click.but i tried a lot using java script but am not able to achieve ,and here is page
<h:body>
<ui:composition template="/WEB-INF/templates/layout.xhtml">
<ui:define name="content">
<h:form id="quotesForm">
<div class="headerbg">
<div id="innerheaderbg">
<div id="iconarea">
<img src="#{request.contextPath}/images/headerimages/productlist.png" />
</div>
<div id="headertextarea">
<p class="headingtext">New Quote</p>
<p id="breadCrumbtext">Order <img src="#{request.contextPath}/images/error-bullet.gif" />
Quote List <img src="#{request.contextPath}/images/error-bullet.gif" />
New Quote
</p>
</div>
</div>
</div>
<p:growl id="msgs" />
<div class="widget widget-table action-table">
<div class="widget-header" style="text-align:center;padding-top: 52px">
<h3>Create New Quote</h3>
</div>
<div class="widget-content" style="background-color: #DAEDF4;height: 600px;" >
<div id="calender" style="margin-left: 52px;margin-top: -26px">
<table>
<tr>
<td>
<p:outputLabel id="qDate" value="#{quotesBean.qtCreationDate}"></p:outputLabel>
</td>
<td>
<p:calendar id="popup" showOn="button" display="inline" >
<p:ajax event="dateSelect" listener="#{quotesBean.onDateSelect}" update="qDate" />
</p:calendar>
</td>
</tr>
</table>
<p:outputLabel value="Invoice # #{quotesBean.qCount}" style="margin-top:-15px;margin-left:10px;"/>
</div>
<div id="company">
<table align="right" style="margin-right: 52px">
<thead>
<tr>
<th style="text-align: center;padding: 0;"><img src="#{request.contextPath}/images/favicon.ico"/><p:spacer width="5px"/>SolvEdge</th>
</tr>
</thead>
<tr><td style="text-align: center;padding: 0;">Zameen Pallavaram,</td></tr>
<tr><td style="text-align: center;padding: 0;">Chennai,</td></tr>
<tr><td style="text-align: center;padding: 0;">INDIA</td></tr>
</table>
</div>
<h:form id="addForm">
<p:accordionPanel id="accordion" cache="false" activeIndex="-1" style="margin-bottom:20px;width:330px;" widgetVar="acc" >
<p:tab title="Bill To Address:" titleStyle="width:330px;background-color:#DAEDF4" >
<h:panelGrid columns="2">
<h:outputLabel value="Name" />
<h:inputText value="#{quotesBean.name}"/>
<h:outputLabel value="Street" />
<h:inputText value="#{quotesBean.street}"/>
<h:outputLabel value="City" />
<h:inputText value="#{quotesBean.city}"/>
<h:outputLabel value="ZIP" />
<h:inputText value="#{quotesBean.zip}"/>
</h:panelGrid>
<p:commandButton icon="ui-icon-save" value="Save" action="#{quotesBean.saveAddress}" update=":quotesForm:addForm:accordion" ajax="false" onclick="PF('quotesForm:addForm:accordion').hide();"/>
</p:tab>
</p:accordionPanel>
</h:form>
</div>
</div>
<script type="text/javascript">
var link = document.getElementById('quotesForm:popup_input');
link.style.display = 'none';
function closeAccordianPanel()
{
var panel = document.getElementById('quotesForm:addForm:accordion');
link.style.activeIndex = '-1';
/* PF('widget_accordion').unselect(0); */
}
</script>
</h:form>
<br></br>
</ui:define>
</ui:composition>
</h:body>
</html>
Note:Java Script i tried here is nothing worked for me,i would like to close the accordion panel on button click.
I bet you have javascript errors in the console...(PF('quotesForm:addForm:accordion').hide(); is wrong, it should be PF('acc').hide(); IF it works at all (nothing about that in the PrimeFaces docs). And why close a ui component via javascript if you do an 'ajax="false"'. And sending a click event to the tab you want to toggle works, but even better is to use the official client-side api: PF('acc').unselect(...);
Ahhhh... you have additional code below the commandbutton... but there is a wrong widgetVar value... and it is commented out... and the other part does nothing...
Unselect(index of tab) method only hide the p:tab.
If you want to hide your accordionPanel, you can use rendered attribute.
Here is the panel:
<p:panel id="toggleable" header="Toggleable" toggleable="true"
toggleOrientation="horizontal" toggleSpeed="500" closeSpeed="500"
widgetVar="panel" class="left-menu-panel" >
</p:panel>enter code here`
and button or commandLink which collapse panel
<p:commandLink styleClass="open-left-menu-button"
onclick="PF('panel').toggle()">
</p:commandLink>
You can set it with toggleOrientation="horizontal/vertical".
normal panel - not collapsed
collapsed
I'm trying to implement a page that shows/hides elements based on the results of a backing bean method which is triggered by the key up event on an input. What I've written is behaving quite unexpectedly - the content inside my panelGroup does not change at all after page load, and instead a wild span is appearing at the top of the page containing the content I expected to be displayed in my outputText elements. This is a legacy application running on JSF 1.2 and richfaces 3.3, so its possible that this functionality might not be available (hinted at here). I also apologize for the use of tables, but unfortunately refactoring this big old app to use proper layout with css/divs is outside the scope of this feature request.
Here is my example jstl template which illustrates the problem. The "string1/2 reversed" outputpanels should only show if the string length is greater than 5, and the text in the outputText elements should be updated while typing in the inputs. Instead, the outputPanels stay static, and a new span is created above the table.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<head>
<title>ajax test</title>
</head>
<body>
<h:panelGroup id="wrapper">
<a4j:keepAlive beanName="AjaxTestBacking" />
<p />
<h:form>
<table>
<tr>
<td >string1:</td>
<td>
<h:inputText style="width: 200px" value="#{AjaxTestBacking.string1}">
<a4j:support event="onkeyup" action="#{AjaxTestBacking.updateString1}" reRender="string1panel"/>
</h:inputText>
</td>
</tr>
<h:panelGroup id="string1panel" rendered="#{AjaxTestBacking.displayString1Xform}">
<tr>
<td>string1 reversed:</td>
<td>
<h:outputText style="width: 200px" value="#{AjaxTestBacking.string1Xform}" />
</td>
</tr>
</h:panelGroup>
<tr>
<td>string2:</td>
<td>
<h:inputText style="width: 200px" value="#{AjaxTestBacking.string2}">
<a4j:support event="onkeyup" action="#{AjaxTestBacking.updateString2}" reRender="string2panel"/>
</h:inputText>
</td>
</tr>
<h:panelGroup id="string2panel" rendered="#{AjaxTestBacking.displayString2Xform}">
<tr>
<td>string2 reversed:</td>
<td >
<h:outputText style="width: 200px" value="#{AjaxTestBacking.string2Xform}" />
</td>
</tr>
</h:panelGroup>
</table>
</h:form>
</h:panelGroup>
</body>
</html>
and the backing bean:
import java.io.Serializable;
#SuppressWarnings("serial")
public class AjaxTestManager extends AbstractManager implements Serializable {
private String string1;
private String string2;
private String string1Xform;
private String string2Xform;
private Boolean displayString1Xform;
private Boolean displayString2Xform;
public AjaxTestManager() {
string1 = "test string 1";
string2 = "test string 2";
updateString1();
updateString2();
}
public void updateString1() {
string1Xform = new StringBuilder(string1).reverse().toString();
displayString1Xform =string1Xform.length() > 5 ? true : false;
}
public void updateString2() {
string2Xform = new StringBuilder(string2).reverse().toString();
displayString2Xform = string2Xform.length() > 5 ? true : false;
}
public String getString1() {
return string1;
}
public void setString1(String string1) {
this.string1 = string1;
}
public String getString2() {
return string2;
}
public void setString2(String string2) {
this.string2 = string2;
}
public String getString1Xform() {
return string1Xform;
}
public void setString1Xform(String string1Xform) {
this.string1Xform = string1Xform;
}
public String getString2Xform() {
return string2Xform;
}
public void setString2Xform(String string2Xform) {
this.string2Xform = string2Xform;
}
public Boolean getDisplayString1Xform() {
return displayString1Xform;
}
public void setDisplayString1Xform(Boolean displayString1Xform) {
this.displayString1Xform = displayString1Xform;
}
public Boolean getDisplayString2Xform() {
return displayString2Xform;
}
public void setDisplayString2Xform(Boolean displayString2Xform) {
this.displayString2Xform = displayString2Xform;
}
}
I apologize if I'm fundamentally misunderstanding something about richfaces here - I'm somewhat of a noob to richfaces ajax, so please bear with me! I shared this code with my colleague who built the app and he is stumped as well. I've searched on google and SO and found a javascript-based answer, but I'm trying to understand how to do this with richfaces components. Other questions: Is the 'rendered' attribute the way to go here with dynamically showing/hiding parts of the page, or should I be using the 'visible' attribute? also, is the 'reRender' attribute on a4j:support supposed to be the jsf/'server-side' id of the element as I originally understood it, or the rendered client-side element ID as indicated here? Just trying to figure out if I'm misunderstanding something, limited by my jsf/richfaces version, or just generally going crazy :)
I've seen similar behavior with JSF 2.1. When a rendered tag is present on an element, and you plan on showing/hiding the element via ajax, you should wrap it with another naming container and rerender the parent container instead. Something like this would do
<tr>
<td >string1:</td>
<td>
<h:inputText style="width: 200px" value="#{AjaxTestBacking.string1}">
<a4j:support event="onkeyup" action="#{AjaxTestBacking.updateString1}" reRender="string1panelLabel,string1panelValue"/>
</h:inputText>
</td>
</tr>
<tr>
<td>
<h:panelGroup id="string1panelLabel">
<h:panelGroup rendered="#{AjaxTestBacking.displayString1Xform}">
string1 reversed:
</h:panelGroup>
</h:panelGroup>
</td>
<td>
<h:panelGroup id="string1panelValue">
<h:panelGroup rendered="#{AjaxTestBacking.displayString1Xform}">
<h:outputText style="width: 200px" value="#{AjaxTestBacking.string1Xform}" />
</h:panelGroup>
</h:panelGroup>
</td>
</tr>
<tr>
Note that the panelGroup renders a span here, and the result is not legal html since span cannot exist between tr tags. Instead, the panelGroup should be within a td tag in the table. So, you'd have to have two sets of nested panelGroups to get around the problem. Alternatively, you could replace the html table with an h:panelGrid which generates an html but is friendlier to JSF.
As a side note, I use ui:fragment in JSF 2.1 since it makes the intention of showing/hiding that part of the screen more obvious than a panelGroup.
Firstly I would provide my configuration details:
JSF - 1.2
Icefaces - 1.8
Servlet - 2.5
I am trying to put an ice:selectBooleanCheckbox in a datatable. But, I am facing an expception repeatedly:
icelogin.jspx #54,59 value="#{o.checkBox}": ELResolver cannot handle a
null base Object with identifier 'o'
Here is my jspx code
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ice="http://www.icesoft.com/icefaces/component"
xmlns:ft="http://facestrace.sourceforge.net">
<f:view>
<head>
<title>JSF Jump start</title>
</head>
<body>
<ice:form>
<h3>User Name and Password</h3>
<table>
<tr>
<td>
<ice:outputLabel value="Name"/>
</td>
<td>
<ice:inputText value="#{userLogin.name}"/>
</td>
</tr>
<tr>
<td>
<ice:outputLabel value="Password"/>
</td>
<td>
<ice:inputText value="#{userLogin.password}"/>
</td>
</tr>
</table>
<ice:dataTable value="#{userLogin.orderList}" var="o">
<ice:column>
<!-- column header -->
<f:facet name="header">Order No</f:facet>
<!-- row record -->
#{o.orderNo}
</ice:column>
<ice:column>
<f:facet name="header">Product Name</f:facet>
#{o.productName}
</ice:column>
<ice:column>
<f:facet name="header">Price</f:facet>
#{o.price}
</ice:column>
<ice:column>
<!-- column header -->
<f:facet name="header">Checkbox</f:facet>
<!-- row record -->
<ice:selectBooleanCheckbox value="#{o.checkBox}"/>
<!-- #{o.checkBox} -->
</ice:column>
<ice:column>
<f:facet name="header">Quantity</f:facet>
#{o.qty}
</ice:column>
</ice:dataTable>
<ice:commandButton type="submit" value="Sign In" action="#userLogin.saveData}"/>
</ice:form>
</body>
</f:view>
</html>
If I remove checkBox value from #{o.checkBox} to true or false, it works. I presume that for true, the checkBox should be selected in UI, and false it must remain unselected. But, even if I put code like this
<ice:selectBooleanCheckbox value="true"/>
check button is being displayed in UI but is not showing up selected though the value is true. I am following this tutorial, in my case I have one more extra parameter in my bean.
boolean checkBox;
I have getters and setters in place, and passed to the constructor, all set. What could be wrong?
I have multiple forms that are populated by ThingPageBean. Each of these forms are submitted with a <h:commandButton> where the action is set to call #{thingPageBean.doAmazingThing(oneStuff)}. All fields are static except for contactEmail and contactPhone where I want to use <h:inputText> instead of <h:outputText> so that the user can set a new value if they wish.
The problem is that the new values are not bound to object that is received in doAmazingThing(OneStuff oneStuff) in the ThingPageBean. The old ones remain.
What am I doing wrong? Have I missed some crucial part?
My Bean:
#SuppressWarnings({"unchecked"})
#AutoCreate
#Name("thingPageBean")
#Scope(ScopeType.EVENT)
#Restrict("#{s:hasRole('admin')}")
public class ThingPageBean implements Serializable {
#In
StuffService stuffService;
#In
private StatusMessages statusMessages;
public String doAmazingThing(OneStuff oneStuff) {
return this.stuffService.doAmazingStuffToThing(oneStuff);
}
#Factory(value = "notHandledStuff")
public List<Stuff> notHandledStuff() {
return this.stuffService.searchNotHandledStuff();
}
}
My xhtml file:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:c="http://java.sun.com/jstl/core"
template="/layout/SiteTemplate.xhtml">
<ui:param name="robots" value="noindex"/>
<!-- hide blocks -->
<ui:param name="preContentHide" value="true"/>
<ui:define name="mainContent">
<c:set var="stuff" value="#{notHandledStuff}"/>
<s:div styleClass="section"
rendered="#{stuff == null or stuff.size==0}">
<h:outputText value="#{messages['stuff.no']}"/>
</s:div>
<s:div styleClass="section"
rendered="#{stuff != null and stuff.size>0}">
<br/>
<ui:repeat var="oneStuff" value="#{stuff}">
<h:form id="stuffForm">
<hr style="margin-top:8px;margin-bottom:4px;"/>
<table border="1">
<tr>
<td><b>Company name:</b></td>
<td width="780px"><h:outputText value="#{oneStuff.companyName}"/></td>
</tr>
<tr>
<td><b>street:</b></td>
<td><h:outputText value="#{oneStuff.street}"/></td>
<td/>
</tr>
<tr>
<td><b>zip:</b></td>
<td><h:outputText value="#{oneStuff.zip}"/></td>
<td/>
</tr>
<tr>
<td><b>city:</b></td>
<td><h:outputText value="#{oneStuff.city}"/></td>
<td/>
</tr>
<tr>
<td style="padding-top:10px"><b>contactPerson:</b></td>
<td><h:outputText value="#{oneStuff.contactPersonName}"/></td>
<td/>
</tr>
<tr>
<td><b>contactEmail:</b></td>
<td><h:inputText value="#{oneStuff.contactEmail}"/></td>
<td/>
</tr>
<tr>
<td><b>contactPhone:</b></td>
<td><h:inputText id="contactPhone" value="#{oneStuff.contactPhone}"/></td>
<td/>
</tr>
<h:commandButton id="submit" value="couple"
action="#{thingPageBean.doAmazingThing(oneStuff)}"/>
</td>
</tr>
</table>
</s:div>
</h:form>
</ui:repeat>
<hr style="margin-top:8px;margin-bottom:4px;"/>
</s:div>
<br/>
</div>
</ui:define>
</ui:composition>
Thank you
Jakob
I suggest to change your #Scope(ScopeType.EVENT)
The event (request) context: spans a server request, from restore view to render response.
to a page scope: #Scope(ScopeType.PAGE)
Begins during the invoke application phase prior to rendering a page, and lasts until the end of any invoke application phase of a faces request originating from that page. Non-faces requests do not propagate the page scope.
because you do need these data for a longer conversation not only an event (quotes from Seam Doc)
The problem seemed to be with multiple forms. Moved the <h:form> tag outside <ui:repeat> tag and voila everything works.