[
https://issues.jboss.org/browse/FORGE-1787?page=com.atlassian.jira.plugin...
]
Antonio Goncalves edited comment on FORGE-1787 at 5/11/14 9:29 AM:
-------------------------------------------------------------------
Hum... and of course, when there is a one to many relationship, the {{view.xhtml}} does
not work either. It has :
{code}
<h:dataTable id="cDBeanCDMusicians" styleClass="data-table"
value="#{forgeview:asList(CDBean.CD.musicians)}" var="_item">
<h:column>
<f:facet name="header">
<h:outputText value="First Name"/>
</f:facet>
<h:link outcome="/musician/view">
<f:param name="id" value="#{_item.id}"/>
<h:outputText id="itemFirstName"
value="#{_item.firstName}"/>
</h:link>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Last Name"/>
</f:facet>
<h:link outcome="/musician/view">
<f:param name="id" value="#{_item.id}"/>
<h:outputText id="itemLastName"
value="#{_item.lastName}"/>
</h:link>
</h:column>
</h:dataTable>
{code}
Instead of
{code}
<h:dataTable id="cDBeanCDMusicians" styleClass="data-table"
value="#{forgeview:asList(CDBean.CD.musicians)}" var="_item">
<h:column>
<f:facet name="header">
<h:outputText value="First Name"/>
</f:facet>
<h:link outcome="/admin/musician/view">
<f:param name="id" value="#{_item.id}"/>
<h:outputText id="itemFirstName"
value="#{_item.firstName}"/>
</h:link>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Last Name"/>
</f:facet>
<h:link outcome="/admin/musician/view">
<f:param name="id" value="#{_item.id}"/>
<h:outputText id="itemLastName"
value="#{_item.lastName}"/>
</h:link>
</h:column>
</h:dataTable>
{code}
And also links such as
{code}
<h:link id="bookBeanBookCategory" outcome="/category/view"
rendered="#{!empty bookBean.book.category}"
value="#{bookBean.book.category}">
<f:param name="id" value="#{bookBean.book.category.id}"/>
</h:link>
{code}
Should be :
{code}
<h:link id="bookBeanBookCategory" outcome="/admin/category/view"
rendered="#{!empty bookBean.book.category}"
value="#{bookBean.book.category}">
<f:param name="id" value="#{bookBean.book.category.id}"/>
</h:link>
{code}
was (Author: agoncal):
Hum... and of course, when there is a one to many relationship, the {{view.xhtml}} does
not work either. It has :
{code}
<h:dataTable id="cDBeanCDMusicians" styleClass="data-table"
value="#{forgeview:asList(CDBean.CD.musicians)}" var="_item">
<h:column>
<f:facet name="header">
<h:outputText value="First Name"/>
</f:facet>
<h:link outcome="/musician/view">
<f:param name="id" value="#{_item.id}"/>
<h:outputText id="itemFirstName"
value="#{_item.firstName}"/>
</h:link>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Last Name"/>
</f:facet>
<h:link outcome="/musician/view">
<f:param name="id" value="#{_item.id}"/>
<h:outputText id="itemLastName"
value="#{_item.lastName}"/>
</h:link>
</h:column>
</h:dataTable>
{code}
Instead of
{code}
<h:dataTable id="cDBeanCDMusicians" styleClass="data-table"
value="#{forgeview:asList(CDBean.CD.musicians)}" var="_item">
<h:column>
<f:facet name="header">
<h:outputText value="First Name"/>
</f:facet>
<h:link outcome="/admin/musician/view">
<f:param name="id" value="#{_item.id}"/>
<h:outputText id="itemFirstName"
value="#{_item.firstName}"/>
</h:link>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Last Name"/>
</f:facet>
<h:link outcome="/admin/musician/view">
<f:param name="id" value="#{_item.id}"/>
<h:outputText id="itemLastName"
value="#{_item.lastName}"/>
</h:link>
</h:column>
</h:dataTable>
{code}
When scaffolding with --webRoot parameter, pageTemplate.xhtml and
search.xhtml are not right
--------------------------------------------------------------------------------------------
Key: FORGE-1787
URL:
https://issues.jboss.org/browse/FORGE-1787
Project: Forge
Issue Type: Bug
Components: Scaffold
Affects Versions: 2.5.0.Final
Reporter: Antonio Goncalves
Assignee: George Gastaldi
Priority: Blocker
Fix For: 2.5.1.Final
When scaffolding a JSF application, without using a {{--webRoot}} parameter, the
navigation in the {{pageTemplate.xhtml}} works as expected :
{code}
scaffold-setup ;
scaffold-generate --targets org.agoncal.training.javaee6adv.model.Author ;
scaffold-generate --targets org.agoncal.training.javaee6adv.model.CD ;
{code}
The template navigation looks like :
{code}
<ul>
<li>
<h:link outcome="/CD/search" value="CD"/>
</li>
<li>
<h:link outcome="/author/search" value="Author"/>
</li>
</ul>
{code}
But if I specify the {{--webRoot}} parameter, then the navigation does not work as there
is a {{/}} missing :
{code}
scaffold-setup ;
scaffold-generate --webRoot admin --targets org.agoncal.training.javaee6adv.model.Author
;
scaffold-generate --webRoot admin --targets org.agoncal.training.javaee6adv.model.CD ;
{code}
The template :
{code}
<ul>
<li>
<h:link outcome="admin/CD/search" value="CD"/>
</li>
<li>
<h:link outcome="admin/author/search" value="Author"/>
</li>
</ul>
{code}
The correct navigation would be :
{code}
<ul>
<li>
<h:link outcome="/admin/CD/search" value="CD"/>
</li>
<li>
<h:link outcome="/admin/author/search" value="Author"/>
</li>
</ul>
{code}
The only way to make it work is to add a {{/}} to the {{webroot}}, which is not very
intuitive :
{code}
scaffold-setup ;
scaffold-generate --webRoot /admin --targets org.agoncal.training.javaee6adv.model.Author
;
scaffold-generate --webRoot /admin --targets org.agoncal.training.javaee6adv.model.CD ;
{code}
But this trick doesn't work for the {{search.xhtml}} page. The generated code is :
{code}
<h:link outcome="/genre/view">
<f:param name="id" value="#{_item.id}"/>
<h:outputText id="itemName" value="#{_item.name}"/>
</h:link>
{code}
The {{outcome}} is not right, and should contain a {{/admin}}
{code}
<h:link outcome="/admin/genre/view">
<f:param name="id" value="#{_item.id}"/>
<h:outputText id="itemName" value="#{_item.name}"/>
</h:link>
{code}
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)