You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Wes Wannemacher <we...@wantii.com> on 2009/06/09 21:20:51 UTC

Re: Can I insert a table into a struts form without changing the template?

Michael, which version of struts? (assuming Struts 2 since you mention
templates, but want to be sure)

-Wes

On Tue, Jun 9, 2009 at 3:17 PM, Griffith, Michael
*<Mi...@fda.hhs.gov> wrote:
> Hello everyone,
>
> I'm wondering is there a way I can insert a displayTag table into my
> struts form? I want the table to appear under form edit controls, but
> before the buttons, like a master detail type of view. I'd like to know
> if there is a way to do this without making changes to the default
> templates?
>
> Any reply is appreciated,
>
> Best Regards,
> MG
>



-- 
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Can I insert a table into a struts form without changing the template?

Posted by Dave Newton <ne...@yahoo.com>.
Griffith, Michael * wrote:
> It would be a nice feature to have as a struts tag to allow other tags
> or HTML into the form without mucking about with the template.
> 
> Something like:
> 
> <s:embed> 
> 	<display:table id="results" 
> 			 class="displaytag"
> 			 name="search-results" 
> 			 requestURI="summary.action">
> 
> 	<display:column property="shortName" 
> 					title="Short Name" 
> 					sortable="true"
> 					sortProperty="id"
> 					headerClass="sortable"/> 
> 
> 	<display:column property="projectManager" 
> 					title="Project Manager" 
> 					sortable="true"
> 					sortProperty="projectManager"
> 					headerClass="sortable"/>
> 	</display:table>
> </s:embed>

It only matters for the "xhtml" theme, and it's either what Wes and I 
said, or a tiny little JSP-based custom tag if the <tr><td...> is really 
bothersome.

Dave

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Can I insert a table into a struts form without changing the template?

Posted by "Griffith, Michael *" <Mi...@fda.hhs.gov>.
It would be a nice feature to have as a struts tag to allow other tags
or HTML into the form without mucking about with the template.

Something like:

<s:embed> 
	<display:table id="results" 
			 class="displaytag"
			 name="search-results" 
			 requestURI="summary.action">

	<display:column property="shortName" 
					title="Short Name" 
					sortable="true"
					sortProperty="id"
					headerClass="sortable"/> 

	<display:column property="projectManager" 
					title="Project Manager" 
					sortable="true"
					sortProperty="projectManager"
					headerClass="sortable"/>
	</display:table>
</s:embed>
-----Original Message-----
From: Wes Wannemacher [mailto:wesw@wantii.com] 
Sent: Tuesday, June 09, 2009 2:33 PM
To: Struts Users Mailing List
Subject: Re: Can I insert a table into a struts form without changing
the template?

I don't think there is a really great way to do it. If you really want
to get a solid handle on it, look through
template/xhtml/controlheader*.ftl and template/xhtml/controlfooter*.ftl
do. To summarize it, they create a two-column row in the table :)

I think you can pretty easily add your element by doing - <tr><td
colspan="2">your stuff</td></tr>

But, if it doesn't work, just take a look at the generated HTML, it'll
probably be pretty obvious what you need to change.

If you are really looking to build something reusable, then try to build
a tag out of it. It's easier than it sounds. IMO, if this is for one
page, just add the HTML. If you are planning on making something like
this for each form in your app, then build a tag out of it.

-Wes

On Tue, Jun 9, 2009 at 3:23 PM, Griffith, Michael
*<Mi...@fda.hhs.gov> wrote:
> Sorry, yes -- Struts 2 (2.1.6).
>
> -----Original Message-----
> From: Wes Wannemacher [mailto:wesw@wantii.com]
> Sent: Tuesday, June 09, 2009 2:21 PM
> To: Struts Users Mailing List
> Subject: Re: Can I insert a table into a struts form without changing 
> the template?
>
> Michael, which version of struts? (assuming Struts 2 since you mention

> templates, but want to be sure)
>
> -Wes
>
> On Tue, Jun 9, 2009 at 3:17 PM, Griffith, Michael 
> *<Mi...@fda.hhs.gov> wrote:
>> Hello everyone,
>>
>> I'm wondering is there a way I can insert a displayTag table into my 
>> struts form? I want the table to appear under form edit controls, but

>> before the buttons, like a master detail type of view. I'd like to 
>> know if there is a way to do this without making changes to the 
>> default templates?
>>
>> Any reply is appreciated,
>>
>> Best Regards,
>> MG
>>
>
>
>
> --
> Wes Wannemacher
> Author - Struts 2 In Practice
> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and 
> more http://www.manning.com/wannemacher
>
> ---------------------------------------------------------------------
> 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
>
>



--
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

---------------------------------------------------------------------
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: Can I insert a table into a struts form without changing the template?

Posted by Wes Wannemacher <we...@wantii.com>.
I don't think there is a really great way to do it. If you really want
to get a solid handle on it, look through
template/xhtml/controlheader*.ftl and
template/xhtml/controlfooter*.ftl do. To summarize it, they create a
two-column row in the table :)

I think you can pretty easily add your element by doing - <tr><td
colspan="2">your stuff</td></tr>

But, if it doesn't work, just take a look at the generated HTML, it'll
probably be pretty obvious what you need to change.

If you are really looking to build something reusable, then try to
build a tag out of it. It's easier than it sounds. IMO, if this is for
one page, just add the HTML. If you are planning on making something
like this for each form in your app, then build a tag out of it.

-Wes

On Tue, Jun 9, 2009 at 3:23 PM, Griffith, Michael
*<Mi...@fda.hhs.gov> wrote:
> Sorry, yes -- Struts 2 (2.1.6).
>
> -----Original Message-----
> From: Wes Wannemacher [mailto:wesw@wantii.com]
> Sent: Tuesday, June 09, 2009 2:21 PM
> To: Struts Users Mailing List
> Subject: Re: Can I insert a table into a struts form without changing
> the template?
>
> Michael, which version of struts? (assuming Struts 2 since you mention
> templates, but want to be sure)
>
> -Wes
>
> On Tue, Jun 9, 2009 at 3:17 PM, Griffith, Michael
> *<Mi...@fda.hhs.gov> wrote:
>> Hello everyone,
>>
>> I'm wondering is there a way I can insert a displayTag table into my
>> struts form? I want the table to appear under form edit controls, but
>> before the buttons, like a master detail type of view. I'd like to
>> know if there is a way to do this without making changes to the
>> default templates?
>>
>> Any reply is appreciated,
>>
>> Best Regards,
>> MG
>>
>
>
>
> --
> Wes Wannemacher
> Author - Struts 2 In Practice
> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
> http://www.manning.com/wannemacher
>
> ---------------------------------------------------------------------
> 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
>
>



-- 
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Can I insert a table into a struts form without changing the template?

Posted by "Griffith, Michael *" <Mi...@fda.hhs.gov>.
Sorry, yes -- Struts 2 (2.1.6). 

-----Original Message-----
From: Wes Wannemacher [mailto:wesw@wantii.com] 
Sent: Tuesday, June 09, 2009 2:21 PM
To: Struts Users Mailing List
Subject: Re: Can I insert a table into a struts form without changing
the template?

Michael, which version of struts? (assuming Struts 2 since you mention
templates, but want to be sure)

-Wes

On Tue, Jun 9, 2009 at 3:17 PM, Griffith, Michael
*<Mi...@fda.hhs.gov> wrote:
> Hello everyone,
>
> I'm wondering is there a way I can insert a displayTag table into my 
> struts form? I want the table to appear under form edit controls, but 
> before the buttons, like a master detail type of view. I'd like to 
> know if there is a way to do this without making changes to the 
> default templates?
>
> Any reply is appreciated,
>
> Best Regards,
> MG
>



--
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

---------------------------------------------------------------------
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