[forge-issues] [JBoss JIRA] (FORGE-873) Scaffold doesn't shows the correct referenced entities in edit views, while in details views shows something like "org.forgetest.model.Entity at 5f9ba38e"

claudio perrotta (JIRA) jira-events at lists.jboss.org
Mon May 6 10:57:53 EDT 2013


    [ https://issues.jboss.org/browse/FORGE-873?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12772371#comment-12772371 ] 

claudio perrotta edited comment on FORGE-873 at 5/6/13 10:56 AM:
-----------------------------------------------------------------

To change the string "org.forgetest.model.Entity at 5f9ba38e" i maqke some changes in xhtml files

in create.xhtml and search.xhtml : 
<f:selectItems value="#\{EntityBean.all\}"/>
changed to : 
<f:selectItems value="#\{EntityBean.all\}" var="entity" itemValue="#\{entity\}" itemLabel="#\{entity.id\}"/>
where "#\{entity\} is the private attribute in the bean relative to the entity class and #\{entity.id\} is the label that you want to show in dropdown menu


in view.xhtml : 
<h:link id="ManyToOneBean" outcome="/oneEntity/view" value="#{ManyBean.ManyEntity.OneEntity}">
changed to : 
<h:link id="ManyToOneBean" outcome="/oneEntity/view" value="#{ManyBean.ManyEntity.OneEntity.Id}">

i hope it helps
                
      was (Author: reskejal):
    To change the string "org.forgetest.model.Entity at 5f9ba38e" i change in xhtml files (create, view, search)  this line

<f:selectItems value="#\{EntityBean.all\}"/>

in 
<f:selectItems value="#\{EntityBean.all\}" var="entity" itemValue="#\{entity\}" itemLabel="#\{entity.id\}"/>
 
where "#\{entity\} is the private attribute in the bean relative to the entity class and #\{entity.id\} is the label that you want to show in dropdown menu

i hope it helps

                  
> Scaffold doesn't shows the correct referenced entities in edit views, while in details views shows something like "org.forgetest.model.Entity at 5f9ba38e"
> -------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: FORGE-873
>                 URL: https://issues.jboss.org/browse/FORGE-873
>             Project: Forge
>          Issue Type: Bug
>          Components: Scaffold
>    Affects Versions: 1.2.3.Final
>         Environment: JBoss 7.1.1 final , Hibernate 4.2.0.final, 
>            Reporter: claudio perrotta
>
> For a table with a foreign key the UI permits to select the possible values, but this values are listed in a dropdown menu in a form like "org.forgetest.model.Entity at 5f9ba38e" (would be preferable that the string present be relative to the PK referenced)
> Anyway, after setting this field and submitting the form, the data are inserted in the table correctly but when i want to modify the record, the UI doesn't show the setted value for the foreign key and i must set it again before saving.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the forge-issues mailing list