Re: [S2] Why is it so difficult ?

2007-07-04 Thread sharad bhushan

Hi,

When we are trying to do this(@s.textfield 
name=poll.pollOptions[#{rowIndex}].option /) are assign a new name to every 
textbox.So why will the array return.It return them as different params and 
tries to autowire.So Use a ommon name for them and see what happens when you 
submit the form.It should return an array.


- Original Message 
From: Luciano Costa [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Tuesday, 3 July, 2007 12:23:30 AM
Subject: [S2] Why is it so difficult ?

Hi all,

I'm still trying to get binded these poll.pollOptions[] in my Action:

I think this should be easy.. but I'm suffering to get this working..

@s.textfield name=poll.name id=poll.name /
#assign rowIndex = 0
@s.iterator value=poll.pollOptions 
@s.textfield name=poll.pollOptions[#{rowIndex}].option /
#assign rowIndex = rowIndex + 1
/@s.iterator

The form is loaded correctly, but I can't get array data on pollOptions
after form submission.

Please help!


Thanks,

Luciano


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







Send free SMS to your Friends on Mobile from your Yahoo! Messenger. Download 
Now! http://messenger.yahoo.com/download.php

Re: Checkboxes problem

2007-07-04 Thread sharad bhushan
s:checkboxlist
label=List
list=${YourPredefinedList}
name=CommonName(is only one name)/
or
s:iterator value=manyNames status=cnt
  s:checkbox name=CommonName(is only one name) fieldValue=[${cnt}]
   
   /s:checkbox
  /s:iterator

Any of this should solve your problem. first one will iterate for itself second 
we are doing that.
But still all checkbox shouldhave same name. You bean of will surely get list 
of values(not true).

- Original Message 
From: Andreja [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Wednesday, 4 July, 2007 1:24:25 PM
Subject: Re: Checkboxes problem

Sharad, thank you for the answer.

Keeping in mind what you said, I tried to make it work like this:

  s:iterator value=manyNames status=cnt
  s:checkbox name=manyNames 
   s:property value=[${cnt}]/
   /s:checkbox
  /s:iterator

This populates the checkboxes, but when I submit the data, all I can
get is ArrayList of true booleans: [true, true...], and I can not use
that. I need something like:

[x]Tom
[ ]Dick
[x]Harry

And after submit, the list should be: [Tom, Harry].
The problem is that I can not make checkbox return String value
instead of boolean. There must be a way to do so, because
s:checkboxlist can return ArrayListString, but I don't know how to
do so by using s:checkbox.

Regards,
Andreja

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







Send free SMS to your Friends on Mobile from your Yahoo! Messenger. Download 
Now! http://messenger.yahoo.com/download.php

Re: Checkboxes problem

2007-07-03 Thread sharad bhushan
Hi,

Just a suggestion Why dont you have the common name for all check box holding 
the different values.How ever you may loose the struts2-checkbox 
feature(checkbox state) by doing this.YOu can populate the values of the 
checkbox in to a bean and use the across.

Regards
Sharad




Send free SMS to your Friends on Mobile from your Yahoo! Messenger. Download 
Now! http://messenger.yahoo.com/download.php

struts2-sitemesh

2006-09-11 Thread sharad bhushan
hi all,
 i am having problems when using sitemesh 2.2.1 and struts2.the problem is it 
does not alow me to use struts tag libraries.and gives an error
 
 
java.lang.NullPointerException
 org.apache.struts2.components.URL.end(URL.java:213)
 
org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:35)
 
org.apache.jsp.WEB_002dINF.jsp.common.components.header_jsp._jspx_meth_s_url_0(org.apache.jsp.WEB_002dINF.jsp.common.components.header_jsp:90)
 
org.apache.jsp.WEB_002dINF.jsp.common.components.header_jsp._jspService(org.apache.jsp.WEB_002dINF.jsp.common.components.header_jsp:64)
 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
 
org.apache.jsp.WEB_002dINF.decorators.main_jsp._jspService(org.apache.jsp.WEB_002dINF.decorators.main_jsp:103)
 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 
com.opensymphony.module.sitemesh.filter.PageFilter.applyDecorator(PageFilter.java:156)
 com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:59)

when defining a anchor tag

 a href=s:url action=home/home/a
 
 and the mapping was placee in struts.xml.
 can any one help me to find a solution
 if this does not work i feel i cant'use struts form features too...
 
 bye all
 

-
 Find out what India is talking about on  - Yahoo! Answers India 
 Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it 
NOW