s:url before sj:a and sj:div

322 views
Skip to first unread message

Alireza Fattahi

unread,
Jul 9, 2013, 4:35:21 AM7/9/13
to struts2...@googlegroups.com
Hi,

Please see below code
<s:url var="menuurl" action="showcase-menu-ajax" namespace="/" />
<sj:a id="ajaxmenulink" href="%{menuurl}" targets="menu">Ajax</sj:a>

We always define a s:url tag before sj:a. Is there any way we can directly ask sj:a to find the action class
For example
<sj:a id="ajaxmenulink" href="%{menuurl}" targets="menu" action="showcase-menu-ajax" />


The same problem is for sj:div too:
<s:url var="remotelinkurl" action="accounts-main"  />
<sj:div id="content" href="%{remotelinkurl}"  />

   

Regards,
Alireza Fattahi

Alireza Fattahi

unread,
Jul 9, 2013, 3:01:57 AM7/9/13
to struts2...@googlegroups.com
Hi,

I have examined struts2-jquery-plugin-3.6.0.jar file. there is a template folder in it named jquery.
Mean while I could not find any tag with  theme="jquery".

Is it for struts2-jquery internal use ?
Can/should we use it? If yes where and how?
  
 
~Regards,
~~Alireza Fattahi

jogep

unread,
Jul 11, 2013, 5:00:09 PM7/11/13
to struts2...@googlegroups.com, Alireza Fattahi
You are right this "jquery" template folder is internally used by the Struts2 jQuery Plugin.
All templates for the Tags like Datepicker, Anchor, Tabs, ... are located there.

Currently the <s:url ... /> tag is necessary for all Anchor and Div Tags,
Because the Base Div and Anchor Tag from Struts does not support
an action attribute.

Best Regards

Johannes Geppert


#################################################

Alireza Fattahi

unread,
Jul 13, 2013, 5:28:12 AM7/13/13
to struts2...@googlegroups.com
Hi,

I found that:
<s:actionerror theme="jquery" />
<s:fielderror theme="jquery" />
   
Does not work for ajax forms with validation !! Am I correct? 
So how can we show the list of fields which have errors?

~Regards,
~~Alireza Fattahi


Alireza Fattahi

unread,
Jul 13, 2013, 9:21:38 AM7/13/13
to struts2...@googlegroups.com
Hi,

Does the <s:form> validation works only with xhtml theme.

Open form-validation.jsp and change the
<s:form id="formValidateAjax" action="login" theme="xhtml">
to
<s:form id="formValidateAjax" action="login" theme="simple">
 
The errors are not displayed any more !

How can we fix it ? I want to use my own template.

~Regards,
~~Alireza Fattahi


Alireza Fattahi

unread,
Jul 14, 2013, 12:54:43 AM7/14/13
to struts2...@googlegroups.com
Hi,


There is something strange or I don't get it at all !!
Please open form-validation.jsp file in show-case war. I want to tweak the ajax validation with link.
<tr>
        <td colspan="2">
            <sj:a
                    formIds="formValidateAjax"
                    targets="result"
                    button="true"
                    buttonIcon="ui-icon-gear"
                    validate="true"
                    indicator="indicator"
                    >AJAX Submit as Link</sj:a>
        </td>
    </tr>
Remove the <tr> and <td>
            <sj:a
                    formIds="formValidateAjax"
                    targets="result"
                    button="true"
                    buttonIcon="ui-icon-gear"
                    validate="true"
                    indicator="indicator"
                    >AJAX Submit as Link</sj:a>


The validation will not work !
 
~Regards,
~~Alireza Fattahi


Alireza Fattahi

unread,
Jul 14, 2013, 12:57:02 AM7/14/13
to struts2...@googlegroups.com
Hi,

The <sj:submit> does not work fine when you add key="foo.bar.FormLable" and the key is in UTF-8 character set. It displays garbage.
 
~Regards,
~~Alireza Fattahi


Alireza Fattahi

unread,
Sep 3, 2013, 4:01:25 AM9/3/13
to struts2...@googlegroups.com, jogep
Hi,
 
I want to add a custom widjet to jQuery ( just for information, it is a widget that enhance the form with jQuery themes www.tuttoaster.com/enhancing-forms-using-jquery-ui/1)
 
How can I do it, is there any extention point where should I start from there?!
 
Regards,
Alireza Fattahi
Reply all
Reply to author
Forward
0 new messages