Hi Ronald, 1. does your B.java contains a either a public property e.g.
public UserAccount userAccount;
or a getter/setter pair, e.g.
private UserAccount _userAccount;
public UserAccount userAccount() {
return this._userAccount;
}
public void setUserAccount(UserAccount newUserAccount) {
this._userAccount = newUserAccount;
}
Note, that (cum grano salis) for each binding you define in the Component API
there must be a public property or a getter/setter pair with exactly the same
name in the java code.
2. are you sure that the property "authenticatedUser" in your session is not
null when the component is rendered?
BTW: since ((Session) session()).authenticatedUser should be accessible in
every component of your app - also the subcomponents - you may use it directly
in your subcomponent instead of passing it via a binding. Jm2¢.
C.U.CW
--
The three great virtues of a programmer are Laziness, Impatience and Hubris.
(Randal Schwartz)
> On 29.05.2015, at 15:11, HOUNKPONOU Ronald <[email protected]>
> wrote:
>
> In A.html
>
> <webobject name = "template">
>
> </webobject>
>
>
> In A.wood
>
> template : B {
> userAccount = session.authenticatedUser;
> }
>
>
> in B.html
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
> <title>untitled</title>
> </head>
> <body>
> <webobject name = "specialitemedicale">
> <label>Libellé</label>
> <webobject name = "libelle"/>
> <webobject name = "enregistrer"/>
> </webobject>
> </body>
> </html>
>
> in B.wood
>
> specialitemedicale : WOForm {
> }
>
> libelle : WOTextField {
> value = libelle;
> }
>
> enregistrer : WOSubmitButton {
> action=insertSpecialitemedicale;
> value="Enregistrer";
> }
>
> 2015-05-29 13:15 GMT+01:00 Johann Werner <[email protected]>:
> What is your HTML? You need to wire up your binding with the actual
> method/ivar of your component A:
>
> …
> <wo:B userAccount="$account" />
> …
>
> and in A.java:
>
> public MyAccountClass account = …;
>
>
>
>
> > Am 29.05.2015 um 13:25 schrieb HOUNKPONOU Ronald
> > <[email protected]>:
> >
> > I forgot the image.
> >
> > 2015-05-29 12:23 GMT+01:00 HOUNKPONOU Ronald <[email protected]>:
> > Hi everyone,
> >
> > Iam facing a problem with subcomponent binding.
> >
> > I have 2 componets A & B. B is to be include in A.
> >
> > But B need some information (eg. Authenticated user object). So i have
> > create a binding as show in the attached picture and add its gette 7 setter
> > in B.java.
> >
> > (I dont know how to specify Value Set to be my Objet Type. so i try with
> > undefined & ressources)
> >
> > But the object is not passed to B.
> >
> > I got a NullPointerException when trying to access the passed vairable in
> > B.java
> >
> > Thanks for your help.
> >
> > <Selection_005.png>
>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/cw%40i4innovation.de
>
> This email sent to [email protected]
signature.asc
Description: Message signed with OpenPGP using GPGMail
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [email protected]
