its a MVC framework which contains Dojo Javascript libraries
keep in mind Dojo 0.42 has the ability to accomodate a dojo DataGrid

the simplest example:
in pure JavaScript you can use return JavaScriptObjectNotationResultset to a 
datagrid e.g.
no ftl.. no worries about configuring for struts just call the dojo control 
directly from JS
var itemData = {items: [{name: "Bill", hiredate: new Date("1975-8-1")}, ...]};

var store = new dojo.data.JsonItemStore({ data: itemData});


to accomodate in struts 
you will encounter these configuration considerations
first of all make SURE your modulePaths are set correctly for dojo.js (if you 
don't no .js will be loaded)
enable the gridData widget control to be found in 
WEB-INF/classes/template/simple/head.ftl
<script src="${base}/dojo/release-0.4.2/templates/gridData"></script>

if you want to set this up as a referencable control you'll want to look at 
creating a ftl (freemarker template library) for your control e.g.

<[EMAIL PROTECTED] prefix="s" uri="/struts-tags" %>
<html>
<head>
    <title>All People</title>
</head>

<body>

There are ${peopleCount} people... 
<table>
    <tr>
        <th>ID</th>
        <th>Name</th>
    </tr>
<#list people as person>
    <tr>
        <td>${person.id}</td>
        <td>${person.name}</td>
        <td>${person.lastName}</td>
    </tr>
</#list>
<!-- an example of a struts tag which has a ftl component is the 
inputtransferselect-->
    <s:inputtransferselect
        list="people"
        name="people_name"
        label="people_label"/>
</table>
<ul>
<!-- action class which will feed your people list -->
    <li><a href="editPerson.action">Edit people</a></li>
    <li><a href="newPerson!input.action">Create</a> a new person</li>
</ul>
</body>
</html>

but the s:inputtransferselect is meaningless without accompanying .ftl form 
which is defined in
template\simple\inputtransferselect.ftl *notice the inputtransferselect.js 
inclusion via s.url:*
head -8 inputtransferselect.ftl

<#if !stack.findValue("#inputtransferselect_js_included")?exists><#t/>
    <script type="text/javascript" src="<@s.url 
value="/struts/inputtransferselect.js" encode='false' 
includeParams='none'/>"></script>
    <#assign temporaryVariable = 
stack.setValue("#inputtransferselect_js_included", "true") /><#t/>
</#if><#t/>
<table border="0">
<tr>
<td>

Antonio/Musachy or jeromy can elaborate more descriptively on this topic
Martin 
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 


> Date: Sat, 13 Sep 2008 15:32:04 +0200
> From: [EMAIL PROTECTED]
> To: user@struts.apache.org
> Subject: Re: new to Struts
> 
> 1) I would go for Strut2 right away, Struts1 (aka Struts-classic) is a 
> completely different framework. Struts2 is more modern, more productive 
> and more enjoyable to use. A good starter book to learn Struts2 is 
> "Struts2 In Action" from Manning.
> 
> 2) Netbeans has a WYSIWYG JSP editor isn't it ?  It's all what you need, 
> because Strut2 configuration file is so much simpler and smaller [than 
> the ones for Strut1] that we really don't need a graphical 
> representation anymore. Also I remember seeing that there exists a 
> Netbean pluging specifically for Struts2 development. But you can also 
> comfortably develop Struts2 applications with EclipseWTP.
> 
> 3) Struts2 comes with all what you need for building form for user 
> input, but for data output, like lists and datagrids, it has... nothing. 
> Fortunately you can use almost all components that where crafted for JSP 
> over the years. This include http://code.google.com/p/jmesa/, 
> http://displaytag.sourceforge.net/11/ and 
> http://www.codeproject.com/KB/grid/DBGrid.aspx.  And finally you can 
> crafted your own component by witting a Freemarker template.
> 
> ZC.
> 
> 
> gbattine wrote:
> > Hello guys,
> > I need an information.
> > I'm going to learn struts..
> > I need some info, please help me:
> >
> > 1) what do you hint to me, to start from Struts 1.1 and later move to Struts
> > 2.0, or starting from Struts 2.0?
> > 2) I usually use Netbeans. Is there an editor WYSIWHG for Netbeans, to use
> > Struts?
> > 3) I know ASP.NET technology and I used lot of already developed components,
> > like editable grid, dropdown list and so on...does exists such component for
> > struts?where I can download them?
> >
> > Thanks,
> > Regards
> >   
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

_________________________________________________________________
Get more out of the Web. Learn 10 hidden secrets of Windows Live.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008

Reply via email to