@ James – Regarding my thought #1
If we are not going to merge this tiny and simple thing in struts-html
then we should better make it total separate and generic taglib. I
don't see any point in making struts-ex.
I am currently working on extensive javascript taglib, which I am
planning to submit to "Jakarta Taglibs". Some example usage of that
tag will be as followings
Script
<js:script src="someurl"/>
Alert
<js:alert> any jstl tag or struts bean:message </js:alert>
<js:alert value="${somevar" />
Var
<js:var jsvar="myJsVar" value="${somevar}" />
<js:var jsvar="myJsVar"> any jstl tag or struts bean:message </js:var>
Object
<js:object jsvar="myJsObject" value="${someBeanOrMap} />
Array
<js:array jsvar="myJsArray" value="${someArrayOrCollection} />
Array2D
<js:array2d jsvar="myJsArray2D" value="${someNestedVar} />
ArrayObject
<js:arrayObject jsvar="myJsArrayObject" value="${someNestedVar} />
Note: someNestedVar can be anything which makes matrix like data (two
dimentional).
Some more tags...
All of these tags will generate java script code, which can be used
for complex client side processing and validation. Tags will also
handle all special characters and escaping required for JS.
Sample output from object tag could be.
<script language="javascript">
var myJsObject = {attr1: "value1", attr2: "value2", attr3: "value3"};
// in case it is scoped js object, var will be suppressed.
Profile.address = {addr1: "999 Some Street", addr2: "Some City, Some
State", zip: "99999"};
</script>
If some Jakarta-taglibs committer is also on this list, please guide
me with the submission process.
Thanks,
On 8/29/05, James Mitchell <[EMAIL PROTECTED]> wrote:
> Sounds interesting. Although I think the best approach for this
> would be to do this in a separate tag, extending/overriding where
> appropriate.
>
> If you have time and would like to donate such an effort, perhaps we
> could put this into an "extensions" or "sandbox" taglib package.
>
>
> So something like this...
> <struts-ext:javascript page="/script/util.js"/>
>
> ("page" used here instead of "src" to be consistent with existing tags)
>
> Thoughts?
>
>
> --
> James Mitchell
> Software Engineer / Open Source Evangelist
> Consulting / Mentoring / Freelance
> EdgeTech, Inc.
> http://www.edgetechservices.net/
> 678.910.8017
> AIM: jmitchtx
> Yahoo: jmitchtx
> MSN: [EMAIL PROTECTED]
> Skype: callto://jmitchtx
>
>
>
>
> On Aug 29, 2005, at 11:05 AM, Sudhaker Raj wrote:
>
> > 1. Do we have need of tags like these?
> >
> > <html:js src="/script/util.js" />
> > <html:css src="/css/style.css" />
> >
> > Currently we are suppose to use html:rewrite tag or some crud method.
> >
> > <script language="javascript" src="<html:rewrite src="/script/util.js"
> > />"></script>
> >
> > CSS is bit neat because of @import but JS is still making code look
> > nasty.
> >
> >
> > 2. Do we have need of tag attribute like this?
> >
> > <html:form mode="edit">
> > ...
> > </html:form>
> >
> > <html:form mode="confirm">
> > ...
> > </html:form>
> >
> > <html:form mode="show">
> > ...
> > </html:form>
> >
> > Setting the mode attribute to 'confirm' will convert all form-field
> > into a hidden field and will replace all editable area with a label
> > showing current values. Similarly setting mode attribute to 'show'
> > will simply replace all editable area with a label showing current
> > values.
> >
> > The show mode can be very well used for followings
> >
> > * Same JSP code can be used to show details and edit details.
> > * Confirm filled values before finally submitting.
> > * Form can be made read-only or editable based on user's credentials.
> >
> > This can be further improved to control field level rendering and
> > security.
> >
> > --
> > Cheers,
> > Sudhaker Raj
> > http://thej2ee.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
Cheers,
Sudhaker Raj
http://thej2ee.com