[JBoss Seam] - Re: ajax and EntityHome (Conversation) bug?!
by mrohad
what i am trying to do here is:
a table of customers
when someone clikc on spesfic row(customer) then I show a pop-up
with the customer details
and then I would like to change the details and press update.
when I add the following code to pages.xml:
| <page view-id="/customer/index.xhtml" action="#{conversation.begin}">
| </page>
my pop up is showing empty fields :(
\here is my xhtml all over again , shorter..
| <?xml version="1.0" encoding="Windows-1255" ?>
| <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
|
| <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:a4j="https://ajax4jsf.dev.java.net/ajax"
| xmlns:rich="http://richfaces.ajax4jsf.org/rich"
| template="/layout/template.xhtml">
|
| <ui:define name="body">
|
| <h:messages globalOnly="true" styleClass="message" id="globalMessages" />
| <!-- FILTER -->
| <a4j:form id="customerSearch" styleClass="edit" dir="rtl">
| <rich:simpleTogglePanel label=" ????? ?????? "
| switchType="client" style="direction:rtl">
|
| <s:decorate template="/layout/display.xhtml">
| <ui:define name="label">name</ui:define>
| <h:inputText id="name" value="#{customerList.customer.name}" />
| </s:decorate>
|
|
| </rich:simpleTogglePanel>
|
|
|
| <div class="actionButtons">
| <a4j:commandButton
| reRender="customerTable" value="filter" /></div>
|
|
| <rich:panel id="customerTable">
| <f:facet name="header">table</f:facet>
| <div class="results" id="customerList">
|
| <a4j:region >
| <rich:dataTable
| onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
| onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
| id="customerListTable" var="customer" value="#{customerList.customers}"
| rowKey="#{customer.id}" rowKeyVar="custId" >
|
|
| <rich:column>
| <f:facet name="header">
| <s:link styleClass="columnHeader"
| value="id #{customerList.order=='id asc' ? messages.down : ( customerList.order=='id desc' ? messages.up : '' )}">
| <f:param name="order"
| value="#{customerList.order=='id asc' ? 'id desc' : 'id asc'}" />
| </s:link>
| </f:facet>
| #{customer.id}
| </rich:column>
| <rich:column>
| <f:facet name="header">
| <s:link styleClass="columnHeader"
| value="name #{customerList.order=='name asc' ? messages.down : ( customerList.order=='name desc' ? messages.up : '' )}">
| <f:param name="order"
| value="#{customerList.order=='name asc' ? 'name desc' : 'name asc'}" />
| </s:link>
| </f:facet>
| #{customer.name}
| </rich:column>
|
| <a4j:support event="onRowClick"
| oncomplete="javascript:Richfaces.showModalPanel('custForm:panel')"
| reRender="panel" data="#{rowKey}"
| actionListener="#{customerHome.selectCustomerFromTable}">
| <s:conversationId/>
| <a4j:actionparam name="cust" id="cust" assignTo="#{customerHome.id}" value="#{customer.id}"/>
| </a4j:support>
|
| </rich:dataTable>
| </a4j:region>
| </div>
| </rich:panel></a4j:form>
| <!-- POPUP -->
| <a4j:region id="popupregion">
| <a4j:form id="custForm">
| <rich:modalPanel id="panel" width="400" height="400">
| <f:facet name="header">
| <h:outputText value="edit customer" />
| </f:facet>
|
| <h:panelGrid columns="1">
| <s:decorate template="/layout/display.xhtml">
| <ui:define name="label">id</ui:define>
| <h:inputText id="custId" value="#{customerHome.instance.id}" />
| </s:decorate>
| <s:decorate template="/layout/display.xhtml">
| <ui:define name="label">name</ui:define>
| <h:inputText id="name" value="#{customerHome.instance.name}" />
| </s:decorate>
|
|
| <a4j:commandButton id="updateCustomerButton" reRender="customerListTable" action="#{customerHome.update}" ajaxSingle="true" value="UPDATE"
| oncomplete="javascript:Richfaces.hideModalPanel('custForm:panel')" >
| <s:conversationId/>
| </a4j:commandButton>
| <h:commandButton onclick="javascript:Richfaces.hideModalPanel('custForm:panel')" value="close"></h:commandButton>
| </h:panelGrid>
|
| </rich:modalPanel>
| </a4j:form>
| </a4j:region>
|
|
| </ui:define>
| </ui:composition>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4075459#4075459
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4075459
18Â years, 10Â months
[JBoss Seam] - exception
by atao
In a page with only a h:outputText and a h:form, as soon as I click on the submit button of the form, I get this exception
anonymous wrote :
| 12:23:22,468 WARN [lifecycle] executePhase(RESTORE_VIEW 1,com.sun.faces.context.FacesContextImpl@13cf3bb) threw exception
| javax.el.PropertyNotWritableException: /home.xhtml @18,57 binding="#{bindingtest.testText()}": Illegal Syntax for Set Operation
| at com.sun.facelets.el.TagValueExpression.setValue(TagValueExpression.java:98)
| [...]
| Caused by: javax.el.PropertyNotWritableException: /home.xhtml @18,57 binding="#{bindingtest.testText()}": Illegal Syntax for Set Operation
| at com.sun.facelets.el.TagValueExpression.setValue(TagValueExpression.java:98)
| at com.sun.faces.lifecycle.RestoreViewPhase.doPerComponentActions(RestoreViewPhase.java:245)
| at com.sun.faces.lifecycle.RestoreViewPhase.doPerComponentActions(RestoreViewPhase.java:250)
| at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:193)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
| at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
| ... 37 more
|
|
|
It must be obvious but i have no idea why.
The application is generated with seam2/seam-gen from today cvs. The only changes are:
- outputText and form in home.xhtml
- class BindingTest.java
| <!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:h="http://java.sun.com/jsf/html"
| >
| <head>
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
| <title>popsuite-binding</title>
| <link href="stylesheet/theme.css" rel="stylesheet" type="text/css" />
| </head>
|
| <body>
|
| <h:messages/>
|
| Test<br />
|
| <h:outputText binding="#{bindingtest.testText()}" />
|
| <h:form id="bindingtest">
|
| <h:commandButton id="valid"
| value="OK"
| action="#{bindingtest.valid}"/>
|
| </h:form>
| </body>
| </html>
|
| package org.popsuite.binding2;
|
| import static org.jboss.seam.ScopeType.APPLICATION;
| import static org.jboss.seam.annotations.Install.BUILT_IN;
|
| import javax.faces.component.UIComponent;
| import javax.faces.component.html.HtmlOutputText;
|
| import org.jboss.seam.annotations.Install;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Scope;
| import org.jboss.seam.annotations.intercept.BypassInterceptors;
|
| @Scope(APPLICATION)
| @BypassInterceptors
| @Name("bindingtest")
| @Install(precedence = BUILT_IN)
| public class BindingTest
| {
| private String name;
| private String city;
|
| public UIComponent testText()
| {
| HtmlOutputText text = new HtmlOutputText();
| text.setValue("Very simple binding test");
| return text;
| }
|
| public String valid()
| {
| return null;
| }
|
| public String getName(){
| return this.name;
| }
|
| public void setName(String name){
| this.name = name;
| }
|
| public String getCity(){
| return this.city;
| }
|
| public void setCity(String city){
| this.city = city;
| }
|
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4075451#4075451
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4075451
18Â years, 10Â months