You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ignacio de Córdoba <ic...@skios.es> on 2009/04/14 13:12:53 UTC

Removing the align="right" from tag

Hi there,
i am using css_xhtml them and renders all form elements quite ok but it
inserts a align="right" in the <div> enclosing every submit button.
Is there anyway to remove that right alignment? I guess all this should be a
matter of css and not an alignment in the HTML code. Don't know if it is a
bug of the theme or the desired code rendered.
I've searched here but found no info on how to extend or modify a builtin
them in struts2.

thanks for any help,
Ignacio
-- 
View this message in context: http://www.nabble.com/Removing-the-align%3D%22right%22-from-%3Cs%3Asubmit%3E-tag-tp23037513p23037513.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Removing the align="right" from tag

Posted by Dave Newton <ne...@yahoo.com>.
Ignacio de Córdoba wrote:
> Hi again Dave,
> I am using Struts 2.1.2 (I believe it is last public version).

2.1.2 was never a GA (IIRC); the latest version is 2.1.6.

Dave


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


RE: Removing the align="right" from tag

Posted by Ignacio de Córdoba <ic...@skios.es>.
Hi again,
I have successfully extended css_xhtml theme but I am having a problem form
sx:submit.
I specify struts.ui.theme=servengine in struts.properties and the new theme
works OK (servengine y the name of my new theme)

My problem is... sx:submit still uses ajax theme (I had to replace
submit:ftl also for this) Obviously I have to also extend ajax theme
(servengine_ajax) but... how do I specify the framework to use that new
theme for sx tags in struts.properties?

thanks,
Ignacio
-- 
View this message in context: http://www.nabble.com/Removing-the-align%3D%22right%22-from-%3Cs%3Asubmit%3E-tag-tp23037513p23040460.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


RE: Removing the align="right" from tag

Posted by Martin Gainty <mg...@hotmail.com>.
applying the patch is easy..testing is non-trivial

a very quick scan I did'nt see anything jump out with ftl ..the java classes have some possibly indeterminant results..testing all possible permutations is 'non-trivial'

pls keep the list apprised on what works for your testcase

Saludos Cordiales 
Martin Gainty 
______________________________________________ 
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note de déni et de confidentialité 
This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents.
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.






> Date: Tue, 14 Apr 2009 06:24:00 -0700
> From: icordoba@skios.es
> To: user@struts.apache.org
> Subject: Re: Removing the align="right" from <s:submit> tag
> 
> 
> Hi again Dave,
> I am using Struts 2.1.2 (I believe it is last public version).
> 
> I'll try to make that patch. Got a private message from other user with
> directions about which classes to check (SubmitTag, AbstractUITag and
> AbstractClosingTag)... anyway, I've never made such a patch so I'm sure I'll
> take me a lot of time. I'll try anyway but also post here any solutions I've
> found.
> 
> Thanks,
> Ignacio
> 
> 
> newton.dave wrote:
> > 
> > Ignacio de Córdoba wrote:
> >> Thanks Dave,
> >> I did that (myClass) but the class is only added to the <input /> tag,
> >> not
> >> to the div enclosing it, which is the one that has that magnificent align
> >> parameter. I'm on my way extending css_xhtml them to try to solve this.
> >> I'll
> >> post about it here...
> > 
> > Oh, right. Which version of S2 are you using? There were at least a 
> > couple of issues with non-CSS-ish behavior in the CSS theme that may 
> > have been addressed at some point (like <br/> tags etc.)
> > 
> > If it hasn't been fixed already consider creating a patch against the 
> > current S2 trunk to clean up any remaining issues.
> > 
> > Dave
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> > 
> > 
> > 
> 
> -- 
> View this message in context: http://www.nabble.com/Removing-the-align%3D%22right%22-from-%3Cs%3Asubmit%3E-tag-tp23037513p23039403.html
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

_________________________________________________________________
Rediscover Hotmail®: Get quick friend updates right in your inbox. 
http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Updates1_042009

Re: Removing the align="right" from tag

Posted by Ignacio de Córdoba <ic...@skios.es>.
Hi there,
Maybe this helps someone else... I just solved my problem by unpacking
struts2-core-2.1.6.jar and placing submit.ftl file in webapp dir
/WEB-INF/classes/template/... commenting the following:

<#--if parameters.align??>
    align="${parameters.align?html}"<#t/>
</#if-->

(Lines 20->30)

I noted that these didn't work for sx:submit, which I also use a lot; I had
to unpack struts2-dojo-plugin-2.1.6.jar (which contains ajax template) and
do the same (/template/ajax/...) In this case, align parameter appears
twice.

I'll figure out how to do the patch. I guess that at least for css_xhtml
theme, no "align" code should ever appear in HTML code.

Ignacio
-- 
View this message in context: http://www.nabble.com/Removing-the-align%3D%22right%22-from-%3Cs%3Asubmit%3E-tag-tp23037513p23039837.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Removing the align="right" from tag

Posted by Ignacio de Córdoba <ic...@skios.es>.
Hi again Dave,
I am using Struts 2.1.2 (I believe it is last public version).

I'll try to make that patch. Got a private message from other user with
directions about which classes to check (SubmitTag, AbstractUITag and
AbstractClosingTag)... anyway, I've never made such a patch so I'm sure I'll
take me a lot of time. I'll try anyway but also post here any solutions I've
found.

Thanks,
Ignacio


newton.dave wrote:
> 
> Ignacio de Córdoba wrote:
>> Thanks Dave,
>> I did that (myClass) but the class is only added to the <input /> tag,
>> not
>> to the div enclosing it, which is the one that has that magnificent align
>> parameter. I'm on my way extending css_xhtml them to try to solve this.
>> I'll
>> post about it here...
> 
> Oh, right. Which version of S2 are you using? There were at least a 
> couple of issues with non-CSS-ish behavior in the CSS theme that may 
> have been addressed at some point (like <br/> tags etc.)
> 
> If it hasn't been fixed already consider creating a patch against the 
> current S2 trunk to clean up any remaining issues.
> 
> Dave
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Removing-the-align%3D%22right%22-from-%3Cs%3Asubmit%3E-tag-tp23037513p23039403.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Removing the align="right" from tag

Posted by Dave Newton <ne...@yahoo.com>.
Ignacio de Córdoba wrote:
> Thanks Dave,
> I did that (myClass) but the class is only added to the <input /> tag, not
> to the div enclosing it, which is the one that has that magnificent align
> parameter. I'm on my way extending css_xhtml them to try to solve this. I'll
> post about it here...

Oh, right. Which version of S2 are you using? There were at least a 
couple of issues with non-CSS-ish behavior in the CSS theme that may 
have been addressed at some point (like <br/> tags etc.)

If it hasn't been fixed already consider creating a patch against the 
current S2 trunk to clean up any remaining issues.

Dave


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


Re: Removing the align="right" from tag

Posted by Ignacio de Córdoba <ic...@skios.es>.
Thanks Dave,
I did that (myClass) but the class is only added to the <input /> tag, not
to the div enclosing it, which is the one that has that magnificent align
parameter. I'm on my way extending css_xhtml them to try to solve this. I'll
post about it here...


newton.dave wrote:
> 
> 
> 
> Or you could add a CSS class for submits, if they're all going to be the 
> same.
> 
> Dave
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Removing-the-align%3D%22right%22-from-%3Cs%3Asubmit%3E-tag-tp23037513p23038903.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Removing the align="right" from tag

Posted by Dave Newton <ne...@yahoo.com>.
Ignacio de Córdoba wrote:
> <s:submit key='store' cssClass="myClass"/>
> 
> renders:
> 
> <div align="right"    id="wwctrl_Category_store_action_store"><input
> type="submit" id="Category_store_action_store" name="store" value="Store"
> class="myClass"/></div>
> 
> As you see, <div> enclosing the input tag has no class. Just "align" and
> "id" fields. To override that align i'll have to add a entry for every
> s:submit in my application. I don't know how to add a "class" to that div.
> Anyway, that would make me change all s:submits.

Or you could add a CSS class for submits, if they're all going to be the 
same.

Dave


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


Re: Removing the align="right" from tag

Posted by Paweł Wielgus <po...@gmail.com>.
Hi Ignacio,
it's pretty easy to overwrite s:submit, just follow the docs about that,
also You can extract original s:submit ftl file from struts jar to see
how it's made and what and where to make changes.

Still what You have found looks like a bug.

Best greetings,
Paweł Wielgus.

El día 14 de abril de 2009 13:28, Ignacio de Córdoba
<ic...@skios.es> escribió:
>
> Thanks for your reply... mmmm... my tag:
>
> <s:submit key='store' cssClass="myClass"/>
>
> renders:
>
> <div align="right"    id="wwctrl_Category_store_action_store"><input
> type="submit" id="Category_store_action_store" name="store" value="Store"
> class="myClass"/></div>
>
> As you see, <div> enclosing the input tag has no class. Just "align" and
> "id" fields. To override that align i'll have to add a entry for every
> s:submit in my application. I don't know how to add a "class" to that div.
> Anyway, that would make me change all s:submits.
>
> ¿ Is it that complex to override s:submit and make it just render:
> <div id="wwctrl_Category_store_action_store"><input type="submit"
> id="Category_store_action_store" name="store" value="Store"
> class="myClass"/></div>
> ?
>
> Maybe I'm missing something... i'll try wrapping css_xhtml them into a new
> theme as explained in the docs. Thanks for any other ideas on this...
>
>
> felipe.lorenz wrote:
>>
>> You can change it by using CSS!
>>
>> 2009/4/14 Ignacio de Córdoba <ic...@skios.es>
>>
>>>
>>> Hi there,
>>> i am using css_xhtml them and renders all form elements quite ok but it
>>> inserts a align="right" in the <div> enclosing every submit button.
>>> Is there anyway to remove that right alignment? I guess all this should
>>> be
>>> a
>>> matter of css and not an alignment in the HTML code. Don't know if it is
>>> a
>>> bug of the theme or the desired code rendered.
>>> I've searched here but found no info on how to extend or modify a builtin
>>> them in struts2.
>>>
>>> thanks for any help,
>>> Ignacio
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Removing-the-align%3D%22right%22-from-%3Cs%3Asubmit%3E-tag-tp23037513p23037513.html
>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>>
>> --
>> Felipe A. Lorenz
>> Idealogic Software
>> http://www.idealogic.com.br
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Removing-the-align%3D%22right%22-from-%3Cs%3Asubmit%3E-tag-tp23037513p23037715.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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: Removing the align="right" from tag

Posted by Ignacio de Córdoba <ic...@skios.es>.
Thanks for your reply... mmmm... my tag:

<s:submit key='store' cssClass="myClass"/>

renders:

<div align="right"    id="wwctrl_Category_store_action_store"><input
type="submit" id="Category_store_action_store" name="store" value="Store"
class="myClass"/></div>

As you see, <div> enclosing the input tag has no class. Just "align" and
"id" fields. To override that align i'll have to add a entry for every
s:submit in my application. I don't know how to add a "class" to that div.
Anyway, that would make me change all s:submits.

¿ Is it that complex to override s:submit and make it just render:
<div id="wwctrl_Category_store_action_store"><input type="submit"
id="Category_store_action_store" name="store" value="Store"
class="myClass"/></div>
?

Maybe I'm missing something... i'll try wrapping css_xhtml them into a new
theme as explained in the docs. Thanks for any other ideas on this...


felipe.lorenz wrote:
> 
> You can change it by using CSS!
> 
> 2009/4/14 Ignacio de Córdoba <ic...@skios.es>
> 
>>
>> Hi there,
>> i am using css_xhtml them and renders all form elements quite ok but it
>> inserts a align="right" in the <div> enclosing every submit button.
>> Is there anyway to remove that right alignment? I guess all this should
>> be
>> a
>> matter of css and not an alignment in the HTML code. Don't know if it is
>> a
>> bug of the theme or the desired code rendered.
>> I've searched here but found no info on how to extend or modify a builtin
>> them in struts2.
>>
>> thanks for any help,
>> Ignacio
>> --
>> View this message in context:
>> http://www.nabble.com/Removing-the-align%3D%22right%22-from-%3Cs%3Asubmit%3E-tag-tp23037513p23037513.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> 
> -- 
> Felipe A. Lorenz
> Idealogic Software
> http://www.idealogic.com.br
> 
> 

-- 
View this message in context: http://www.nabble.com/Removing-the-align%3D%22right%22-from-%3Cs%3Asubmit%3E-tag-tp23037513p23037715.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Removing the align="right" from tag

Posted by Felipe Lorenz <fe...@gmail.com>.
You can change it by using CSS!

2009/4/14 Ignacio de Córdoba <ic...@skios.es>

>
> Hi there,
> i am using css_xhtml them and renders all form elements quite ok but it
> inserts a align="right" in the <div> enclosing every submit button.
> Is there anyway to remove that right alignment? I guess all this should be
> a
> matter of css and not an alignment in the HTML code. Don't know if it is a
> bug of the theme or the desired code rendered.
> I've searched here but found no info on how to extend or modify a builtin
> them in struts2.
>
> thanks for any help,
> Ignacio
> --
> View this message in context:
> http://www.nabble.com/Removing-the-align%3D%22right%22-from-%3Cs%3Asubmit%3E-tag-tp23037513p23037513.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Felipe A. Lorenz
Idealogic Software
http://www.idealogic.com.br