Hi Christian,
at the moment i can live with the workaround provided by Serge.
Your sinplet has the right order of elements but as you have mentioned,
it's not very pretty. "buddy" is a property of label and should be
handled directly by the label tag.
Cheers,
Oliver
Am 28.04.2010 10:28, schrieb Christian Boulanger:
> True, there is a a problem with the order of variable definition here.
> Even qxt:scope="this" doesn't help because the buddy property needs a
> initialized object ... One can go with
>
> <qx:label id="myLabel" content="{js}
this.tr <
http://this.tr>('Title')"
> qxt:row="0" qxt:column="1" />
> <qx:textField id="myTextField" value="TestTitle" qxt:row="1"
> qxt:column="1"/>
> <qxt:script> myLabel.setBuddy(myTextField)</qxt:script>
>
> But of course this is not very pretty. We would need to write a separate
> template for that.. Can you live with this workaround for the moment,
> though`?
>
> C.
>
> 2010/4/28 Oliver Friedrich <
oli...@familie-friedrich.de
> <mailto:
oli...@familie-friedrich.de>>
>
> Hi Serge,
>
> this does the trick. But it looks a little bit unnatural to define first
> a textfield and than the associated label.
>
> Would it be a big task to define a nested structure like in my example?
> Or would this conflict with something else?
>
> Cheers,
> Oliver
>
>
>
> Am 28.04.2010 10:08, schrieb Siarhei Barysiuk:
> > Hi,
> >
> > This should work this way:
> >
> > <qx:textField id="myTextField" value="TestTitle" qxt:row="1"
> > qxt:column="1"/>
> > <qx:label content="{js}
this.tr <
http://this.tr>('Title')"
> qxt:row="0" qxt:column="1"
> > buddy="{js}myTextField"/>
> >
> > Let me know if you have problems with this snippet.
> >
> > Thanks,
> > Serge
> >
> >
> > On Apr 28, 2010, at 10:30 AM, Oliver Friedrich wrote:
> >
> >> Hi Serge,
> >>
> >> is there a way that a widget becomes the buddy of a label?
> >> So the widget would get the focus if the label gets clicked.
> >>
> >> Perhaps it could be definied like the following example if there
> exists
> >> nothing for it in Qxt:
> >>
> >>> <qx:label content="{js}
this.tr <
http://this.tr>('Title')"
> qxt:row="0" qxt:column="1">
> >>> <qx:textField value="TestTitle" qxt:row="1" qxt:column="1"/>
> >>> </qx:label>
> >>
> >>
> >> Expected result would be like something like this:
> >>> var qxLabel2 = new qx.ui.basic.Label(
this.tr
> <
http://this.tr>('Title'));
> >>> qxLabel2.setContent(
this.tr <
http://this.tr>('Title'));