[jboss-user] [JBoss Seam] - Re: ajax and EntityHome (Conversation) bug?!
dashti
do-not-reply at jboss.com
Tue Nov 27 12:11:10 EST 2007
I've solved some problems, but a crazy thing comes up.
I have these 3 files:
VisitsEdit.xhtml
| <!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:a="http://richfaces.org/a4j"
| xmlns:rich="http://richfaces.org/rich"
| template="layout/template.xhtml">
|
| <ui:define name="body">
|
| <h:messages globalOnly="true" styleClass="message" id="globalMessages"/>
|
| <h:form id="visit" styleClass="edit">
|
| <rich:panel>
| <f:facet name="header">#{messages['Edit']} #{messages['Visit']}</f:facet>
|
| <s:decorate id="visitDateTimeDecoration" template="layout/edit.xhtml">
| <ui:define name="label">#{messages['visitDateTime']}</ui:define>
| <h:inputText id="visitDateTime"
| size="16"
| required="false"
| value="#{visitHome.instance.visitDateTime}">
| <s:convertDateTime type="both" dateStyle="short" />
| <a:support event="onblur" reRender="visitDateTimeDecoration" bypassUpdates="true"/>
| </h:inputText>
| </s:decorate>
|
| <s:decorate id="visitDescriptionDecoration" template="layout/edit.xhtml">
| <ui:define name="label">#{messages['visitDescription']}</ui:define>
| <h:inputTextarea id="visitDescription"
| cols="80"
| rows="3"
| value="#{visitHome.instance.visitDescription}"/>
| </s:decorate>
|
| <s:decorate id="visitKindDecoration" template="layout/edit.xhtml">
| <ui:define name="label">#{messages['visitKind']}</ui:define>
| <h:inputTextarea id="visitKind"
| cols="80"
| rows="3"
| value="#{visitHome.instance.visitKind}"/>
| </s:decorate>
|
| <s:decorate id="placeStateDecoration" template="layout/edit.xhtml">
| <ui:define name="label">#{messages['placeState']}</ui:define>
| <h:inputTextarea id="placeState"
| cols="80"
| rows="3"
| value="#{visitHome.instance.placeState}"/>
| </s:decorate>
|
| <s:decorate id="wardenDecoration" template="layout/display.xhtml">
| <ui:define name="label">#{messages['warden']}</ui:define>
| <h:selectOneMenu value="#{visitHome.instance.warden}">
| <s:selectItems value="#{visitHome.wardensList}" var="ward" label="#{ward.user.firstName} #{ward.user.lastName}" noSelectionLabel="#{messages['PleaseSelectOne']}"></s:selectItems>
| <s:convertEntity />
| </h:selectOneMenu>
| </s:decorate>
|
| <div style="clear:both">
| <span class="required">*</span>
| #{messages['requiredfields']}
| </div>
|
| </rich:panel>
|
| <div class="actionButtons">
|
| <h:commandButton id="save"
| value="#{messages['Save']}"
| action="#{visitHome.persist}"
| disabled="#{!visitHome.wired}"
| rendered="#{!visitHome.managed}"/>
|
| <h:commandButton id="update"
| value="#{messages['Save']}"
| action="#{visitHome.update}"
| rendered="#{visitHome.managed}"/>
|
| <h:commandButton id="delete"
| value="#{messages['Delete']}"
| action="#{visitHome.remove}"
| rendered="#{visitHome.managed}"/>
|
| <s:button id="done"
| value="#{messages['Done']}"
| propagation="end"
| view="/Visit.xhtml"
| rendered="#{visitHome.managed}"/>
|
| <s:button id="cancel"
| value="#{messages['Cancel']}"
| propagation="end"
| view="/#{empty visitFrom ? 'VisitList' : visitFrom}.xhtml"
| rendered="#{!visitHome.managed}"/>
|
| </div>
| </h:form>
|
| <a:form id="formInstanceSelection">
| <rich:tabPanel switchType="ajax" id="visitTabPanel">
|
| <rich:tab label="#{messages['formInstances']}">
| <div class="association" id="formInstancesChildren">
|
| <h:outputText value="#{messages['NoFormInstances']}"
| rendered="#{empty visitHome.formInstances}"/>
|
| <rich:dataTable value="#{visitHome.formInstances}"
| var="formInstance"
| rendered="#{not empty visitHome.formInstances}"
| rowClasses="rvgRowOne,rvgRowTwo"
| id="formInstancesTable"
| onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
| onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
| rowKey="#{formInstance.id}" rowKeyVar="fiId">
| <rich:column>
| <f:facet name="header">#{messages['radif']}</f:facet>
| <h:outputText value="#{formInstance.formInstanceId}"/>
| </rich:column>
| <rich:column>
| <f:facet name="header">#{messages['creationDate']}</f:facet>
| <h:outputText value="#{formInstance.creationDate}"/>
| </rich:column>
| <rich:column>
| <f:facet name="header">#{messages['action']}</f:facet>
| <s:link view="/FormInstance.xhtml"
| id="selectformInstance"
| value="#{messages['Select']}"
| propagation="none">
| <f:param name="formInstanceFormInstanceId"
| value="#{formInstance.formInstanceId}"/>
| <f:param name="formInstanceFrom" value="Visit"/>
| </s:link>
|
| </rich:column>
| <a:support event="onRowClick" oncomplete="javascript:Richfaces.showModalPanel('mpFormInstance');"
| reRender="insideMP" data="#{rowKey}"
| actionListener="#{formInstanceHome.selectFormInstanceFromTable}">
| <s:conversationId/>
| <a:actionparam name="fi" id="fi" assignTo="#{formInstanceHome.id}" value="#{formInstance.formInstanceId}"/>
|
| </a:support>
| </rich:dataTable>
|
| </div>
|
| <f:subview rendered="#{visitHome.managed}" id="formInstances">
| <div class="actionButtons">
|
| <s:button onclick="Richfaces.showModalPanel('mpFormInstance');return false;" value="baba in jadide !"></s:button>
|
| <s:button id="addformInstance"
| value="#{messages['AddFormInstance']}"
| view="/FormInstanceEdit.xhtml"
| propagation="none">
| <f:param name="visitVisitId"
| value="#{visitHome.instance.visitId}"/>
| <f:param name="formInstanceFrom" value="Visit"/>
| </s:button>
| </div>
| </f:subview>
| </rich:tab>
|
|
| <rich:tab label="workers">
| <div class="association" id="workersChildren">
|
| <h:outputText value="#{messages['NoWorkers']}"
| rendered="#{empty visitHome.workers}"/>
|
| <rich:dataTable value="#{visitHome.workers}"
| var="worker"
| rendered="#{not empty visitHome.workers}"
| rowClasses="rvgRowOne,rvgRowTwo"
| id="workersTable">
| <h:column>
| <f:facet name="header">#{messages['radif']}</f:facet>
| <h:outputText value="#{worker.workerId}"/>
| </h:column>
| <h:column>
| <f:facet name="header">#{messages['action']}</f:facet>
| <s:link view="/Worker.xhtml"
| id="selectworker"
| value="#{messages['Select']}"
| propagation="none">
| <f:param name="workerWorkerId"
| value="#{worker.workerId}"/>
| <f:param name="workerFrom" value="Visit"/>
| </s:link>
| </h:column>
| </rich:dataTable>
|
| </div>
|
| <f:subview rendered="#{visitHome.managed}" id="workers">
| <div class="actionButtons">
| <s:button id="addworker"
| value="#{messages['AddWorker']}"
| view="/WorkerEdit.xhtml"
| propagation="none">
| <f:param name="visitVisitId"
| value="#{visitHome.instance.visitId}"/>
| <f:param name="workerFrom" value="Visit"/>
| </s:button>
| </div>
| </f:subview>
| </rich:tab>
|
| <rich:tab label="warden">
| <div class="association" id="wardenParent">
|
| <h:outputText value="#{messages['NoWarden']}"
| rendered="#{visitHome.instance.warden == null}"/>
|
| <rich:dataTable var="warden"
| value="#{visitHome.instance.warden}"
| rendered="#{visitHome.instance.warden != null}"
| rowClasses="rvgRowOne,rvgRowTwo"
| id="wardenTable">
| <h:column>
| <f:facet name="header">#{messages['radif']}</f:facet>
| #{warden.wardenId}
| </h:column>
| <h:column>
| <f:facet name="header">#{messages['userHumanId']}</f:facet>
| #{warden.user.humanId}
| </h:column>
| <h:column>
| <f:facet name="header">#{messages['action']}</f:facet>
| <s:link view="/Warden.xhtml"
| id="viewwarden"
| value="#{messages['View']}"
| propagation="none">
| <f:param name="wardenWardenId"
| value="#{warden.wardenId}"/>
| </s:link>
| </h:column>
| </rich:dataTable>
|
| <div class="actionButtons">
| <s:button value="#{messages['SelectWarden']}"
| view="/WardenList.xhtml">
| <f:param name="from" value="VisitEdit"/>
| </s:button>
| </div>
|
| </div>
| </rich:tab>
|
| <rich:tab label="paravndehPlace">
| <div class="association" id="paravndehPlaceParent">
|
| <h:outputText value="#{messages['NoParavndehPlace']}"
| rendered="#{visitHome.instance.paravndehPlace == null}"/>
|
| <rich:dataTable var="paravndehPlace"
| value="#{visitHome.instance.paravndehPlace}"
| rendered="#{visitHome.instance.paravndehPlace != null}"
| rowClasses="rvgRowOne,rvgRowTwo"
| id="paravndehPlaceTable">
| <h:column>
| <f:facet name="header">#{messages['radif']}</f:facet>
| #{paravndehPlace.parvandehId}
| </h:column>
| <h:column>
| <f:facet name="header">#{messages['ParvandehKind']}</f:facet>
| #{paravndehPlace.parvandehKind.parvandehKindId}
| </h:column>
| <h:column>
| <f:facet name="header">#{messages['radif']}</f:facet>
| #{paravndehPlace.radif}
| </h:column>
| <h:column>
| <f:facet name="header">#{messages['placeAddress']}</f:facet>
| #{paravndehPlace.placeAddress}
| </h:column>
| <h:column>
| <f:facet name="header">#{messages['placeTelephone']}</f:facet>
| #{paravndehPlace.placeTelephone}
| </h:column>
| <h:column>
| <f:facet name="header">#{messages['isNamayandegi']}</f:facet>
| #{paravndehPlace.isNamayandegi}
| </h:column>
| <h:column>
| <f:facet name="header">#{messages['mahalhayeTahiyeType']}</f:facet>
| #{paravndehPlace.mahalhayeTahiyeType}
| </h:column>
| <h:column>
| <f:facet name="header">#{messages['mahalhayeTahiyeName']}</f:facet>
| #{paravndehPlace.mahalhayeTahiyeName}
| </h:column>
| <h:column>
| <f:facet name="header">#{messages['action']}</f:facet>
| <s:link view="/ParavndehPlace.xhtml"
| id="viewparavndehPlace"
| value="#{messages['View']}"
| propagation="none">
| <f:param name="paravndehPlaceParvandehId"
| value="#{paravndehPlace.parvandehId}"/>
| </s:link>
| </h:column>
| </rich:dataTable>
|
| <div class="actionButtons">
| <s:button value="#{messages['SelectParavndehPlace']}"
| view="/ParavndehPlaceList.xhtml">
| <f:param name="from" value="VisitEdit"/>
| </s:button>
| </div>
|
| </div>
| </rich:tab>
|
| <rich:tab label="destroyeds">
| <div class="association" id="destroyedsChildren">
|
| <h:outputText value="#{messages['NoDestroyeds']}"
| rendered="#{empty visitHome.destroyeds}"/>
|
| <rich:dataTable value="#{visitHome.destroyeds}"
| var="destroyed"
| rendered="#{not empty visitHome.destroyeds}"
| rowClasses="rvgRowOne,rvgRowTwo"
| id="destroyedsTable">
| <h:column>
| <f:facet name="header">#{messages['radif']}</f:facet>
| <h:outputText value="#{destroyed.destroyedId}"/>
| </h:column>
| <h:column>
| <f:facet name="header">#{messages['placeName']}</f:facet>
| <h:outputText value="#{destroyed.placeName}"/>
| </h:column>
| <h:column>
| <f:facet name="header">#{messages['destroyedDateTime']}</f:facet>
| <h:outputText value="#{destroyed.destroyedDateTime}"/>
| </h:column>
| <h:column>
| <f:facet name="header">#{messages['kindOfJens']}</f:facet>
| <h:outputText value="#{destroyed.kindOfJens}"/>
| </h:column>
| <h:column>
| <f:facet name="header">#{messages['tedad']}</f:facet>
| <h:outputText value="#{destroyed.tedad}"/>
| </h:column>
| <h:column>
| <f:facet name="header">#{messages['vaznVahed']}</f:facet>
| <h:outputText value="#{destroyed.vaznVahed}"/>
| </h:column>
| <h:column>
| <f:facet name="header">#{messages['vaznKol']}</f:facet>
| <h:outputText value="#{destroyed.vaznKol}"/>
| </h:column>
| <h:column>
| <f:facet name="header">#{messages['destroyedCause']}</f:facet>
| <h:outputText value="#{destroyed.destroyedCause}"/>
| </h:column>
| <h:column>
| <f:facet name="header">#{messages['action']}</f:facet>
| <s:link view="/Destroyed.xhtml"
| id="selectdestroyed"
| value="#{messages['Select']}"
| propagation="none">
| <f:param name="destroyedDestroyedId"
| value="#{destroyed.destroyedId}"/>
| <f:param name="destroyedFrom" value="Visit"/>
| </s:link>
| </h:column>
| </rich:dataTable>
|
| </div>
|
| <f:subview rendered="#{visitHome.managed}" id="destroyeds">
| <div class="actionButtons">
| <s:button id="adddestroyed"
| value="#{messages['AddDestroyed']}"
| view="/DestroyedEdit.xhtml"
| propagation="none">
| <f:param name="visitVisitId"
| value="#{visitHome.instance.visitId}"/>
| <f:param name="destroyedFrom" value="Visit"/>
| </s:button>
| </div>
| </f:subview>
| </rich:tab>
|
| </rich:tabPanel>
| </a:form>
| <a:region id="popupregion">
|
| <rich:modalPanel id="mpFormInstance" minHeight="400" minWidth="400" height="500" width="1000" top="15" zindex="2000" >
|
| <f:facet name="header">
|
| <h:outputText value="#{messages['formModalPanelTitle']} " />
|
| </f:facet>
|
| <f:facet name="controls">
|
| <h:graphicImage value="img/close.png" style="cursor:pointer" onclick="Richfaces.hideModalPanel('mpFormInstance')" />
|
| </f:facet>
|
|
|
| <a:form id="MPform">
| <s:div id="insideMP">
|
| <rich:panel>
| <f:facet name="header">#{messages['Edit']} #{messages['FormInstance']} #{messages['FormInstance']} #{formInstanceHome.instance.formStructure.formName != null ? formInstanceHome.instance.formStructure.formName : ''}</f:facet>
| <s:decorate id="fidDec" template="layout/display.xhtml">
| <ui:define name="label">fid</ui:define>
| <f:verbatim>#{formInstanceHome.instance.formInstanceId}</f:verbatim>
| </s:decorate>
| <s:decorate id="creationDateDecoration" template="layout/edit.xhtml">
| <ui:define name="label">#{messages['creationDate']}</ui:define>
| <rich:calendar id="creationDate"
| value="#{formInstanceHome.instance.creationDate}" pattern="MM/dd/yyyy" event="onblur" reRender="creationDateDecoration" bypassUpdates="true"/>
| </s:decorate>
|
| <s:decorate id="formStructuresDecoration" template="layout/display.xhtml">
| <ui:define name="label">#{messages['FormStructures']}</ui:define>
| <h:selectOneMenu value="#{formInstanceHome.selectedFormStructure}" >
| <f:selectItems value="#{formInstanceHome.formStructures}" ></f:selectItems>
| <s:convertEntity />
| </h:selectOneMenu>
| </s:decorate>
|
| <div style="clear:both">
| <span class="required">*</span>
| #{messages['requiredfields']}
| </div>
|
| </rich:panel>
|
| <div class="actionButtons">
|
| <a:commandButton id="updateFormInstanceButton"
| reRender="formInstancesTable"
| action="#{formInstanceHome.update}"
| value="felan in kar mikone?"
| oncomplete="javascript:Richfaces.hideModalPanel('mpFormInstance')" >
| <s:conversationId/>
| </a:commandButton>
| <a:commandButton onclick="javascript:Richfaces.hideModalPanel('mpFormInstance')" value="beband"></a:commandButton>
|
| <a:commandButton id="save"
| value="#{messages['Save']}"
| action="#{formInstanceHome.persist}"
| disabled="#{!formInstanceHome.wired}"
| rendered="#{!formInstanceHome.managed}"
| reRender="insideMP">
| </a:commandButton>
|
|
| <a:commandButton id="update"
| value="#{messages['Save']}"
| action="#{formInstanceHome.update}"
| rendered="#{formInstanceHome.managed}"
| reRender="fieldValuesTable">
| </a:commandButton>
|
| <h:commandButton id="delete"
| value="#{messages['Delete']}"
| onclick="#{messages['com.behdasht.CONFIRM_DELETE']}"
| action="#{formInstanceHome.remove}"
| rendered="#{formInstanceHome.managed}"/>
|
| <s:button id="done"
| value="#{messages['Done']}"
| propagation="end"
| view="/VisitEdit.xhtml"
| rendered="#{formInstanceHome.managed}">
| <f:param name="visitVisitId" value="#{visit.visitId}" />
| </s:button>
|
| <s:button id="cancel"
| value="#{messages['Cancel']}"
| propagation="end"
| view="/#{empty formInstanceFrom ? 'FormInstanceList' : formInstanceFrom}.xhtml"
| rendered="#{!formInstanceHome.managed}"/>
|
| </div>
|
|
| <div class="association" id="fieldValuesChildren">
|
| <rich:dataTable value="#{formInstanceHome.fieldValues}"
| var="fieldValue"
| rendered="#{not empty formInstanceHome.fieldValues}"
| rowClasses="rvgRowOne,rvgRowTwo"
|
| id="fieldValuesTable">
| <h:column>
| <f:facet name="header">#{messages['radif']}</f:facet>
| <h:outputText value="#{fieldValue.fieldValueId}"/>
| </h:column>
| <h:column>
| <f:facet name="header">#{messages['Desription']}</f:facet>
| <h:outputText value="#{fieldValue.field.fieldDescription}"/>
| </h:column>
| <h:column>
| <f:facet name="header">#{(formInstanceHome.instance.formStructure.formType == 1 or formInstanceHome.instance.formStructure.formType == 2) ? messages['Extra'] : (formInstanceHome.instance.formStructure.formType == 3 ? messages['Result'] : messages['Value'])}</f:facet>
| <s:span rendered="#{fieldValue.field.fieldType == 2}">
| <s:decorate id="strValDecoration" template="layout/editformgen.xhtml">
| <h:inputTextarea id="strVal" value="#{fieldValue.stringValue}" style=" width :100%;">
| <a:support event="onblur" reRender="strValDecoration" bypassUpdates="true"/>
| </h:inputTextarea>
| </s:decorate>
| </s:span>
| <s:span rendered="#{(fieldValue.field.fieldType == 1 and formInstanceHome.instance.formStructure.formType != 1)}">
| <s:decorate id="chkValDecoration" template="layout/editformgen.xhtml">
| <h:selectBooleanCheckbox id="chkVal" value="#{fieldValue.booleanValue}">
| <a:support event="onblur" reRender="chkValDecoration" bypassUpdates="true"/>
| </h:selectBooleanCheckbox>
| </s:decorate>
| </s:span>
| <s:span rendered="#{fieldValue.field.fieldType == 3}">
| <s:decorate id="intValDecoration" template="layout/editformgen.xhtml">
| <h:inputText id="intVal" value="#{fieldValue.integerValue}">
| <a:support event="onblur" reRender="intValDecoration" bypassUpdates="true"/>
| </h:inputText>
| </s:decorate>
| </s:span>
| <s:span rendered="#{fieldValue.field.fieldType == 4}">
| <s:decorate id="dblValDecoration" template="layout/editformgen.xhtml">
| <h:inputText id="dblVal" value="#{fieldValue.doubleValue}">
| <a:support event="onblur" reRender="dblValDecoration" bypassUpdates="true"/>
| </h:inputText>
| </s:decorate>
| </s:span>
| <s:span rendered="#{fieldValue.field.fieldType == 5}">
| <s:decorate id="dateValDecoration" template="layout/editformgen.xhtml">
| <rich:calendar id="dateVal" value="#{fieldValue.dateValue}" pattern="MM/dd/yyyy" event="onblur" reRender="creationDateDecoration" bypassUpdates="true">
| <a:support event="onblur" reRender="dateValDecoration" bypassUpdates="true"/>
| </rich:calendar>
| </s:decorate>
| </s:span>
| <s:span rendered="#{fieldValue.field.fieldType == 6}">
| <h:selectOneMenu value="#{fieldValue.trippleStateValue}" >
| <f:selectItems value="#{formInstanceHome.threeSatet}" ></f:selectItems>
| </h:selectOneMenu>
|
| </s:span>
|
|
| </h:column>
| <h:column rendered="#{formInstanceHome.instance.formStructure.formType == 1}">
| <f:facet name="header">#{messages['Value']}</f:facet>
| <s:span>
| <s:decorate id="checkValDecoration" template="layout/display.xhtml">
| <h:selectBooleanCheckbox id="checkVal" value="#{fieldValue.booleanValue}">
| <a:support event="onblur" reRender="checkValDecoration" bypassUpdates="true"/>
| </h:selectBooleanCheckbox>
| </s:decorate>
| </s:span>
| </h:column>
|
| <h:column rendered="#{formInstanceHome.instance.formStructure.formType == 2}">
| <f:facet name="header">#{messages['Value']}</f:facet>
| <s:span>
| <s:decorate id="emtiyazValDecoration" template="layout/editformgen.xhtml">
| <h:inputText id="emtiyazVal" value="#{fieldValue.emtiyaz}">
| <a:support event="onblur" reRender="emtiyazValDecoration" bypassUpdates="true"/>
| </h:inputText>
| </s:decorate>
| </s:span>
| </h:column>
|
| </rich:dataTable>
| </div>
|
|
|
|
| </s:div>
| </a:form>
| </rich:modalPanel>
| </a:region>
|
| <a:log></a:log>
| </ui:define>
|
| </ui:composition>
|
VisitsHome.java
| package com.behdasht.eb;
|
| import java.util.ArrayList;
| import java.util.List;
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.framework.EntityHome;
| import org.richfaces.component.html.HtmlModalPanel;
|
| @Name("visitHome")
| public class VisitHome extends EntityHome<Visit> {
|
| @In(create = true)
| WardenHome wardenHome;
| @In(create = true)
| ParavndehPlaceHome paravndehPlaceHome;
|
|
| public String rerender(){
| return null;
| }
|
| public void setVisitVisitId(Long id) {
| setId(id);
| }
|
| public Long getVisitVisitId() {
| return (Long) getId();
| }
|
| @Override
| protected Visit createInstance() {
| Visit visit = new Visit();
| return visit;
| }
|
| public void wire() {
| Warden warden = wardenHome.getDefinedInstance();
| if (warden != null) {
| getInstance().setWarden(warden);
| }
| ParavndehPlace paravndehPlace = paravndehPlaceHome.getDefinedInstance();
| if (paravndehPlace != null) {
| getInstance().setParavndehPlace(paravndehPlace);
| }
| }
|
| public boolean isWired() {
| return true;
| }
|
| public Visit getDefinedInstance() {
| return isIdDefined() ? getInstance() : null;
| }
|
| public List<Destroyed> getDestroyeds() {
| return getInstance() == null ? null : new ArrayList<Destroyed>(
| getInstance().getDestroyeds());
| }
| public List<FormInstance> getFormInstances() {
| return getInstance() == null ? null : getInstance().getFormInstances();
| }
| public List<Worker> getWorkers() {
| return getInstance() == null ? null : new ArrayList<Worker>(
| getInstance().getWorkers());
| }
|
| // public HtmlModalPanel getFormeInstanceMP(){
| // HtmlModalPanel fisPanel = new HtmlModalPanel();
| // fisPanel.setId("mpFormInstance");
| // fisPanel.setMinHeight(500);
| // fisPanel.setMinWidth(500);
| // fisPanel.setWidth(1000);
| // fisPanel.setHeight(500);
| // fisPanel.setTop("15");
| // fisPanel.setZindex(2000);
| //
| //
| // return fisPanel;
| // }
|
|
| public List<Warden> getWardensList() {
| return (List<Warden>)getEntityManager().createQuery("from Warden").getResultList();
| }
|
|
| }
|
|
|
and
FormInstanceHome.java
| package com.behdasht.eb;
| // Generated Nov 2, 2007 11:54:46 AM by Hibernate Tools 3.2.0.b9
|
| import java.util.Date;
| import java.util.ArrayList;
| import java.util.List;
| import javax.persistence.CascadeType;
| import javax.persistence.Column;
| import javax.persistence.Entity;
| import javax.persistence.FetchType;
| import javax.persistence.GeneratedValue;
| import javax.persistence.Id;
| import javax.persistence.JoinColumn;
| import javax.persistence.ManyToOne;
| import javax.persistence.OneToMany;
| import javax.persistence.Table;
| import javax.persistence.Temporal;
| import javax.persistence.TemporalType;
| import org.hibernate.validator.NotNull;
|
| /**
| * FormInstance generated by hbm2java
| */
| @Entity
| @Table(name = "form_instance", catalog = "behdasht")
| public class FormInstance implements java.io.Serializable {
|
| /**
| *
| */
| private static final long serialVersionUID = -5080864813582715025L;
|
| private long formInstanceId;
| private Visit visit;
| private FormStructure formStructure;
| private Date creationDate;
| private List<FieldValue> fieldValues = new ArrayList<FieldValue>(0);
|
| public FormInstance() {
| }
|
| public FormInstance(long formInstanceId) {
| this.formInstanceId = formInstanceId;
| }
| public FormInstance(long formInstanceId, Visit visit,
| FormStructure formStructure, Date creationDate,
| List<FieldValue> fieldValues) {
| this.formInstanceId = formInstanceId;
| this.visit = visit;
| this.formStructure = formStructure;
| this.creationDate = creationDate;
| this.fieldValues = fieldValues;
| }
|
| @Id
| @Column(name = "Form_instance_id", unique = true, nullable = false)
| @NotNull
| @GeneratedValue
| public long getFormInstanceId() {
| return this.formInstanceId;
| }
|
| public void setFormInstanceId(long formInstanceId) {
| this.formInstanceId = formInstanceId;
| }
| @ManyToOne(fetch = FetchType.LAZY)
| @JoinColumn(name = "visitVisit_id")
| public Visit getVisit() {
| return this.visit;
| }
|
| public void setVisit(Visit visit) {
| this.visit = visit;
| }
| @ManyToOne(fetch = FetchType.LAZY)
| @JoinColumn(name = "form_structureForm_structure_id")
| public FormStructure getFormStructure() {
| return this.formStructure;
| }
|
| public void setFormStructure(FormStructure formStructure) {
| this.formStructure = formStructure;
| }
| @Temporal(TemporalType.DATE)
| @Column(name = "Creation_date", length = 0)
| public Date getCreationDate() {
| return this.creationDate;
| }
|
| public void setCreationDate(Date creationDate) {
| this.creationDate = creationDate;
| }
| @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "formInstance")
| public List<FieldValue> getFieldValues() {
| return this.fieldValues;
| }
|
| public void setFieldValues(List<FieldValue> fieldValues) {
| this.fieldValues = fieldValues;
| }
|
| }
|
|
but , something workd wrong! it doen't work properly!
I'll appreciate you're help! please help me!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4108159#4108159
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4108159
More information about the jboss-user
mailing list