Query multiple entities and display on single page
valatharv Oct 2, 2008 9:05 PMI have a page study.xhtml which have form field from different entities.
When we click on Studylist and click on any created study, the study.xhtml form is displayed which contains study deatils but not other entity QuantExperiment details,
is it because StudyList.getEjbql() only queries study. I tried changing it but ..:(, please suggest what i am doing wrong...
study.xhtml
<rich:panel>
<f:facet name="header">Study</f:facet>
<s:decorate id="studyIdDecoration" template="layout/edit.xhtml">
<ui:define name="label">Study Id</ui:define>
<h:inputText id="name" required="true"
value="#{studyHome.instance.studyId}"/>
</s:decorate>
<s:decorate id="studyNameDecoration" template="layout/edit.xhtml">
<ui:define name="label">Study Name</ui:define>
<h:inputText id="name" required="true"
value="#{studyHome.instance.studyName}"/>
</s:decorate>
<div style="clear:both"/>
</rich:panel>
<rich:panel>
<f:facet name="header">Quant Experiment</f:facet>
<s:decorate id="entryPointDecoration" template="layout/edit.xhtml">
<ui:define name="label">Entry Point</ui:define>
<h:inputText id="name" required="true"
value="#{quantExperimentHome.instance.entryPoint}"
label="#{quantExperimentHome.instance.entryPoint}"/>
</s:decorate>
<s:decorate id="affinityCompoundDecoration" template="layout/edit.xhtml">
<ui:define name="label">Affinity Compound</ui:define>
<h:inputText id="name" required="true"
value="#{quantExperimentHome.instance.affinityCompound}"/>
</s:decorate>
..... so on
</rich:panel>
@Name("studyList")
public class StudyList extends EntityQuery
{
@In(required=false)
QuantExperimentList quantExperimentList;
@In(create=true)
public QuantExperiment quantExperiment;
@Override
public String getEjbql()
{
return "select study from Study study";
//return "select study,quantExperiment from Study study, QuantExperiment quantExperiment";
}
}
When we click on Studylist and click on any created study, the study.xhtml form is displayed which contains study deatils but not other entity QuantExperiment details,
is it because StudyList.getEjbql() only queries study. I tried changing it but ..:(, please suggest what i am doing wrong...
study.xhtml
<rich:panel>
<f:facet name="header">Study</f:facet>
<s:decorate id="studyIdDecoration" template="layout/edit.xhtml">
<ui:define name="label">Study Id</ui:define>
<h:inputText id="name" required="true"
value="#{studyHome.instance.studyId}"/>
</s:decorate>
<s:decorate id="studyNameDecoration" template="layout/edit.xhtml">
<ui:define name="label">Study Name</ui:define>
<h:inputText id="name" required="true"
value="#{studyHome.instance.studyName}"/>
</s:decorate>
<div style="clear:both"/>
</rich:panel>
<rich:panel>
<f:facet name="header">Quant Experiment</f:facet>
<s:decorate id="entryPointDecoration" template="layout/edit.xhtml">
<ui:define name="label">Entry Point</ui:define>
<h:inputText id="name" required="true"
value="#{quantExperimentHome.instance.entryPoint}"
label="#{quantExperimentHome.instance.entryPoint}"/>
</s:decorate>
<s:decorate id="affinityCompoundDecoration" template="layout/edit.xhtml">
<ui:define name="label">Affinity Compound</ui:define>
<h:inputText id="name" required="true"
value="#{quantExperimentHome.instance.affinityCompound}"/>
</s:decorate>
..... so on
</rich:panel>
@Name("studyList")
public class StudyList extends EntityQuery
{
@In(required=false)
QuantExperimentList quantExperimentList;
@In(create=true)
public QuantExperiment quantExperiment;
@Override
public String getEjbql()
{
return "select study from Study study";
//return "select study,quantExperiment from Study study, QuantExperiment quantExperiment";
}
}