Unable to get custom attributes value in Mixin from Select control

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Unable to get custom attributes value in Mixin from Select control

Ankit Jain
Hi,

I am unable to get custom attributes (t:varid) value in Mixin (mixinDropDown) from Select Input control.

<select t:type="select" t:value="dateDropDown"
                        t:model="dropDownDateValues" t:validate="prop:fieldValidator"
                        encoder="stringEncoder"
                        varid1="${ob1.sub1.sub2.id}"
                        t:varid="${ob1.sub1.sub2.id}"
                        t:mixins="mixinDropDown"
t:dataType="dropdown"
                        style="width:${tbxwidth}"
                        t:blankOption="prop:blankOption"></select>

In mixinDropDown, I have declared the varid as following:
    @Parameter(defaultPrefix = BindingConstants.LITERAL)
    private String varid;

when I am accessing it in AfterRender, 'varid' is coming as null.

Note: I have tested that "${ob1.sub1.sub2.id}" is returning a valid value and not null.

Regards, Ankit
[Aspire Systems]

This e-mail message and any attachments are for the sole use of the intended recipient(s) and may contain proprietary, confidential, trade secret or privileged information. Any unauthorized review, use, disclosure or distribution is prohibited and may be a violation of law. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
Reply | Threaded
Open this post in threaded view
|

Re: Unable to get custom attributes value in Mixin from Select control

Christian Riedel-2
hi ankit,

1. no need to post your questions to both, dev and users lists. this is a user-list topic.

2. don’t mix parameters and expansions ($-notation).
try:
  @Parameter // leave the defaultPrefix as is
  private String varid;

  <select t:type="select"  t:varid="ob1.sub1.sub2.id“></select>

you don’t have to specify varid1 AND t:varid. one is enough.

if your id is still null it’s a problem in your code which is hard to fix without further samples.


best
christian


> Am 29.03.2017 um 11:42 schrieb Ankit Jain <[hidden email]>:
>
> Hi,
>
> I am unable to get custom attributes (t:varid) value in Mixin (mixinDropDown) from Select Input control.
>
> <select t:type="select" t:value="dateDropDown"
>                        t:model="dropDownDateValues" t:validate="prop:fieldValidator"
>                        encoder="stringEncoder"
>                        varid1="${ob1.sub1.sub2.id}"
>                        t:varid="${ob1.sub1.sub2.id}"
>                        t:mixins="mixinDropDown"
> t:dataType="dropdown"
>                        style="width:${tbxwidth}"
>                        t:blankOption="prop:blankOption"></select>
>
> In mixinDropDown, I have declared the varid as following:
>    @Parameter(defaultPrefix = BindingConstants.LITERAL)
>    private String varid;
>
> when I am accessing it in AfterRender, 'varid' is coming as null.
>
> Note: I have tested that "${ob1.sub1.sub2.id}" is returning a valid value and not null.
>
> Regards, Ankit
> [Aspire Systems]
>
> This e-mail message and any attachments are for the sole use of the intended recipient(s) and may contain proprietary, confidential, trade secret or privileged information. Any unauthorized review, use, disclosure or distribution is prohibited and may be a violation of law. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Unable to get custom attributes value in Mixin from Select control

Nathan Quirynen
In reply to this post by Ankit Jain
Hi,

What version of Tapestry are you using?
I think since version 5.4 it is required to add the mixin prefix to its
parameters:

t:[mixin-name].[parameter-name]="[property-name]"


So in your case:

<select
...
t:mixins="mixinDropDown"
t:mixinDropDown.varid="${ob1.sub1.sub2.id}"
...
</select>

Maybe that is the problem you are having?

Nathan


Op 29/03/2017 om 11:42 schreef Ankit Jain:

> Hi,
>
> I am unable to get custom attributes (t:varid) value in Mixin (mixinDropDown) from Select Input control.
>
> <select t:type="select" t:value="dateDropDown"
>                          t:model="dropDownDateValues" t:validate="prop:fieldValidator"
>                          encoder="stringEncoder"
>                          varid1="${ob1.sub1.sub2.id}"
>                          t:varid="${ob1.sub1.sub2.id}"
>                          t:mixins="mixinDropDown"
> t:dataType="dropdown"
>                          style="width:${tbxwidth}"
>                          t:blankOption="prop:blankOption"></select>
>
> In mixinDropDown, I have declared the varid as following:
>      @Parameter(defaultPrefix = BindingConstants.LITERAL)
>      private String varid;
>
> when I am accessing it in AfterRender, 'varid' is coming as null.
>
> Note: I have tested that "${ob1.sub1.sub2.id}" is returning a valid value and not null.
>
> Regards, Ankit
> [Aspire Systems]
>
> This e-mail message and any attachments are for the sole use of the intended recipient(s) and may contain proprietary, confidential, trade secret or privileged information. Any unauthorized review, use, disclosure or distribution is prohibited and may be a violation of law. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Unable to get custom attributes value in Mixin from Select control

Ankit Jain
Hi Nathan,

Thanks a ton, in earlier versions, we could share context between mixins.
My problem was happening as I was sharing parameter with the 2 mixins.
So, problem was rectified by using different parameters for different mixin.
I don't have to specify mixin name to the parameter.

Regards, Ankit
-----Original Message-----
From: Nathan Quirynen [mailto:[hidden email]]
Sent: Friday, March 31, 2017 4:05 PM
To: [hidden email]
Subject: Re: Unable to get custom attributes value in Mixin from Select control

Hi,

What version of Tapestry are you using?
I think since version 5.4 it is required to add the mixin prefix to its
parameters:

t:[mixin-name].[parameter-name]="[property-name]"


So in your case:

<select
...
t:mixins="mixinDropDown"
t:mixinDropDown.varid="${ob1.sub1.sub2.id}"
...
</select>

Maybe that is the problem you are having?

Nathan


Op 29/03/2017 om 11:42 schreef Ankit Jain:

> Hi,
>
> I am unable to get custom attributes (t:varid) value in Mixin (mixinDropDown) from Select Input control.
>
> <select t:type="select" t:value="dateDropDown"
>                          t:model="dropDownDateValues" t:validate="prop:fieldValidator"
>                          encoder="stringEncoder"
>                          varid1="${ob1.sub1.sub2.id}"
>                          t:varid="${ob1.sub1.sub2.id}"
>                          t:mixins="mixinDropDown"
> t:dataType="dropdown"
>                          style="width:${tbxwidth}"
>                          t:blankOption="prop:blankOption"></select>
>
> In mixinDropDown, I have declared the varid as following:
>      @Parameter(defaultPrefix = BindingConstants.LITERAL)
>      private String varid;
>
> when I am accessing it in AfterRender, 'varid' is coming as null.
>
> Note: I have tested that "${ob1.sub1.sub2.id}" is returning a valid value and not null.
>
> Regards, Ankit
> [Aspire Systems]
>
> This e-mail message and any attachments are for the sole use of the intended recipient(s) and may contain proprietary, confidential, trade secret or privileged information. Any unauthorized review, use, disclosure or distribution is prohibited and may be a violation of law. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

[Aspire Systems]

This e-mail message and any attachments are for the sole use of the intended recipient(s) and may contain proprietary, confidential, trade secret or privileged information. Any unauthorized review, use, disclosure or distribution is prohibited and may be a violation of law. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]