You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by loshmeey <th...@gmail.com> on 2012/07/17 17:44:06 UTC

Beaneditform Troubles

Hello, i have problems with beaneditform and i dont know where else to turn
so, here i am.

So as i said, i have a bean edit form that is using an entity class a
source. In that entity class i have some fields marked up with @OneToMany
notations. I want to override those fields in the form using <t:parameter>.
And i did so, but the form is not showing those fields, and some other
fields that i have overridden with <t:parameter> are working fine. Has
anyone got any ideas? I can provide code if it may help.

Best Regards,
Milos D.

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Beaneditform-Troubles-tp5714511.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Beaneditform Troubles

Posted by loshmeey <th...@gmail.com>.
Thnx Alex! im gonna give it a go in the mornning!

Best Regards,
Milos D.

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Beaneditform-Troubles-tp5714511p5714529.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Beaneditform Troubles

Posted by Alex Kotchnev <ak...@gmail.com>.
I haven't tested it but I'd guess that it's doing this because it doesn't
have an editor registered for the Autor and Jezik entities.

You have two options :
1. Create property editors for the entities as described in
http://jumpstart.doublenegative.com.au/jumpstart/examples/lang/propertyeditors
 .
2. If you just want just to get it to work, you can probably have something
along the lines of :

 <t:beaneditform t:id="knigaForm" object="kniga"  add="autor,jezik"
submitLabel="Save" >
                  <p:jezik>
                    <t:label for="jezikId" />
                    <t:selectobject t:id="jezikId" blankOption="never"
list="jezikList"
value="jezici" labelfield="literal:jezikIme" />
                </p:jezik>
</t:beaneditform>

Cheers,

Alex K

On Tue, Jul 17, 2012 at 1:28 PM, loshmeey <th...@gmail.com> wrote:

> hm thank you for the quick reply Alex, i have the same line of code, and
> for
> some reason it is not working! Here is the code so if anyone has any clue
> what the problem might be...
>
> @Basic(optional = false)
>     @Validate("required")
>     @Column(name = "KNJIGA_NAPOMENA")
>     private String knjigaNapomena;
>
>     @Basic(optional = false)
>     @Validate("required")
>     @Column(name = "KNJIGA_GOD_IZDANJA")
>     @Temporal(TemporalType.DATE)
>     private Date knjigaGodIzdanja;
>
>
>     @JoinColumn(name = "OBLAST_ID", referencedColumnName = "OBLAST_ID")
>     @ManyToOne
>     private Autor oblastId;
>
>     @JoinColumn(name = "JEZIK_ID", referencedColumnName = "JAZIK_ID")
>     @ManyToOne
>     private Jezik jezikId;
>
> ..... the rest of the entity class
>
> and the tml :
> <t:beaneditform t:id="knjigaN" exclude="knjigaZaduzena" submitLabel="Dodaj
> Knjigu">
>         <p:oblastId>
>                 <t:label for="oblastId"/>
>                 <t:select value="knjigaN.oblastId" model="oblastList"/>
>         </p:oblastId>
>         <p:jezikId>
>                 <t:label for="jezikId" />
>                 <t:selectobject t:id="jezikId" blankOption="never"
> list="jezikList"
> value="jezici" labelfield="literal:jezikIme" />
>         </p:jezikId>
>
> ... the rest of the form. This select object is a custom component i use
> for
> lists, and it used to work just fine until i added @ManyToOne notations,
> and
> changed the variable types to Autor/Jezik. If anyone has any ideas, thank
> you in advance!
>
> Best Regards,
> Milos D.
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Beaneditform-Troubles-tp5714511p5714520.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Beaneditform Troubles

Posted by loshmeey <th...@gmail.com>.
hm thank you for the quick reply Alex, i have the same line of code, and for
some reason it is not working! Here is the code so if anyone has any clue
what the problem might be...

@Basic(optional = false)
    @Validate("required")
    @Column(name = "KNJIGA_NAPOMENA")
    private String knjigaNapomena;
    
    @Basic(optional = false)
    @Validate("required")
    @Column(name = "KNJIGA_GOD_IZDANJA")
    @Temporal(TemporalType.DATE)
    private Date knjigaGodIzdanja;

 
    @JoinColumn(name = "OBLAST_ID", referencedColumnName = "OBLAST_ID")
    @ManyToOne
    private Autor oblastId;
    
    @JoinColumn(name = "JEZIK_ID", referencedColumnName = "JAZIK_ID")
    @ManyToOne
    private Jezik jezikId;

..... the rest of the entity class

and the tml :
<t:beaneditform t:id="knjigaN" exclude="knjigaZaduzena" submitLabel="Dodaj
Knjigu">
	<p:oblastId>
      		<t:label for="oblastId"/>
      		<t:select value="knjigaN.oblastId" model="oblastList"/>
     	</p:oblastId>
      	<p:jezikId>
      		<t:label for="jezikId" />
      		<t:selectobject t:id="jezikId" blankOption="never" list="jezikList"
value="jezici" labelfield="literal:jezikIme" />
      	</p:jezikId>

... the rest of the form. This select object is a custom component i use for
lists, and it used to work just fine until i added @ManyToOne notations, and
changed the variable types to Autor/Jezik. If anyone has any ideas, thank
you in advance!

Best Regards,
Milos D.

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Beaneditform-Troubles-tp5714511p5714520.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Beaneditform Troubles

Posted by Alex Kotchnev <ak...@gmail.com>.
Milos,
   I don't seem to have a problem w/ this functionality:

<t:beaneditform t:id="fooForm" object="foo" exclude="id, dateCreated"
add="users" submitLabel="Save">
    <p:users>
        [ display the user related information here ], e.g.
         <t:checklist t:id="usersChecklist" model="userSelectModel"
selected="selectedUsers" encoder="userValueEncoder"/>
    </p:users>
</t:beaneditform>

   My "foo" entity already has a "getUsers" method.

Cheers,

Alex K
On Tue, Jul 17, 2012 at 11:44 AM, loshmeey <th...@gmail.com> wrote:

> Hello, i have problems with beaneditform and i dont know where else to turn
> so, here i am.
>
> So as i said, i have a bean edit form that is using an entity class a
> source. In that entity class i have some fields marked up with @OneToMany
> notations. I want to override those fields in the form using <t:parameter>.
> And i did so, but the form is not showing those fields, and some other
> fields that i have overridden with <t:parameter> are working fine. Has
> anyone got any ideas? I can provide code if it may help.
>
> Best Regards,
> Milos D.
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Beaneditform-Troubles-tp5714511.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>