You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ankit Jain <an...@aspiresys.com> on 2017/03/29 09:42:22 UTC

Unable to get custom attributes value in Mixin from Select control

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.

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

Posted by Ankit Jain <an...@aspiresys.com>.
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:nathan@pensionarchitects.be]
Sent: Friday, March 31, 2017 4:05 PM
To: users@tapestry.apache.org
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: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org

[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: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


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

Posted by Nathan Quirynen <na...@pensionarchitects.be>.
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: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


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

Posted by Christian Riedel <cr...@googlemail.com>.
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 <an...@aspiresys.com>:
> 
> 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: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org