You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Reinhard <un...@public-files.de> on 2003/08/05 09:31:37 UTC
accessing Attribute of a parent-tile-definition
Hi all,
I read many tiles-postings in the archive, but I didn't find a solution for my
case. Does any of you have an idea?
I have a base tiles definition with some attributes and some other definition
extending that base-definition.
<definition name="base">
<put name="attrib.01" value="sample"/>
</definiton>
<definition name="page1" extends="base" path="main.jsp">
<put name="header" value="header.jsp"/>
<put name="body" value="body.jsp"/>
</definition>
How can I access the value of "attrib.01" in the file body.jsp?
No prob to access it in main.jsp, but I have no idea about accessing the
attribute from body.jsp. I tried <tiles:get ...> and <tiles:getAsString ...>
and <tiles:importAttribute ...>, but no way.
Any answer is appreciated.
kind regards
Reinhard
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Date validation and format
Posted by Adam Hardy <ah...@cyberspaceroad.com>.
I have l10n issues like this to resolve but haven't had the time yet.
I'm interested in the reply.
I suspect that the issue is still outstanding, although there is no
enhancement request in bugzilla. There is this related bug:
http://issues.apache.org/bugzilla/show_bug.cgi?id=19161
but there are no comments on the bug from the developers - perhaps some
struts developer can say something on this subject now?
A similar issue with LocalizedBeanUtils.copyProperties() is at a
stand-still at the moment too, so I suspect that it will require some
dedicated European to do the development.
Jiří Mareš wrote:
> Hi all,
>
> I have question to date validation. In validation.xml I specified the
> field folowing way:
>
> <field property="when" depends="required,date">
> <arg0 key="demand.when" resource="true" name="required"/>
> <arg0 key="demand.when" resource="true" name="date"/>
> <arg1 key="${var:datePattern}" resource="false" name="date"/>
> <var>
> <var-name>datePattern</var-name>
> <var-value>yyyy.MM.dd</var-value>
> </var>
> </field>
>
> and everything is working, but, when I edit the field I would like to
> load the date frm DB and format the date the same pattern as is
> specified in the validation.xml.
>
> And here is my question.
>
> 1) Is it possible to specifi the var-value as the key in
> applicationResources to be able from application load the same value of
> the key.
>
> 2) Or is it possible in action read the value of the var named
> datePattern in validation for particular form??
>
> Thanks a lot.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: Date validation and format
Posted by Yansheng Lin <ya...@isogis.com>.
I think there is a trick you can perform with regard to this:
> 2) Or is it possible in action read the value of the var named
> datePattern in validation for particular form??
You can call your validate method in your Form.validate() initial when you populate the form. If the date format is not the one you wanted, you use a decorator to format it, but don't add the error to the errors collection(since this is just displaying the form). On the client side, you can call validateWhen(myForm) in onLoad(), etc.
Do I understand what you wanted to do correctly:).
-----Original Message-----
From: Jiøí Mareš [mailto:Jiri.Mares@svt.cz]
Sent: August 5, 2003 1:42 AM
To: Struts Users Mailing List
Subject: Date validation and format
Hi all,
I have question to date validation. In validation.xml I specified the
field folowing way:
<field property="when" depends="required,date">
<arg0 key="demand.when" resource="true" name="required"/>
<arg0 key="demand.when" resource="true" name="date"/>
<arg1 key="${var:datePattern}" resource="false" name="date"/>
<var>
<var-name>datePattern</var-name>
<var-value>yyyy.MM.dd</var-value>
</var>
</field>
and everything is working, but, when I edit the field I would like to
load the date frm DB and format the date the same pattern as is
specified in the validation.xml.
And here is my question.
1) Is it possible to specifi the var-value as the key in
applicationResources to be able from application load the same value of
the key.
2) Or is it possible in action read the value of the var named
datePattern in validation for particular form??
Thanks a lot.
--
Jiří Mareš (mailto:Jiri.Mares@svt.cz)
ČSAD SVT Praha, s.r.o. (http://www.svt.cz)
Czech Republic
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Date validation and format
Posted by Jiří Mareš <Ji...@svt.cz>.
Hi all,
I have question to date validation. In validation.xml I specified the
field folowing way:
<field property="when" depends="required,date">
<arg0 key="demand.when" resource="true" name="required"/>
<arg0 key="demand.when" resource="true" name="date"/>
<arg1 key="${var:datePattern}" resource="false" name="date"/>
<var>
<var-name>datePattern</var-name>
<var-value>yyyy.MM.dd</var-value>
</var>
</field>
and everything is working, but, when I edit the field I would like to
load the date frm DB and format the date the same pattern as is
specified in the validation.xml.
And here is my question.
1) Is it possible to specifi the var-value as the key in
applicationResources to be able from application load the same value of
the key.
2) Or is it possible in action read the value of the var named
datePattern in validation for particular form??
Thanks a lot.
--
Jiří Mareš (mailto:Jiri.Mares@svt.cz)
ČSAD SVT Praha, s.r.o. (http://www.svt.cz)
Czech Republic
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org