You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jason Wyatt <jw...@itree.com.au> on 2007/05/18 02:32:53 UTC

[S2] Is there a way to turn of formatting of controls with ajax theme?

I want to use ajax submit buttons to refresh tabs, but when ajax theme is
set, the buttons are wrapped in additional <tr> and <td> tags. This is doing
interesting and unhelpful things to our page layout.

This submit tag:

<s:submit name="save" value="Save" formId="stcSearchForm"
targets="stcSightingsTab,stcSearchForm" action="NcrStcSightingSearchAction"
showLoadingText="false" indicator="true" theme="ajax" cssClass="buttonClass"
tabindex="10" type="input" />

generates the following HTML:

<tr>
<td colspan="2"><div align="right">    <input type="submit"
dojoType="struts:Bind" event="onclick" value="Save"  
  	id="stcSearchForm_save"  	formId="stcSearchForm"
tabindex="10"    class="buttonClass"
name="action:NcrStcSightingSearchAction"
targets="stcSightingsTab,stcSearchForm"    indicator="true"
showLoading="false"  />
</div></td>
</tr>

I'm hoping to remove the <tr>, <td> and <div> tags.


Thanks for any help, kind regards

Jason


-----
Falun Dafa  Truth - Compassion - Forbearance

A mind & body practice under persecution in China

http://www.faluninfo.net








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


RE: [S2] Is there a way to turn of formatting of controls with ajax theme?

Posted by Jason Wyatt <jw...@itree.com.au>.
Thanks guys, very informative.  Modifying the ajax submit template took just
a few minutes and solved our problem.

We normally have custom layouts for our web apps, but ajax's partial
requests are very attractive. 

I image this would be a common scenario, with web programmers wanting to
leverage ajax's power, but with minimal impact on screen designs that a
business analyst or web designer might have come up with. 

I might have missed the concept of why you would want a submit button to
have its own table row and cell embedded? What if you want something else
next to the submit button on the screen? 

Anyway, thanks a lot for the help, very impressed with S2's flexibility.

Kind regards
Jason


-----Original Message-----
From: Musachy Barroso [mailto:musachy@gmail.com] 
Sent: Friday, 18 May 2007 10:38 PM
To: Struts Users Mailing List
Subject: Re: [S2] Is there a way to turn of formatting of controls with ajax
theme?

Just to confirm what Dave said, in 2.0.x you will have to modify the
template to remove the layout tags. In 2.1 the submit button will have the
layout tags only if it is inside a form, for which the theme is either
"css_xhtml"(divs) or "xhtml"(trs) (to keep backward compatibility).

musachy

On 5/17/07, Dave Newton <ne...@yahoo.com> wrote:
>
> --- Martin Gainty <mg...@hotmail.com> wrote:
> > 1)first instinct says to change the 'theme' as soap themes typically 
> > interact with <div> tag
>
> I think he means ajax.
>
> I don't know which bits of the ajax are rendered by the tag template. 
> The idea is correct; if you don't want the extra decorations you'll 
> probably (for now) need to either tweak the template, or examine the 
> output of the ajax theme and do a bit of manual work.
>
> I know that in 2.1 the ajax stuff is being moved in to a plugin, so 
> hopefully using the ajax functionality in arbitrary layout themes will 
> be easier :/
>
> >
> http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/jsp/JspContext.htm
> l
> > 2)override the setContext with a new context
> > (JspContext) where
>
> Honestly, I have no idea what that has to do with this issue, but 
> maybe it does. I've had a few extra Guinness this evening.
>
> > From: "Jason Wyatt" <jw...@itree.com.au>
> >> I want to use ajax submit buttons to refresh tabs, but when ajax 
> >> theme is set, the buttons are wrapped
>
> >> in additional <tr> and <td> tags. This is doing interesting and 
> >> unhelpful things to our page
> layout.
>
> Yeah, but you got to say that last sentence, and that's worth 
> something right there.
>
> See the following link for a bit more info on themes and templates.
>
> http://struts.apache.org/2.x/docs/themes-and-templates.html
>
> d.
>
>
>
>
> ______________________________________________________________________
> ______________Pinpoint customers who are looking for what you sell.
> http://searchmarketing.yahoo.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


--
"Hey you! Would you help me to carry the stone?" Pink Floyd



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


Re: [S2] Is there a way to turn of formatting of controls with ajax theme?

Posted by Musachy Barroso <mu...@gmail.com>.
Just to confirm what Dave said, in 2.0.x you will have to modify the
template to remove the layout tags. In 2.1 the submit button will have the
layout tags only if it is inside a form, for which the theme is either
"css_xhtml"(divs) or "xhtml"(trs) (to keep backward compatibility).

musachy

On 5/17/07, Dave Newton <ne...@yahoo.com> wrote:
>
> --- Martin Gainty <mg...@hotmail.com> wrote:
> > 1)first instinct says to change the 'theme' as soap
> > themes typically interact with <div> tag
>
> I think he means ajax.
>
> I don't know which bits of the ajax are rendered by
> the tag template. The idea is correct; if you don't
> want the extra decorations you'll probably (for now)
> need to either tweak the template, or examine the
> output of the ajax theme and do a bit of manual work.
>
> I know that in 2.1 the ajax stuff is being moved in to
> a plugin, so hopefully using the ajax functionality in
> arbitrary layout themes will be easier :/
>
> >
> http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/jsp/JspContext.html
> > 2)override the setContext with a new context
> > (JspContext) where
>
> Honestly, I have no idea what that has to do with this
> issue, but maybe it does. I've had a few extra
> Guinness this evening.
>
> > From: "Jason Wyatt" <jw...@itree.com.au>
> >> I want to use ajax submit buttons to refresh tabs,
> >> but when ajax theme is set, the buttons are wrapped
>
> >> in additional <tr> and <td> tags. This is doing
> >> interesting and unhelpful things to our page
> layout.
>
> Yeah, but you got to say that last sentence, and
> that's worth something right there.
>
> See the following link for a bit more info on themes
> and templates.
>
> http://struts.apache.org/2.x/docs/themes-and-templates.html
>
> d.
>
>
>
>
> ____________________________________________________________________________________Pinpoint
> customers who are looking for what you sell.
> http://searchmarketing.yahoo.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

Re: [S2] Is there a way to turn of formatting of controls with ajax theme?

Posted by Dave Newton <ne...@yahoo.com>.
--- Martin Gainty <mg...@hotmail.com> wrote:
> 1)first instinct says to change the 'theme' as soap
> themes typically interact with <div> tag

I think he means ajax.

I don't know which bits of the ajax are rendered by
the tag template. The idea is correct; if you don't
want the extra decorations you'll probably (for now)
need to either tweak the template, or examine the
output of the ajax theme and do a bit of manual work.

I know that in 2.1 the ajax stuff is being moved in to
a plugin, so hopefully using the ajax functionality in
arbitrary layout themes will be easier :/

>
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/jsp/JspContext.html
> 2)override the setContext with a new context
> (JspContext) where

Honestly, I have no idea what that has to do with this
issue, but maybe it does. I've had a few extra
Guinness this evening.

> From: "Jason Wyatt" <jw...@itree.com.au>
>> I want to use ajax submit buttons to refresh tabs,
>> but when ajax theme is set, the buttons are wrapped

>> in additional <tr> and <td> tags. This is doing
>> interesting and unhelpful things to our page
layout.

Yeah, but you got to say that last sentence, and
that's worth something right there.

See the following link for a bit more info on themes
and templates.

http://struts.apache.org/2.x/docs/themes-and-templates.html

d.



       
____________________________________________________________________________________Pinpoint customers who are looking for what you sell. 
http://searchmarketing.yahoo.com/

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


Re: [S2] Is there a way to turn of formatting of controls with ajax theme?

Posted by Martin Gainty <mg...@hotmail.com>.
1)first instinct says to change the 'theme' as soap themes typically 
interact with <div> tag

OR
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/jsp/JspContext.html
2)override the setContext with a new context (JspContext) where
the JspContext you are creating has the selected attributes 
<present|notpresent>
apparent order of operations
create JspContext
creating writer of JspContext
pushBody
popBody
setContext
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/jsp/tagext/SimpleTagSupport.html#setJspBody(javax.servlet.jsp.tagext.JspFragment)
M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- 
From: "Jason Wyatt" <jw...@itree.com.au>
To: "'Struts Users Mailing List'" <us...@struts.apache.org>
Sent: Thursday, May 17, 2007 8:32 PM
Subject: [S2] Is there a way to turn of formatting of controls with ajax 
theme?


>I want to use ajax submit buttons to refresh tabs, but when ajax theme is
> set, the buttons are wrapped in additional <tr> and <td> tags. This is 
> doing
> interesting and unhelpful things to our page layout.
>
> This submit tag:
>
> <s:submit name="save" value="Save" formId="stcSearchForm"
> targets="stcSightingsTab,stcSearchForm" 
> action="NcrStcSightingSearchAction"
> showLoadingText="false" indicator="true" theme="ajax" 
> cssClass="buttonClass"
> tabindex="10" type="input" />
>
> generates the following HTML:
>
> <tr>
> <td colspan="2"><div align="right">    <input type="submit"
> dojoType="struts:Bind" event="onclick" value="Save"
>  id="stcSearchForm_save"  formId="stcSearchForm"
> tabindex="10"    class="buttonClass"
> name="action:NcrStcSightingSearchAction"
> targets="stcSightingsTab,stcSearchForm"    indicator="true"
> showLoading="false"  />
> </div></td>
> </tr>
>
> I'm hoping to remove the <tr>, <td> and <div> tags.
>
>
> Thanks for any help, kind regards
>
> Jason
>
>
> -----
> Falun Dafa  Truth - Compassion - Forbearance
>
> A mind & body practice under persecution in China
>
> http://www.faluninfo.net
>
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> 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