Re: Init of forms

2006-09-26 Thread Antonio Petrelli
Andy.de ha scritto: Hi Antonio, i do not understand. The action is executed if the form is submitted, this is after the jsp has been displayed. Yeah, you're right I was missing a point. You have to call ANOTHER action that prepopulates an object and puts it, for example, in request scope, the

RE: How to validate an integer array

2006-09-26 Thread Chetan Pandey
Thanks Wendy. I am trying to validate an array of ints. The following should be true: 1. The array is not null. 2. The first value in its index should be higher than 0. 3. If the first value is 0 then its length must be greater than 2. The following validation failed miserably:

Re: How to validate an integer array

2006-09-26 Thread Wendy Smoak
On 9/26/06, Chetan Pandey <[EMAIL PROTECTED]> wrote: In my form I have Int [] roleIds = null. This is used as the Underlying Datatype of a multiple-select Drop-down. Everything works fine but I am not sure how to validate? The following that I tried did not work:

How to validate an integer array

2006-09-26 Thread Chetan Pandey
Hi All: In my form I have Int [] roleIds = null. This is used as the Underlying Datatype of a multiple-select Drop-down. Everything works fine but I am not sure how to validate? The following that I tried did not work: test (*t

Re: cannot get value using request.getParameter in struts tiles layout file

2006-09-26 Thread Vinod Kumar
Actually, value of "print" variable is not fixed. It can be 0 (not printable) or 1 (printable version). So unless, I could get this value from request.getParameter, I can't even make it hidden. Thanks Vinod --- Uday Chandra Karrothi <[EMAIL PROTECTED]> wrote: > Can you use the formBean? > Someth

Re: Multiple radio button groups

2006-09-26 Thread Chris Pratt
I think I see the problem, it was with my example, it should have been: var value = radioValue(document.formName.elements["apprEntry[0].primary_or_adjunct"]); where "formName" is the value of the name attribute of the form tag. (*Chris*) On 9/26/06, Uday Chandra Karrothi <[EMAIL PROTECTED]>

Re: cannot get value using request.getParameter in struts tiles layout file

2006-09-26 Thread Uday Chandra Karrothi
Can you use the formBean? Something like pgForm.getPrint(); // i am not sure though or you can try this. Declare Print as a hidden variable in the jsp page. That way i think you will be able to access the variable. try this. I hope that works. Uday On 9/26/06, Vinod Kumar <[EMAIL PROTECTED]>

Re: Init of forms

2006-09-26 Thread Yamir Encarnacion
Take a look at http://struts.apache.org/1.1/faqs/newbie.html#prepopulate (How can I prepopulate a form?) I believe that the struts-example.war example application that is shipped with Struts 1.1 has the code for doing what you want. I believe that you want to look at the editRegistration ac

Re: [s2] Freemarker Shortcuts

2006-09-26 Thread Ted Husted
<@s.textfield name="user.userName" label="%{getText('user.userName')}"/> should work, but, yes, this is an area where the Struts 2 tags are still strangely verbose. Feel free to file a feature request for concise alternative syntax. To lookup mesages resources in the S2 validati

Re: [Strust2] how does Interceptor work?

2006-09-26 Thread Ted Husted
On 9/26/06, Labey Sébastien <[EMAIL PROTECTED]> wrote: Hi, I'm new to Struts2 and i don't really understand how does Interceptor technique work. There's an example of an Interceptor in the MailReader example. It uses it to provide application-based authentification. It's a "before-only" interc

Re: Multiple radio button groups

2006-09-26 Thread Uday Chandra Karrothi
Thanks Chris, The request.getParameter works. I think i am going to go with that. the javascript was throwing soem errors. I will figure that out later. Thanks for the help once again. Later Uday Chandra On 9/26/06, Chris Pratt <[EMAIL PROTECTED]> wrote: Wow, those are some ugly field names,

Re: how to initialize custon-chain.config

2006-09-26 Thread Mark Shifman
Thanks Wendy, I used: chainConfig org/apache/struts/chain/chain-config.xml, /WEB-INF/ custom-chain-config..xml And it worked! The first loads the "struts" catalog and the second load my own catalog. Thanks again, Mark Shifman Wendy Smoak wrote: On 9/26/06, Mark Shifman <[EMAIL PROTECTED]>

[Announce] Stylus Studio 2007 XML Enterprise Suite Released: XML Pipeline, XML Publishing and Data Conversion API's

2006-09-26 Thread Stylus Studio
[Announce] Dear Struts Users - Stylus Studio 2007 XML Enterprise Suite is now available for free trial download, featuring all-new tools for XML Pipelining, XML Publishing, powerful new Data Conversion APIs and so much more at new reduced prices. Read on for more information, or download it now a

cannot get value using request.getParameter in struts tiles layout file

2006-09-26 Thread Vinod Kumar
I am not able to get the value of the request parameter using request.getParameter("Print") I am trying to get this value in the layout-tiles.jsp file. I use this URL to make the call http://localhost/appname/jsp/login.jsp?print=1 below are the two files. Any help will be appreciated. **

Re: Init of forms

2006-09-26 Thread Andy.de
Hi Antonio, i do not understand. The action is executed if the form is submitted, this is after the jsp has been displayed. I want to fill the form with values from database before the jsp is displayed. I need the typical 'edit' function, not create. Regards, Andy apetrelli wrote: > > Ilja S. h

Re: Init of forms

2006-09-26 Thread Andy.de
Hi Ilja, i'm using DAO patterns but the question was: how can i init a form inside an action. I Didn't find any method to do this and also no example. All struts samples are with forms to create new objects and not to edit existing objects. regards, Andy Ilja S. wrote: > > Hi > Action class is r

Re: how to initialize custon-chain.config

2006-09-26 Thread Wendy Smoak
On 9/26/06, Mark Shifman <[EMAIL PROTECTED]> wrote: HI; I am starting to play with chains and commands in 1.3.5 and I was wondering where I initialize the my custom chains ? I don't want to mess with the request processor, just add a few command chains of my own. ... Do I need to extract the c

Re: Multiple radio button groups

2006-09-26 Thread Chris Pratt
Wow, those are some ugly field names, but you should be able to access it from either. In JavaScript I would probably use a helper function something like: function radioValue (fld) { for(var i = 0; i < fld.length;i++) { if(fld[i].checked) { return fld[i].value; } } return fld[0].v

Re: Multiple radio button groups

2006-09-26 Thread Uday Chandra Karrothi
Thanks Chris for the response. But here is the problem. .. Pri. Adj. .. The resultant html code is ... Pri. Adj. ... Pri. Adj. ... You are right to say that the all the radio with the same name are conside

Re: Multiple radio button groups

2006-09-26 Thread Chris Pratt
All the radio buttons (or checkboxes) with the same name are in a "button group". The value of the selected radio button (or list of selected checkboxes) is returned from request.getParameter() (or request.getParameterValues()). (*Chris*) On 9/26/06, Uday Chandra Karrothi <[EMAIL PROTECTED]> wr

Multiple radio button groups

2006-09-26 Thread Uday Chandra Karrothi
Hi there, I have a problem. I am using groups of radio buttons. .. Pri. Adj. .. How can get the value of the selected radio buttons in the action form. Is there something like a multibox for a radio group? if it is just one radio button group, i can get it from the property of the form

how to initialize custon-chain.config

2006-09-26 Thread Mark Shifman
HI; I am starting to play with chains and commands in 1.3.5 and I was wondering where I initialize the my custom chains ? I don't want to mess with the request processor, just add a few command chains of my own. The cookbook mail reader example from commons.chain uses a context-param and lis

Re: [Strust2] how does Interceptor work?

2006-09-26 Thread David Evans
Hello, These webwork and xwork doc pages may help: http://wiki.opensymphony.com/display/XW/Interceptors http://www.opensymphony.com/webwork/api/com/opensymphony/xwork/ActionInvocation.html http://www.opensymphony.com/webwork/api/com/opensymphony/xwork/ActionProxy.html Passed in to your intercepto

Re: Init of forms

2006-09-26 Thread Ilja S.
Hi Action class is right place. Common way is to have some layer working with DB like DAO pattern. Then You can have some service layer between DAO and Action which you call from Action class. Call it, get data transfer object from DB, copy its properties to ActionForm instance and forward requ

Re: Init of forms

2006-09-26 Thread Antonio Petrelli
Ilja S. ha scritto: Hi Action class is right place. Common way is to have some layer working with DB like DAO pattern. Then You can have some service layer between DAO and Action which you call from Action class. Call it, get data transfer object from DB, copy its properties to ActionForm inst

Re: Error loading Collection in form

2006-09-26 Thread Francisco Exposito Aguilera
Hi, I've solved the issue this morning. My DTOGroup.java was not correctly defined. I had public class DTOGroups extends DynaValidatorForm implements Serialize and the extends DynaValidatorForm is not correct -obvious I don't remember to put it there :) From: "Thomas Joseph" <[EMAIL

Re: sort the list

2006-09-26 Thread Thomas Joseph
Hi, I agree with all of the above comments. You may like to use them in different scenarios: 1. DB sort using "order by" but each request will cost your db access connection 2. Sorting in DAO is good 3. Soring in any case (at JSP/Business layer/DAO) require you to do some comparison , you can crea

Re: [HELP] Can't not submit unicode form by ajax action in Struts + Velocity framework

2006-09-26 Thread Martin Gainty
just out of curiosity have you implemented your Ajax Control with RPC or doc-literal or some other type of transport? Thanks, M- * This email message and any files transmitted with it contain confidential information intended only

Init of forms

2006-09-26 Thread Andy.de
Hi folks, i init my form beans at reset(...) of ActionForm from database but i think this is not correct because if an error occurs i have no chance to forward to an error page or to save ActionErrors. I think the controller must read objects from database and init the form. All samples are very s

Re: Error loading Collection in form

2006-09-26 Thread Thomas Joseph
Hi, - Original Message - From: "harriquitawn tawn tawn" <[EMAIL PROTECTED]> To: Sent: Monday, September 25, 2006 7:31 PM Subject: Error loading Collection in form > > I get the name of the project without problem with the line: > > property="name"/>"/> > > but when I want to show all ro

Re: [HELP] Can't not submit unicode form by ajax action in Struts + Velocity framework

2006-09-26 Thread Pham Anh Tuan
oh ... :O ... I just forgot Post method :( ... thank you for reminding me ... I will try it. Again, thanks for ur feedback :) - Original Message - From: "Antonio Petrelli" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Tuesday, September 26, 2006 4:13 PM Subject: Re: [HE

[Strust2] how does Interceptor work?

2006-09-26 Thread Labey Sébastien
Hi, I'm new to Struts2 and i don't really understand how does Interceptor technique work. I have made my own interceptor that implements Interceptor interface. I place it in struts.xml with my action. It's OK, before invoking my action, i go through my interceptor in the intercept() method. But

Re: [HELP] Can't not submit unicode form by ajax action in Struts + Velocity framework

2006-09-26 Thread Antonio Petrelli
Pham Anh Tuan ha scritto: when I test the submitted url, it gives me the right unicode value for each parameter I sent. ex: .do?st1=tốivề&st2=ngàyvề but when I retrieve it from bean, it was not unicode value :( st1: "tốivề" ---> "tối về" st2: "ngàyvề" ---> "ngà y về" I don't know wh

Re: [HELP] Can't not submit unicode form by ajax action in Struts + Velocity framework

2006-09-26 Thread Pham Anh Tuan
when I test the submitted url, it gives me the right unicode value for each parameter I sent. ex: .do?st1=tốivề&st2=ngàyvề but when I retrieve it from bean, it was not unicode value :( st1: "tốivề" ---> "tối về" st2: "ngàyvề" ---> "ngà y về" I don't know what's wrong? - Original

Re: [HELP] Can't not submit unicode form by ajax action in Struts + Velocity framework

2006-09-26 Thread Pham Anh Tuan
ah ha, yeahh, thanks a lot Antonio, I solved my problem! again, thank u (^-^) bowlkhin - Original Message - From: "Antonio Petrelli" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Tuesday, September 26, 2006 4:41 PM Subject: Re: [HELP] Can't not submit unico

Re: [HELP] Can't not submit unicode form by ajax action in Struts + Velocity framework

2006-09-26 Thread Antonio Petrelli
Pham Anh Tuan ha scritto: Antonio, would you mind showing an example how to use POST method with AJAX ? Your question is too generic. Maybe you need simply JavaScript, in this case I suggest to read this piece of tutorial http://www.w3schools.com/htmldom/dom_obj_form.asp HTH Antonio -

Re: [HELP] Can't not submit unicode form by ajax action in Struts + Velocity framework

2006-09-26 Thread Pham Anh Tuan
Antonio, would you mind showing an example how to use POST method with AJAX ? thanks in advace bowlkhin - Original Message - From: "Pham Anh Tuan" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Tuesday, September 26, 2006 4:16 PM Subject: Re: [HELP] Can't not submit unicod

[HELP] Can't not submit unicode form by ajax action in Struts + Velocity framework

2006-09-26 Thread Pham Anh Tuan
Hi all, I got a trouble when I submit the unicode form by ajax. when I test the submitted url, it gives me the right unicode value for each parameter I sent. ex: .do?st1=tốivề&st2=ngàyvề but when I retrieve it from bean, it was not unicode value :( this trouble happens only when I submit

RE: sort the list

2006-09-26 Thread Strachan, Paul
You could create your own sort class which implements java.util.Comparator e.g. public class MySort implements Comparator { compare(o1, o2) { String name1 = (String) o1.getLastName(); String name2 = (String) o2.getLastName(); return name1.compareTo(name2); } } th