From issues-return-4444-apmail-struts-issues-archive=struts.apache.org@struts.apache.org Tue Mar 13 19:05:16 2007 Return-Path: Delivered-To: apmail-struts-issues-archive@locus.apache.org Received: (qmail 70960 invoked from network); 13 Mar 2007 19:05:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Mar 2007 19:05:14 -0000 Received: (qmail 51265 invoked by uid 500); 13 Mar 2007 19:05:21 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 51222 invoked by uid 500); 13 Mar 2007 19:05:20 -0000 Mailing-List: contact issues-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list issues@struts.apache.org Received: (qmail 51213 invoked by uid 99); 13 Mar 2007 19:05:20 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Mar 2007 12:05:20 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Mar 2007 12:05:11 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 608B3714075 for ; Tue, 13 Mar 2007 12:04:51 -0700 (PDT) Message-ID: <30944224.1173812691392.JavaMail.jira@brutus> Date: Tue, 13 Mar 2007 12:04:51 -0700 (PDT) From: "Jonathan Koppenhofer (JIRA)" To: issues@struts.apache.org Subject: [jira] Created: (WW-1811) Add generic custom tag attributes to pass custom parameters into a tag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Add generic custom tag attributes to pass custom parameters into a tag ---------------------------------------------------------------------- Key: WW-1811 URL: https://issues.apache.org/struts/browse/WW-1811 Project: Struts 2 Issue Type: Improvement Components: Views Affects Versions: 2.0.6 Reporter: Jonathan Koppenhofer Priority: Minor It would be nice to have a generic struts tag attribute for all tags to pass in custom parameters into the tag to use within custom templates. For example. I want to enable field level "mode" capabilites similar to what can be done in Struts-Layout (http://struts.application-servers.com) for struts 1.1-1.3. This includes the ability to specify a mode (Editable, ReadOnly. Hidden, etc...) for a field dependent on what mode (Create, Edit, Read) the page is in. An example struts-tag could be: In the example above "E,E,I" stands for... If page is in create mode the field is editable, if the field is in edit mode the field is ediatble, if the page is in read mode the field is readonly (inspect) I extended the simple text.ftl to be like: <#if parameters.somecustommodeattribute?exists> <#assign modeKey = 0/> <#if Session.pageMode?exists> <#assign modeKey = Session.pageMode?int/> <#if Request.pageMode?exists> <#assign modeKey = Request.pageMode?int/> <#assign fieldMode = parameters.somecustommodeattribute?substring(modeKey,modeKey+1)/> <#else> <#assign fieldMode = "E"/> <#if !(fieldMode = "N") > <#if fieldMode = "E" > name="${parameters.name?default("")?html}"<#rt/> <#if parameters.get("size")?exists> size="${parameters.get("size")?html}"<#rt/> <#if parameters.maxlength?exists> maxlength="${parameters.maxlength?html}"<#rt/> <#if parameters.nameValue?exists> value="<@s.property value="parameters.nameValue"/>"<#rt/> <#if parameters.disabled?default(false)> disabled="disabled"<#rt/> <#if parameters.readonly?default(false)> readonly="readonly"<#rt/> <#if parameters.tabindex?exists> tabindex="${parameters.tabindex?html}"<#rt/> <#if parameters.id?exists> id="${parameters.id?html}"<#rt/> <#if parameters.cssClass?exists> class="${parameters.cssClass?html}"<#rt/> <#if parameters.cssStyle?exists> style="${parameters.cssStyle?html}"<#rt/> <#if parameters.title?exists> title="${parameters.title?html}"<#rt/> <#include "/${parameters.templateDir}/simple/scripting-events.ftl" /> <#include "/${parameters.templateDir}/simple/common-attributes.ftl" /> /> <#else> <#include "/${parameters.templateDir}/simple/hidden.ftl" /> <#if fieldMode = "I" > <@s.property value="parameters.nameValue"/> Now granted this is a very specific example, but it would just be nice to have a generic parameter that I can access in my ftl templates. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.