You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jose L Martinez-Avial <jl...@gmail.com> on 2013/08/30 02:15:54 UTC
Escape expression in dynamic attribute in a tag
> Hi all,
> I'm pretty sure this is just a silly question, but I haven't
> been able to find anything. I have the following tag with some dynamics
> attribues:
>
> <s:textfield name="userName3"
> dojoType="dijit.form.FilteringSelect"
> theme="simple"
> store="comboStore"
> sId="UserSelect2"
> id="UserSelect2"
> searchAttr="userNamesKey"
> pageSize="25"
> autoComplete="false" />
>
> I need to add the attribute queryExpr="*\${0}*" to the resulting
> html. The problem is that if I just put that attribute in the tag, I got
> the following result:
>
> <input type="text" name="userName3" value="" id="UserSelect2"
> queryExpr="*0*" dojoType="dijit.form.FilteringSelect" store="comboStore"
> autoComplete="false" pageSize="25" jsId="UserSelect2"
> searchAttr="userNamesKey"/>
>
> Obviously, it is trying to parse the expression in queryExpr.
> Any suggestion about how I can escape it?
>
> Thanks
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Escape expression in dynamic attribute in a tag
Posted by Lukasz Lenart <lu...@apache.org>.
queryExpr="%{'*$' +'{0}'*}" or add a getter to your action which will
return what you want.
2013/8/30 JOSE L MARTINEZ-AVIAL <jl...@gmail.com>:
> It does not work.
>
> <s:textfield name="userName" dojoType="dijit.form.FilteringSelect"
> queryExpr="'*$' +'{0}'*" theme="simple" store="comboStore"
> jsId="UserSelect" id="UserSelect" searchAttr="userNamesKey" pageSize="15"
> autoComplete="false" />
>
> is translated as:
>
> <input type="text" name="userName" value="" id="UserSelect" queryExpr="'*$'
> +'{0}'*" dojoType="dijit.form.FilteringSelect" store="comboStore"
> autoComplete="false" pageSize="15" jsId="UserSelect"
> searchAttr="userNamesKey"/>
>
> Any suggestions?
>
>
>
> 2013/8/30 Lukasz Lenart <lu...@apache.org>
>
>> queryExpr="'*$' +'{0}'*"
>>
>> 2013/8/30 Jose L Martinez-Avial <jl...@gmail.com>:
>> >
>> >> Hi all,
>> >> I'm pretty sure this is just a silly question, but I haven't
>> >> been able to find anything. I have the following tag with some dynamics
>> >> attribues:
>> >>
>> >> <s:textfield name="userName3"
>> >> dojoType="dijit.form.FilteringSelect"
>> >> theme="simple"
>> >> store="comboStore"
>> >> sId="UserSelect2"
>> >> id="UserSelect2"
>> >> searchAttr="userNamesKey"
>> >> pageSize="25"
>> >> autoComplete="false" />
>> >>
>> >> I need to add the attribute queryExpr="*\${0}*" to the resulting
>> >> html. The problem is that if I just put that attribute in the tag, I got
>> >> the following result:
>> >>
>> >> <input type="text" name="userName3" value="" id="UserSelect2"
>> >> queryExpr="*0*" dojoType="dijit.form.FilteringSelect" store="comboStore"
>> >> autoComplete="false" pageSize="25" jsId="UserSelect2"
>> >> searchAttr="userNamesKey"/>
>> >>
>> >> Obviously, it is trying to parse the expression in queryExpr.
>> >> Any suggestion about how I can escape it?
>> >>
>> >> Thanks
>> >>
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail: user-help@struts.apache.org
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Escape expression in dynamic attribute in a tag
Posted by JOSE L MARTINEZ-AVIAL <jl...@gmail.com>.
It does not work.
<s:textfield name="userName" dojoType="dijit.form.FilteringSelect"
queryExpr="'*$' +'{0}'*" theme="simple" store="comboStore"
jsId="UserSelect" id="UserSelect" searchAttr="userNamesKey" pageSize="15"
autoComplete="false" />
is translated as:
<input type="text" name="userName" value="" id="UserSelect" queryExpr="'*$'
+'{0}'*" dojoType="dijit.form.FilteringSelect" store="comboStore"
autoComplete="false" pageSize="15" jsId="UserSelect"
searchAttr="userNamesKey"/>
Any suggestions?
2013/8/30 Lukasz Lenart <lu...@apache.org>
> queryExpr="'*$' +'{0}'*"
>
> 2013/8/30 Jose L Martinez-Avial <jl...@gmail.com>:
> >
> >> Hi all,
> >> I'm pretty sure this is just a silly question, but I haven't
> >> been able to find anything. I have the following tag with some dynamics
> >> attribues:
> >>
> >> <s:textfield name="userName3"
> >> dojoType="dijit.form.FilteringSelect"
> >> theme="simple"
> >> store="comboStore"
> >> sId="UserSelect2"
> >> id="UserSelect2"
> >> searchAttr="userNamesKey"
> >> pageSize="25"
> >> autoComplete="false" />
> >>
> >> I need to add the attribute queryExpr="*\${0}*" to the resulting
> >> html. The problem is that if I just put that attribute in the tag, I got
> >> the following result:
> >>
> >> <input type="text" name="userName3" value="" id="UserSelect2"
> >> queryExpr="*0*" dojoType="dijit.form.FilteringSelect" store="comboStore"
> >> autoComplete="false" pageSize="25" jsId="UserSelect2"
> >> searchAttr="userNamesKey"/>
> >>
> >> Obviously, it is trying to parse the expression in queryExpr.
> >> Any suggestion about how I can escape it?
> >>
> >> Thanks
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Re: Escape expression in dynamic attribute in a tag
Posted by Lukasz Lenart <lu...@apache.org>.
queryExpr="'*$' +'{0}'*"
2013/8/30 Jose L Martinez-Avial <jl...@gmail.com>:
>
>> Hi all,
>> I'm pretty sure this is just a silly question, but I haven't
>> been able to find anything. I have the following tag with some dynamics
>> attribues:
>>
>> <s:textfield name="userName3"
>> dojoType="dijit.form.FilteringSelect"
>> theme="simple"
>> store="comboStore"
>> sId="UserSelect2"
>> id="UserSelect2"
>> searchAttr="userNamesKey"
>> pageSize="25"
>> autoComplete="false" />
>>
>> I need to add the attribute queryExpr="*\${0}*" to the resulting
>> html. The problem is that if I just put that attribute in the tag, I got
>> the following result:
>>
>> <input type="text" name="userName3" value="" id="UserSelect2"
>> queryExpr="*0*" dojoType="dijit.form.FilteringSelect" store="comboStore"
>> autoComplete="false" pageSize="25" jsId="UserSelect2"
>> searchAttr="userNamesKey"/>
>>
>> Obviously, it is trying to parse the expression in queryExpr.
>> Any suggestion about how I can escape it?
>>
>> Thanks
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org