[JBoss Seam] - Seam gen edit pages, update without press save button
by rbcdexia
I have a problem with seam generator edit pages.
When a generated pojo has a complex object inside it, seam gen generates in the edit page a rich:tab with the following code.
<rich:tab label="entidad *" labelClass="required">
| <div class="association" id="entidadParent">
|
| <h:outputText value="No entidad"
|
| rendered="#{operacionHome.instance.entidad == null}"/>
|
| <rich:dataTable var="entidad"
| value="#{operacionHome.instance.entidad}"
| rendered="#{operacionHome.instance.entidad != null}"
| rowClasses="rvgRowOne,rvgRowTwo"
| id="entidadTable"
| bypassUpdates="true">
| <h:column>
| <f:facet name="header">empresa</f:facet>
| #{entidad.empresa.nombre}
| </h:column>
| <h:column>
| <f:facet name="header">nombre</f:facet>
| #{entidad.nombre}
| </h:column>
| <h:column>
| <f:facet name="header">numerocnmv</f:facet>
| #{entidad.numerocnmv}
| </h:column>
| <h:column>
| <f:facet name="header">isin</f:facet>
| #{entidad.isin}
| </h:column>
| </rich:dataTable>
|
| <div class="actionButtons">
| <s:button value="Select entidad" bypassUpdates="true"
| view="/EntidadList.xhtml">
| <f:param name="from" value="OperacionEdit"/>
| </s:button>
| </div>
|
| </div>
| </rich:tab>
When I press the botton and I bring the object entidad the following update is aoutomatically executed without press the save button:
| 10:28:30,488 INFO [STDOUT] Hibernate: update fondval.dbo.operacion set entidadid=?, ctapersonasid=?, activoid=?, volumen=?, divisaid=?, sistema=?, precio=?, fecha=?, mercadoid=?, tipoprecio=?, tipo=?, referencia=? where operacionid=?
|
Can you help me with this question, please?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4058600#4058600
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4058600
18Â years, 9Â months
[JBoss jBPM] - Re: jBPM or pages.xml overloading / extending / composition
by avbentem
utiba_davidr
| Joined: Sat Jun 23, 2007 08:52 AM
First of all: welcome to the JBoss forums. The subject of your question is promising!
But...
I don't know about the other members, but in general I have a strong objection against posting the very same question in multiple forums. A usenet-like "cross-posting" might be alright to some, but is different than posting the very same thing as separate topics in multiple forums. The latter implies that people might spend their time typing the very same answer that someone else already gave elsewhere. Or, for your own benefit: it may also imply that wrong answers are not noticed by people who only read the topic in the other forum(s).
So, I guess this very topic should continue at the very same topic in the Seam forum, in which a few replies have already been given, posted Wed Jun 27, 2007 23:35 PM.
Cheers,
Arjan.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4058586#4058586
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4058586
18Â years, 9Â months
[JBoss Seam] - DataModel and Row Unavailable
by ssc_ch
I have some problems in using the datamodel.
I have two Tables on my page and i add entries from one table to the 2nd, which works fine.
After adding i should have the possibility to remove entries again from the 2nd table, which works, but only with the first entry..
If i alway delete the first entry until the table is empty this is again no problem, but if i like to delete an entry in the middle or at the end, I get an exception saying the row is unavailable..
My Bean:
| @Stateful
| @Scope(ScopeType.CONVERSATION)
| @Name("caseAction")
| public class CaseAction implements ICase,Serializable{
|
|
| @PersistenceContext
| private EntityManager em;
|
| @In
| private User authUser;
|
| @Logger
| private Log log;
|
| @In
| private FacesMessages facesMessages;
|
| private PersistentFacesState state;
|
| @In(create=true)
| @Out(required=false)
| private Patient patient;
|
| @Out(value="selectedMedCase",required=false)
| MedCase mcase;
|
| @In(create=true)
| @Out(required=false)
| private CaseType caseType;
|
|
| @DataModel(value="professionals")
| private List<HealthProfessional> professionals;
| @DataModelSelection(value="professionals")
| @Out(required=false)
| private HealthProfessional selectedProfessional;
|
| @DataModel(value="searchProfessionals")
| private List<HealthProfessional> searchProfessionals;
| @DataModelSelection(value="searchProfessionals")
| @Out(required=false)
| private HealthProfessional selectedSearchedProfessionals;
|
| private String description;
|
|
|
| public CaseAction(){
|
| }
|
| @Begin(join=true)
| @Factory("searchProfessionals")
| public void initSearchProfessionals(){
| searchProfessionals = em.createQuery("FROM HealthProfessional hp " +
| "order by hp.lastname").getResultList();
| professionals = new ArrayList<HealthProfessional>();
| }
|
|
| @End
| public String create(){
|
| log.info("create")
|
| return "/protected/prof/profMyCases.seam";
| }
|
|
|
| public void deleteProf(){
| professionals.remove(selectedProfessional);
| state = PersistentFacesState.getInstance();
|
| log.info("delete Health Professional");
|
| }
|
| public void addProf(){
|
| if(!professionals.contains(selectedSearchedProfessionals)){
| professionals.add(selectedSearchedProfessionals);
| }
|
| log.info("added Health Professional: #{selectedSearchedProfessionals}");
| }
|
| public void patientChanged(ValueChangeEvent event){
| log.info("patient change event");
| }
|
| public List<Patient> getMyPatients(){
| HealthProfessional prof = (HealthProfessional)authUser;
|
| List<Patient> patients;
|
|
| patients = em.createNamedQuery("findAllPatientOfProfessional")
| .setParameter("prof", prof).getResultList();
|
| return patients;
| }
|
| public List<CaseType> getCaseTypes(){
|
| List<CaseType> types;
|
| types = em.createNamedQuery("findAllCaseTypes").getResultList();
|
| return types;
| }
|
| public String getDescription(){
| return description;
| }
|
| public void setDescription(String description){
| this.description = description;
| }
|
|
|
| @Destroy @Remove
| public void destroy(){
|
| }
|
| }
|
My website:
| <?xml version="1.0" encoding="ISO-8859-1" ?>
| <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:jsp="http://java.sun.com/JSP/Page"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:ice="http://www.icesoft.com/icefaces/component"
| xmlns:s="http://jboss.com/products/seam/taglib"
| template="../../layout/template.jsp">
|
| <ui:define name="content">
|
|
| <ice:panelAccordion expanded="true" styleClass="accordion">
| <f:facet name="header">
| <ice:outputText value="#{messages['profNewCase.title']}" />
| </f:facet>
|
| <ice:form id="form">
|
|
| <ice:panelGrid columns="3">
|
| <ice:outputText value="#{messages['profNewCase.patient']}" />
| <ice:outputText value="#{messages['profNewCase.description']}" />
| <ice:outputText value="#{messages['profNewCase.type']}" />
|
| <h:selectOneMenu id="patientListbox" required="true"
| value="#{patient}" >
|
|
| <s:selectItems value="#{caseAction.myPatients}" var="patient"
| label="#{patient.firstname} #{patient.lastname}"
| noSelectionLabel="#{messages['profNewCase.noSelection']}"/>
| <s:convertEntity />
|
| </h:selectOneMenu>
|
| <ice:inputText required="true" value="#{caseAction.description}" />
|
|
|
| <h:selectOneMenu id="typeListbox" required="true"
| value="#{caseType}">
|
|
| <s:selectItems value="#{caseAction.caseTypes}" var="caseType"
| label="#{caseType.type}"
| noSelectionLabel="#{messages['profNewCase.noSelection']}"/>
| <s:convertEntity />
|
| </h:selectOneMenu>
|
|
| </ice:panelGrid>
|
| <ice:outputText value="#{messages['profNewCase.notAdded']}"
| rendered="#{professionals != null and professionals.rowCount==0}"/>
|
| <ice:dataTable var="prof" value="#{professionals}"
| sortColumn="#{list.sort}" sortAscending="#{list.ascending}"
| scrollable="#{table.scrollable}"
| scrollHeight="#{table.scrollableHeight}"
| columnWidths="150px,150px,150px,150px"
| rendered="#{professionals.rowCount>0}">
|
| <f:facet name="header">
| <ice:outputText value="#{messages['profNewCase.responsibleProf']}" />
| </f:facet>
|
|
| <ice:column>
| <f:facet name="header">
| <ice:outputText value="#{messages['profNewCase.firstname']}" />
| </f:facet>
| <ice:outputText value="#{prof.firstname}" />
|
| </ice:column>
|
| <ice:column>
| <f:facet name="header">
| <ice:outputText value="#{messages['profNewCase.lastname']}" />
| </f:facet>
| <ice:outputText value="#{prof.lastname}" />
|
| </ice:column>
|
| <ice:column>
| <f:facet name="header">
| <ice:outputText value="#{messages['profNewCase.state']}" />
| </f:facet>
| <ice:outputText value="#{prof.state}" />
|
| </ice:column>
|
| <ice:column>
| <f:facet name="header">
| <ice:outputText value="#{messages['profNewCase.edit']}" />
| </f:facet>
| <s:link value="[delete]" action="#{caseAction.deleteProf}" />
|
| </ice:column>
|
| </ice:dataTable>
|
|
| <br />
| <ice:commandButton type="submit" value="#{messages['profNewCase.create']}"
| action="#{caseAction.create}" />
| </ice:form>
|
| <ice:form id="searchForm">
|
|
| <ice:panelAccordion expanded="true" styleClass="accordion">
| <f:facet name="header">
| <ice:outputText value="#{messages['profNewCase.search']}" />
| </f:facet>
|
|
| <ice:outputText value="No Health Professionals Found"
| rendered="#{searchProfessionals != null and searchProfessionals.rowCount==0}"/>
|
| <ice:dataTable var="sProfs" value="#{searchProfessionals}"
| sortColumn="#{list.sort}" sortAscending="#{list.ascending}"
| scrollable="#{table.scrollable}"
| scrollHeight="#{table.scrollableHeight}"
| columnWidths="150px,150px,150px,150px"
| rendered="#{searchProfessionals.rowCount>0}">
|
|
|
|
|
| <ice:column>
| <f:facet name="header">
| <ice:outputText value="#{messages['profNewCase.firstname']}" />
| </f:facet>
| <ice:outputText value="#{sProfs.firstname}" />
|
| </ice:column>
|
| <ice:column>
| <f:facet name="header">
| <ice:outputText value="#{messages['profNewCase.lastname']}" />
| </f:facet>
| <ice:outputText value="#{sProfs.lastname}" />
|
| </ice:column>
|
| <ice:column>
| <f:facet name="header">
| <ice:outputText value="#{messages['profNewCase.edit']}" />
| </f:facet>
| <s:link value="[add]" action="#{caseAction.addProf}" />
|
| </ice:column>
|
| </ice:dataTable>
|
| </ice:panelAccordion>
| </ice:form>
|
|
| </ice:panelAccordion>
|
|
| </ui:define>
| </ui:composition>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4058585#4058585
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4058585
18Â years, 9Â months