Re: Using optionsCollection - LabelValueBean

2004-03-15 Thread Dean A. Hoover
t org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
   at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
   at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline



On Sun, 14 Mar 2004 Timo Tjäder wrote :
 

Hi,

Thanks Hubert, the problem was on the html page.

1. I forgot to add second form tag to handle page linking system on footer.
2. Also as you mentioned all the parameters must be match with the form beans I am 
posting.
After making those changes the combox box was redered nicely on same lone
with navigation numbers.
1 2 3 4 5 next COMBOBOX v

I have one rule when writing jsp pages and it is "no scriplets anymore".
The Struts handles everything nicely if some time is offered in designing
the beans and linking system.
In this case mine is

WEB->FORM->ACTION->SERVICE->BEAN
WEB<-FORM<-ACTION<-SERVICE<-BEAN
Service sets the values and they are read from the page using
struts tags (equal/iterate/present). The totalNumOfPagesCollection
comes actually from BEAN.
Thanks,

Timo

   

The  needs to be provided with the property it's associated to,
the one on your form bean that will hold the actual value selected.

  

"mySelectValue" should be a property on your form bean.

hth,

Hubert



--- Timo_Tjäder <[EMAIL PROTECTED]> wrote:
 

Hi,

I have problems with optionsCollection, when used with 
custom tag.
1. I set up in a bean LabelValueBean object in a Vector
2. pass it back to form and try to create a 
This part should display a combo box with options, but
it just does not work. It does not display anything.
Html code is as follows:




I have checked using struts "bean:write" the contents of
the object. Bean write claims that totalNumOfPages really
contains LabelValueBean-objects (14 peaces).
LabelValueBeanÄ1, 1Å, LabelValueBeanÄ2, 2Å, LabelValueBeanÄ3, 3Å,
...
So, does anyone know how to reference to this object correctly.
Current solution does not diaplay anything to the screen.
Thanks,

Timo

So what I'd like to do is display a selection list of
all availabele pages from which user choose one and press
a goTo page button. This is quite common web control in
any web pages.









Ä1Å  2 3 4 5 next +  Result 14 pages.

ÄLabelValueBeanÄ1, 1Å, LabelValueBeanÄ2, 2Å, LabelValueBeanÄ3, 3Å,
LabelValueBeanÄ4, 4Å, LabelValueBeanÄ5, 5Å, LabelValueBeanÄ6, 6Å,
LabelValueBeanÄ7, 7Å, LabelValueBeanÄ8, 8Å, LabelValueBeanÄ9, 9Å,
LabelValueBeanÄ10, 10Å, LabelValueBeanÄ11, 11Å, LabelValueBeanÄ12,
12Å, LabelValueBeanÄ13, 13Å, LabelValueBeanÄ14, 14ÅÅ
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   

__
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 

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

 



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


Re: Re: Using optionsCollection - LabelValueBean

2004-03-15 Thread ddd ddd
type Exception report
message 
description The server encountered an internal error () that prevented it from 
fulfilling this request.
exception 
org.apache.jasper.JasperException: Cannot create iterator for [EMAIL PROTECTED]
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
at 
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
at 
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1014)
at 
org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:961)
at 
org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:544)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:252)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline



On Sun, 14 Mar 2004 Timo Tjäder wrote :
>Hi,
>
>Thanks Hubert, the problem was on the html page.
>
>1. I forgot to add second form tag to handle page linking system on footer.
>2. Also as you mentioned all the parameters must be match with the form beans I am 
>posting.
>
>After making those changes the combox box was redered nicely on same lone
>with navigation numbers.
>
>1 2 3 4 5 next COMBOBOX v
>
>I have one rule when writing jsp pages and it is "no scriplets anymore".
>The Struts handles everything nicely if some time is offered in designing
>the beans and linking system.
>
>In this case mine is
>
>WEB->FORM->ACTION->SERVICE->BEAN
>WEB<-FORM<-ACTION<-SERVICE<-BEAN
>
>Service sets the values and they are read from the page using
>struts tags (equal/iterate/present). The totalNumOfPagesCollection
>comes actually from BEAN.
>
>Thanks,
>
>Timo
>
>
> >
> >The  needs to be provided with the property it's associated to,
> >the one on your form bean that will hold the actual value selected.
> >
> > >property="goTo" size="1">
> > >name="PageDetailView"
> >property="totalNumOfPagesCollection"
> >/>
> >
> >
> >"mySelectValue" should be a property on your form bean.
> >
> >hth,
> >
> >Hubert
> >
> >
> >
> >--- Timo_Tjäder <[EMAIL PROTECTED]> wrote:
> >> Hi,
> >>
> >> I have problems with optionsCollection, when used with 
> >> custom tag.
> >>
> >> 1. I set up in a bean LabelValueBean object in a Vector
> >> 2. pass it back to form and try to create a 
> >>
> >> This part should display a combo box with options, but
> >> it just does not work. It does not display anything.
> >>
> >> Html code is as follows:
> >>
> >> 
> >>  >> property="totalNumOfPagesCollection"/>
> >> 
> >>
> >> I have checked using struts "bean:write" t

Pl. help urgent Using optionsCollection - LabelValueBean

2004-03-15 Thread ddd ddd
etButton
>IDProblem=There is problem in id  has greater value than 4 pl. recheck it
>prompt.username= Please Enter the User Name by blah
>prompt.password=Please enter the password by bla
>errors.required={0} is required.
>errors.minlength={0} cannot be less than {1} characters.
>errors.maxlength={0} cannot be greater than {2} characters.
>errors.invalid={0} is invalid.
>errors.byte={0} must be an byte.
>errors.short={0} must be an short.
>errors.integer={0} must be an integer.
>errors.long={0} must be an long.
>errors.float={0} must be an float.
>errors.double={0} must be an double.
>errors.date={0} is not a date.
>errors.range={0} is not in the range {1} through {2}.
>errors.creditcard={0} is not a valid credit card number.
>errors.email={0} is an invalid e-mail address.
>rakeshErROR=This is first ssuccessfyl errro by blah
>errorRakesh=This is type of error in jsp page
>
>
>eError is
>
>HTTP Status 500 -
>
>type Exception report
>message
>description The server encountered an internal error () that prevented it from 
>fulfilling this request.
>exception
>org.apache.jasper.JasperException: Cannot create iterator for [EMAIL PROTECTED]
>   at 
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
>   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
>   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>   at 
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
>   at 
> org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
>   at 
> org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
>   at 
> org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1014)
>   at 
> org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:961)
>   at 
> org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:544)
>   at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:252)
>   at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
>   at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>   at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
>   at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
>   at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
>   at 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
>   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
>   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>   at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>   at 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
>   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
>   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>   at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
>   at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
>   at 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline
>
>
>On Sun, 14 Mar 2004 Timo Tjäder wrote :
> >Hi,
> >
> >I have problems with optionsCollection, when used with 
> >custom tag.
> >
> >1. I set up in a bean LabelValueBean object in a Vector
> >2. pass it back to form and try to create a 
> >
> >This part should display a combo box with options, but
> >it just does not work. It does not display anything.
> >
> >Html code is as follows:
> >
> >
> > >property="totalNumOfPagesCollection"/>
> >
> >
> >I have checked using struts "bean:write" the contents of
> >the object. Bean write claims that totalNumOfPages really
> >contains LabelValueBean-objects (14 peaces).
> >LabelValueBean[1, 1], LabelValueBean[2, 2], LabelValueBean[3, 3],
> >...
> >
> >So, does anyone know how to reference to this object correctly.
> >Current solution does not diaplay anything to the screen.
> >
> >Thanks,
> >
> >Timo
> >
> >So what I'd like to do is display a selection list of
> >all availabele pages from which user choose one and press
> >a goTo page button. This is quite common web control in
> >any web pages.
> >
> >
> >
> > >value="add-total-num-of-pages-collection">
> > >property="LabelValueBean"/>
> >
> >
> > >property="totalNumOfPagesCollection"/>
> >
> >
> >
> >
> >
> >[1]  2 3 4 5 next »  Result 14 pages.
> >
> >ÄLabelValueBeanÄ1, 1Å, LabelValueBeanÄ2, 2Å, LabelValueBeanÄ3, 3Å,
> >LabelValueBeanÄ4, 4Å, LabelValueBeanÄ5, 5Å, LabelValueBeanÄ6, 6Å,
> >LabelValueBeanÄ7, 7Å, LabelValueBeanÄ8, 8Å, LabelValueBeanÄ9, 9Å,
> >LabelValueBeanÄ10, 10Å, LabelValueBeanÄ11, 11Å, LabelValueBeanÄ12,
> >12Å, LabelValueBeanÄ13, 13Å, LabelValueBeanÄ14, 14ÅÅ
> >
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >


Re: Using optionsCollection - LabelValueBean

2004-03-14 Thread ddd ddd
ion The server encountered an internal error () that prevented it from 
fulfilling this request.
exception 
org.apache.jasper.JasperException: Cannot create iterator for [EMAIL PROTECTED]
at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
at 
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
at 
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
at 
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1014)
at 
org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:961)
at 
org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:544)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:252)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline


On Sun, 14 Mar 2004 Timo Tjäder wrote :
>Hi,
>
>I have problems with optionsCollection, when used with 
>custom tag.
>
>1. I set up in a bean LabelValueBean object in a Vector
>2. pass it back to form and try to create a 
>
>This part should display a combo box with options, but
>it just does not work. It does not display anything.
>
>Html code is as follows:
>
>
>property="totalNumOfPagesCollection"/>
>
>
>I have checked using struts "bean:write" the contents of
>the object. Bean write claims that totalNumOfPages really
>contains LabelValueBean-objects (14 peaces).
>LabelValueBean[1, 1], LabelValueBean[2, 2], LabelValueBean[3, 3],
>...
>
>So, does anyone know how to reference to this object correctly.
>Current solution does not diaplay anything to the screen.
>
>Thanks,
>
>Timo
>
>So what I'd like to do is display a selection list of
>all availabele pages from which user choose one and press
>a goTo page button. This is quite common web control in
>any web pages.
>
>
>
>value="add-total-num-of-pages-collection">
>property="LabelValueBean"/>
>
>
>property="totalNumOfPagesCollection"/>
>
>
>
>
>
>[1]  2 3 4 5 next »  Result 14 pages.
>
>ÄLabelValueBeanÄ1, 1Å, LabelValueBeanÄ2, 2Å, LabelValueBeanÄ3, 3Å,
>LabelValueBeanÄ4, 4Å, LabelValueBeanÄ5, 5Å, LabelValueBeanÄ6, 6Å,
>LabelValueBeanÄ7, 7Å, LabelValueBeanÄ8, 8Å, LabelValueBeanÄ9, 9Å,
>LabelValueBeanÄ10, 10Å, LabelValueBeanÄ11, 11Å, LabelValueBeanÄ12,
>12Å, LabelValueBeanÄ13, 13Å, LabelValueBeanÄ14, 14ÅÅ
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>


Re: Using optionsCollection - LabelValueBean

2004-03-14 Thread Timo Tjäder
Hi,

Thanks Hubert, the problem was on the html page.

1. I forgot to add second form tag to handle page linking system on footer.
2. Also as you mentioned all the parameters must be match with the form beans I am 
posting. 

After making those changes the combox box was redered nicely on same lone
with navigation numbers.

1 2 3 4 5 next COMBOBOX v

I have one rule when writing jsp pages and it is "no scriplets anymore".
The Struts handles everything nicely if some time is offered in designing 
the beans and linking system.

In this case mine is

WEB->FORM->ACTION->SERVICE->BEAN
WEB<-FORM<-ACTION<-SERVICE<-BEAN

Service sets the values and they are read from the page using
struts tags (equal/iterate/present). The totalNumOfPagesCollection 
comes actually from BEAN.

Thanks,

Timo


>
>The  needs to be provided with the property it's associated to,
>the one on your form bean that will hold the actual value selected.
>
>property="goTo" size="1">
>name="PageDetailView"
>property="totalNumOfPagesCollection"
>/>
>
>
>"mySelectValue" should be a property on your form bean.
>
>hth,
>
>Hubert
>
>
>
>--- Timo_Tjäder <[EMAIL PROTECTED]> wrote:
>> Hi,
>> 
>> I have problems with optionsCollection, when used with 
>> custom tag.
>> 
>> 1. I set up in a bean LabelValueBean object in a Vector
>> 2. pass it back to form and try to create a 
>> 
>> This part should display a combo box with options, but
>> it just does not work. It does not display anything.
>> 
>> Html code is as follows:
>> 
>> 
>> > property="totalNumOfPagesCollection"/>
>> 
>> 
>> I have checked using struts "bean:write" the contents of 
>> the object. Bean write claims that totalNumOfPages really 
>> contains LabelValueBean-objects (14 peaces).
>> LabelValueBeanÄ1, 1Å, LabelValueBeanÄ2, 2Å, LabelValueBeanÄ3, 3Å, 
>> ...
>> 
>> So, does anyone know how to reference to this object correctly.
>> Current solution does not diaplay anything to the screen.
>> 
>> Thanks,
>> 
>> Timo
>> 
>> So what I'd like to do is display a selection list of
>> all availabele pages from which user choose one and press
>> a goTo page button. This is quite common web control in
>> any web pages.
>> 
>> 
>> 
>> > value="add-total-num-of-pages-collection">
>> > property="LabelValueBean"/>  
>> 
>> 
>> > property="totalNumOfPagesCollection"/>
>> 
>>
>>  
>> 
>> 
>> Ä1Å  2 3 4 5 next +  Result 14 pages. 
>> 
>> ÄLabelValueBeanÄ1, 1Å, LabelValueBeanÄ2, 2Å, LabelValueBeanÄ3, 3Å, 
>> LabelValueBeanÄ4, 4Å, LabelValueBeanÄ5, 5Å, LabelValueBeanÄ6, 6Å, 
>> LabelValueBeanÄ7, 7Å, LabelValueBeanÄ8, 8Å, LabelValueBeanÄ9, 9Å, 
>> LabelValueBeanÄ10, 10Å, LabelValueBeanÄ11, 11Å, LabelValueBeanÄ12, 
>> 12Å, LabelValueBeanÄ13, 13Å, LabelValueBeanÄ14, 14ÅÅ
>> 
>> 
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> 
>
>
>__
>Do you Yahoo!?
>Yahoo! Mail - More reliable, more storage, less spam
>http://mail.yahoo.com
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]


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



Re: Using optionsCollection - LabelValueBean

2004-03-14 Thread Hubert Rabago

The  needs to be provided with the property it's associated to,
the one on your form bean that will hold the actual value selected.





"mySelectValue" should be a property on your form bean.

hth,

Hubert



--- Timo_Tjäder <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I have problems with optionsCollection, when used with 
> custom tag.
> 
> 1. I set up in a bean LabelValueBean object in a Vector
> 2. pass it back to form and try to create a 
> 
> This part should display a combo box with options, but
> it just does not work. It does not display anything.
> 
> Html code is as follows:
> 
> 
>  property="totalNumOfPagesCollection"/>
> 
> 
> I have checked using struts "bean:write" the contents of 
> the object. Bean write claims that totalNumOfPages really 
> contains LabelValueBean-objects (14 peaces).
> LabelValueBean[1, 1], LabelValueBean[2, 2], LabelValueBean[3, 3], 
> ...
> 
> So, does anyone know how to reference to this object correctly.
> Current solution does not diaplay anything to the screen.
> 
> Thanks,
> 
> Timo
> 
> So what I'd like to do is display a selection list of
> all availabele pages from which user choose one and press
> a goTo page button. This is quite common web control in
> any web pages.
> 
> 
> 
>  value="add-total-num-of-pages-collection">
>  property="LabelValueBean"/>  
> 
> 
>  property="totalNumOfPagesCollection"/>
> 
> 
>   
> 
> 
> [1]  2 3 4 5 next »  Result 14 pages. 
> 
> ÄLabelValueBeanÄ1, 1Å, LabelValueBeanÄ2, 2Å, LabelValueBeanÄ3, 3Å, 
> LabelValueBeanÄ4, 4Å, LabelValueBeanÄ5, 5Å, LabelValueBeanÄ6, 6Å, 
> LabelValueBeanÄ7, 7Å, LabelValueBeanÄ8, 8Å, LabelValueBeanÄ9, 9Å, 
> LabelValueBeanÄ10, 10Å, LabelValueBeanÄ11, 11Å, LabelValueBeanÄ12, 
> 12Å, LabelValueBeanÄ13, 13Å, LabelValueBeanÄ14, 14ÅÅ
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com

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



Using optionsCollection - LabelValueBean

2004-03-14 Thread Timo Tjäder
Hi,

I have problems with optionsCollection, when used with 
custom tag.

1. I set up in a bean LabelValueBean object in a Vector
2. pass it back to form and try to create a 

This part should display a combo box with options, but
it just does not work. It does not display anything.

Html code is as follows:





I have checked using struts "bean:write" the contents of 
the object. Bean write claims that totalNumOfPages really 
contains LabelValueBean-objects (14 peaces).
LabelValueBean[1, 1], LabelValueBean[2, 2], LabelValueBean[3, 3], 
...

So, does anyone know how to reference to this object correctly.
Current solution does not diaplay anything to the screen.

Thanks,

Timo

So what I'd like to do is display a selection list of
all availabele pages from which user choose one and press
a goTo page button. This is quite common web control in
any web pages.




  




  



[1]  2 3 4 5 next »  Result 14 pages. 

ÄLabelValueBeanÄ1, 1Å, LabelValueBeanÄ2, 2Å, LabelValueBeanÄ3, 3Å, 
LabelValueBeanÄ4, 4Å, LabelValueBeanÄ5, 5Å, LabelValueBeanÄ6, 6Å, 
LabelValueBeanÄ7, 7Å, LabelValueBeanÄ8, 8Å, LabelValueBeanÄ9, 9Å, 
LabelValueBeanÄ10, 10Å, LabelValueBeanÄ11, 11Å, LabelValueBeanÄ12, 
12Å, LabelValueBeanÄ13, 13Å, LabelValueBeanÄ14, 14ÅÅ


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



RE: How to set the selected value in an select rendered by optionsCollection

2004-03-11 Thread Wendy Smoak
> From: Frank Schaare [mailto:[EMAIL PROTECTED] 

> > This would only be true if the action that was called 
> specified that form in its mapping.

> Sorry, but i guess you are wrong.
> The declared formBeans are digested during ActionServlets.init().

Actually, he's right. :)  My advice only applies if you have
name="myForm" in your  tag.  If not, Struts will pass a null
form into the execute method.  It may have digested struts-config.xml,
but without the name attribute in the form tag, it will not have
actually instantiated one for you.

I don't use any pre-processing Actions.  Mine are all
LookupDispatchAction, so the form is always there, although if it comes
in with no parameter, the unspecified method will pre-fill the form from
the database.

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

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



Re: rePost: How to set the selected value in an select rendered by optionsCollection

2004-03-11 Thread Niall Pemberton
Its the name/property specified on the  tag that causes
OptionsCollection to set "selected" - in your case the select tag needs to
look at he country property of the customer bean - if optionsCollection
finds a value that matches that, it will set selected.

 

 

Niall

- Original Message - 
From: "Frank Schaare" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, March 11, 2004 11:49 AM
Subject: rePost: How to set the selected value in an select rendered by
optionsCollection


> Hi all,
>
> i´m reposting my problem trying to be a little bit more specific. This
> problem is very important for me, though i made another 'book like'
> example to show where i am.
>
> There are three beans playing in my theatre:
> 1. the CommonValuesBean which stores frequently asked data for my JSP
> HTMLForms
> 2. the CustomerBean which is an buisiness objekt representing a customer
> 3. the DynaForm which stores data coming from my JSP HTMLForms.
>
> First of all, the CommonValuesBean is initialised. Therefore, i´ve got
> the sessionListener that puts data in it, anytime a new session is creatd:
>
>  public void sessionCreated(HttpSessionEvent event) {
> CommonValuesBean commonValuesBean = new CommonValuesBean(); // create
> new bean instance
> HashMap countries = new HashMap(); // Create new map
> countries.put("countryCode1","country1")
> countries.put("countryCode2","country2")
> countries.put("countryCode3","country3")
>
> countries.setCountries(countries); // Our example map is now stored
>
> HttpSession session = event.getSession();
> session.setAttribute("commonValuesBean",CommonValuesBean);
>  }
>
> Now we begin to deal with the customers. There is listCustomers Action
> that shows all of the customers. You can klick one to
> get more detailed information using the customersDetailsAction:
>
> public class customersDetailsAction extends Action
> {
> private Customer customer = new Customer();
>
> public ActionForward execute(ActionMapping mapping,ActionForm
> form,HttpServletRequest req,HttpServletResponse res)
> throws IOException, ServletException
> {
> customer.setFirstName("Frank");
> customer.setLastName("Schaare");
> customer.setCountry("country2");
>
> req.setAttribute("customer",customer); // storing customer in request
>
> return mapping.findForward("customerShowDetails"); // mapped to
> customerShowDetails.jsp
> }
> }
>
> The customerShowDetails.jsp looks like this:
>
> 
> .
> . tons of markup
> .
> 
>  property="countries" label="value" value="key"/>
> 
> .
> . again: tons of markup
> .
>
> 
>
> The problem is, that the  renders a select like
> this:
>
> 
> country1
> country2
> country3
> 
>
> i desperately NEED to render the select like this:
>
> 
> country1
> country2
> country3
> 
>
> because my customer lives in country2 !
>
> Is there any way to tell Struts to do this ?
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>



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



rePost: How to set the selected value in an select rendered by optionsCollection

2004-03-11 Thread Frank Schaare
Hi all,

i´m reposting my problem trying to be a little bit more specific. This 
problem is very important for me, though i made another 'book like' 
example to show where i am.

There are three beans playing in my theatre:
1. the CommonValuesBean which stores frequently asked data for my JSP 
HTMLForms
2. the CustomerBean which is an buisiness objekt representing a customer
3. the DynaForm which stores data coming from my JSP HTMLForms.

First of all, the CommonValuesBean is initialised. Therefore, i´ve got 
the sessionListener that puts data in it, anytime a new session is creatd:

public void sessionCreated(HttpSessionEvent event) {
	CommonValuesBean commonValuesBean = new CommonValuesBean(); // create 
new bean instance
	HashMap countries = new HashMap(); // Create new map
	countries.put("countryCode1","country1")
	countries.put("countryCode2","country2")
	countries.put("countryCode3","country3")
	
	countries.setCountries(countries); // Our example map is now stored
	
	HttpSession session = event.getSession();
	session.setAttribute("commonValuesBean",CommonValuesBean);
}

Now we begin to deal with the customers. There is listCustomers Action 
that shows all of the customers. You can klick one to
get more detailed information using the customersDetailsAction:

public class customersDetailsAction extends Action
{
private Customer customer = new Customer();
	public ActionForward execute(ActionMapping mapping,ActionForm 
form,HttpServletRequest req,HttpServletResponse res)
		throws IOException, ServletException
	{
	customer.setFirstName("Frank");
	customer.setLastName("Schaare");
	customer.setCountry("country2");

	req.setAttribute("customer",customer); // storing customer in request
	
	return mapping.findForward("customerShowDetails"); // mapped to 
customerShowDetails.jsp
	}
}

The customerShowDetails.jsp looks like this:


.
. tons of markup
.

	

.
. again: tons of markup
.



The problem is, that the  renders a select like 
this:


country1
country2
country3

i desperately NEED to render the select like this:


country1
country2   
country3

because my customer lives in country2 !

Is there any way to tell Struts to do this ?

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


Re: How to set the selected value in an select rendered by optionsCollection

2004-03-11 Thread Frank Schaare
Hi Hubert,

This would only be true if the action that was called specified that form in
its mapping.  If this is a preprocessing action (that's being called to
provide an HTML form with data to show), and there's no "name" attribute to
tie a form to it, Struts will not create/populate a form (because it wouldn't
know what form to create).  
Sorry, but i guess you are wrong.

The declared formBeans are digested during ActionServlets.init().

If you have a tool that is able to visualize your Java Objects like the 
'variables' view in Eclipse, you will see the following right after 
applications startup, when setting a breakpoint in any action:

mapping/moduleConfig/formBeans which is a HashMap. All your declared 
beans are right there.

Does anyone know the right way to access this HashMap ?

Anyway, we became very far away from my optionsCollection problem. I´ll 
try to repost it trying to be a little more specific.

CU

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


RE: How to set the selected value in an select rendered by optionsCollection

2004-03-10 Thread Hubert Rabago

--- Wendy Smoak <[EMAIL PROTECTED]> wrote:
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> > because of the fact, that i´ve got no access to this bean in my 
> > preprocessing action. testSelect is a member of the upcoming 
> > DynaActionValidatorForm with is initiatet during the 
> >  tag of my JSP.
> 
> Nope.  It goes request->form creation->action.  You are being passed the
> form in the signature of ActionForm.execute(), all you have to do is cast
> it to the right type:
> 
>   DynaActionForm dForm = (DynaActionForm) form;

This would only be true if the action that was called specified that form in
its mapping.  If this is a preprocessing action (that's being called to
provide an HTML form with data to show), and there's no "name" attribute to
tie a form to it, Struts will not create/populate a form (because it wouldn't
know what form to create).  

You can make the form available to this action if you specify the form you
want in the "name" attribute in this action's mapping.  However, this would
not be good practice since the preprocessing action could itself require a
form of a different type. 

> 
> Now set whatever properties of dForm you need to, then forward to the JSP.
> 
> > You are right the sbBean and the DynaActionValidatorForm have exactly 
> > the same members which seems to be a big design failure in my 
> > application. I should get rid of the sbBean and initiate the 
> > DynaActionValidatorForm earlier in my preprocessing action.
> 
> Not recommended.  They might be the same *now* but if your business object
> changes in the future, you don't want that to be tied so closely to your
> webapp.  Since you're using dyanamic forms, it's not THAT much trouble to
> maintain a business object plus some lines of XML.  Or you can use a tool
> to generate all the get/set methods for a regular ActionForm.
> 
> -- 
> Wendy Smoak
> Application Systems Analyst, Sr.
> ASU IA Information Resources Management 


__
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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



RE: How to set the selected value in an select rendered by optionsCollection

2004-03-10 Thread Wendy Smoak
> From: Frank Schaare [mailto:[EMAIL PROTECTED] 

> this is where i am: there is my business object 'sb' and the upcoming 
> DynaActionForm. sb extends ActionForm, there should be sb.execute().

No.  The execute method is in the Action, not the ActionForm.

> Shall i cast my business object 'sb' ? That would look like this:
> DynaActionForm dSB = (DynaActionForm) sb

You just said 'sb' is an ActionForm, so it cannot (well, should not,)
also be a business object.

We need to know about your Action class.  That's the one with the
execute method, which has a signature like this:

public ActionForward execute( ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response )

Inside that method is where you cast 'form' to whatever type of form you
have.  Then you'll have access to the 'set' methods of your particular
type of form bean.

If I'm still not understanding properly, please try again to explain
what you need.

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

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



Re: How to set the selected value in an select rendered by optionsCollection

2004-03-10 Thread Frank Schaare
Hi Wendy,
thx for your reply, but there are some questions left:
this is where i am: there is my business object 'sb' and the upcoming 
DynaActionForm. sb extends ActionForm, there should be sb.execute().

Nope.  It goes request->form creation->action.  You are being passed the form in the signature of ActionForm.execute(), all you have to do is cast it to the right type:

  DynaActionForm dForm = (DynaActionForm) form;
Shall i cast my business object 'sb' ? That would look like this:
DynaActionForm dSB = (DynaActionForm) sb
Or shall i look for the DynaActionForm in sb.execute() which will look 
like this:
sb.execute()
{
//there must be a way to access Struts DynaForms
.
DynaActionForm dSB = (DynaActionForm) form
}
How do i get the form Objekt ?

I debugged deep into Struts sources, found a 'mapping' Object with a 
'formBeans' Vector but no way to access this mapping.
Do you have a suggestion ?



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


RE: How to set the selected value in an select rendered by optionsCollection

2004-03-10 Thread Wendy Smoak
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> > in your preprocessing action class to set the value of 
> "testSelect", which will automatically add the SELECTED 
> attribute on the option tag?
> because of the fact, that i´ve got no access to this bean in my 
> preprocessing action. testSelect is a member of the upcoming 
> DynaActionValidatorForm with is initiatet during the 
>  tag of my JSP.

Nope.  It goes request->form creation->action.  You are being passed the form in the 
signature of ActionForm.execute(), all you have to do is cast it to the right type:

  DynaActionForm dForm = (DynaActionForm) form;

Now set whatever properties of dForm you need to, then forward to the JSP.

> You are right the sbBean and the DynaActionValidatorForm have exactly 
> the same members which seems to be a big design failure in my 
> application. I should get rid of the sbBean and initiate the 
> DynaActionValidatorForm earlier in my preprocessing action.

Not recommended.  They might be the same *now* but if your business object changes in 
the future, you don't want that to be tied so closely to your webapp.  Since you're 
using dyanamic forms, it's not THAT much trouble to maintain a business object plus 
some lines of XML.  Or you can use a tool to generate all the get/set methods for a 
regular ActionForm.

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

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



Re: How to set the selected value in an select rendered by optionsCollection

2004-03-10 Thread [EMAIL PROTECTED]
Hi Nagiel,

if (sb.getTitle().equals("Mr."))
formularBean.setTestSelect(sb.getTitle())
in your preprocessing action class to set the value of "testSelect", which will automatically add the SELECTED attribute on the option tag?
because of the fact, that i´ve got no access to this bean in my 
preprocessing action. testSelect is a member of the upcoming 
DynaActionValidatorForm with is initiatet during the  tag of 
my JSP.

You are right the sbBean and the DynaActionValidatorForm have exactly 
the same members which seems to be a big design failure in my 
application. I should get rid of the sbBean and initiate the 
DynaActionValidatorForm earlier in my preprocessing action.

But how ??? Does anyone have an example how to retrieve a 
DynaActionValidatorForm from the mapping ?

And, if i use the DynaActionValidatorForm earlier in my preprocessing 
action, store it in requestScope, does the  Tag take notice 
of it, or simply 'overrides' it ?

It is my first Struts app and this is quit complex for me, hope Nagiel 
or someone else will help.

Thank you.

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


RE: How to set the selected value in an select rendered by optionsCollection

2004-03-10 Thread Shahak.Nagiel
I'm not sure if I fully understand, but why not use:

if (sb.getTitle().equals("Mr."))
formularBean.setTestSelect(sb.getTitle())

in your preprocessing action class to set the value of "testSelect", which will 
automatically add the SELECTED attribute on the option tag?

Regards,
Shahak Nagiel

-Original Message-
From: Frank Schaare [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 10, 2004 4:31 AM
To: [EMAIL PROTECTED]
Subject: How to set the selected value in an select rendered by
optionsCollection


 I´ve got this select rendered with data from my applicationwide
formularBean:
 

  

 
 This renders a select like this:

Mrs.
Mr.
Dr.
.
.

 
 The formular fields in my JSP should be prefilled with data from my person
bean ("sb")
 which has a Title property, so sb.getTitle() returns 'Mr.' in this example.
 
 Is there any chance to tell the html:select renderer "hey, if sb.getTitle()
is = 'Mr.' write
  
Mrs.
Mr.
Dr.
.
.
 " ???
 
 I tried this workaround:

  
  


but it rendered:

Mr.
Mrs.
Mr.
Dr.


even if Validator returns to this page because of errors.

Do you have any solutions/suggestions/articels for me to solve this problem
?

-- 
+++ NEU bei GMX und erstmalig in Deutschland: TÜV-geprüfter Virenschutz +++
100% Virenerkennung nach Wildlist. Infos: http://www.gmx.net/virenschutz


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

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



How to set the selected value in an select rendered by optionsCollection

2004-03-10 Thread Frank Schaare
 I´ve got this select rendered with data from my applicationwide
formularBean:
 

  

 
 This renders a select like this:

Mrs.
Mr.
Dr.
.
.

 
 The formular fields in my JSP should be prefilled with data from my person
bean ("sb")
 which has a Title property, so sb.getTitle() returns 'Mr.' in this example.
 
 Is there any chance to tell the html:select renderer "hey, if sb.getTitle()
is = 'Mr.' write
  
Mrs.
Mr.
Dr.
.
.
 " ???
 
 I tried this workaround:

  
  


but it rendered:

Mr.
Mrs.
Mr.
Dr.


even if Validator returns to this page because of errors.

Do you have any solutions/suggestions/articels for me to solve this problem
?

-- 
+++ NEU bei GMX und erstmalig in Deutschland: TÜV-geprüfter Virenschutz +++
100% Virenerkennung nach Wildlist. Infos: http://www.gmx.net/virenschutz


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



Re: optionsCollection struts 1.1

2004-03-05 Thread bojke
as as wrote:

Good explanation.Then any way to set a default value show up in the list...onthe jsp page...

Thanks

yoge <[EMAIL PROTECTED]> wrote:



For the above to work, your FormBean should have a property *conditions* 
with type as Collection.
The coditions should be collection of properties and each should have 
two property Label and Value for display and value for the tag.

In short , conditions property should contain collection of JavaBean 
given below

public class Option
{
String label ="";
String value = "";
public String getLabel()
{
return label;
}
public String getValue()
{
return value;
}
public void setLabel(String temp)
{
this.label=temp;
}
public void setValue(String temp)
{
this.value=temp;
}
}
Hope this helps

--Yoge

bojke wrote:

 

Hi,

I don't see optionsCollection in struts1.1
Is there optionsCollection in struts1.1?
I have ArrayList as property of FormBean. ArrayList is collection of 
beans. Beans of course has a propreties.
Does anybody know how to dislpay e.g bean property beanName using 
html:options
in drop-down list.

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





-
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
 

Yes, it helps.
Thans guys,
Bojan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: optionsCollection struts 1.1

2004-03-04 Thread as as
Good explanation.Then any way to set a default value show up in the list...onthe jsp 
page...
 
Thanks

yoge <[EMAIL PROTECTED]> wrote:




For the above to work, your FormBean should have a property *conditions* 
with type as Collection.
The coditions should be collection of properties and each should have 
two property Label and Value for display and value for the tag.

In short , conditions property should contain collection of JavaBean 
given below

public class Option
{
String label ="";
String value = "";

public String getLabel()
{
return label;
}
public String getValue()
{
return value;
}
public void setLabel(String temp)
{
this.label=temp;
}
public void setValue(String temp)
{
this.value=temp;
}
}


Hope this helps

--Yoge


bojke wrote:

> Hi,
>
> I don't see optionsCollection in struts1.1
> Is there optionsCollection in struts1.1?
>
> I have ArrayList as property of FormBean. ArrayList is collection of 
> beans. Beans of course has a propreties.
> Does anybody know how to dislpay e.g bean property beanName using 
> html:options
> in drop-down list.
>
> Thanks,
> Bojan
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>




-
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!

Re: optionsCollection struts 1.1

2004-03-04 Thread as as
Good explanation.Then any way to set a default value show up in the list...onthe jsp 
page...
 
Thanks

yoge <[EMAIL PROTECTED]> wrote:




For the above to work, your FormBean should have a property *conditions* 
with type as Collection.
The coditions should be collection of properties and each should have 
two property Label and Value for display and value for the tag.

In short , conditions property should contain collection of JavaBean 
given below

public class Option
{
String label ="";
String value = "";

public String getLabel()
{
return label;
}
public String getValue()
{
return value;
}
public void setLabel(String temp)
{
this.label=temp;
}
public void setValue(String temp)
{
this.value=temp;
}
}


Hope this helps

--Yoge


bojke wrote:

> Hi,
>
> I don't see optionsCollection in struts1.1
> Is there optionsCollection in struts1.1?
>
> I have ArrayList as property of FormBean. ArrayList is collection of 
> beans. Beans of course has a propreties.
> Does anybody know how to dislpay e.g bean property beanName using 
> html:options
> in drop-down list.
>
> Thanks,
> Bojan
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>



-
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster.

Re: optionsCollection struts 1.1

2004-03-04 Thread yoge
   
   
   
For the above to work, your FormBean should have a property *conditions* 
with type as Collection.
The coditions should be collection of properties and each should have 
two property Label and Value for display and value for the  tag.

In short , conditions property should contain collection of JavaBean 
given below

public class Option
{
   String label ="";
   String value = "";
 
   public String getLabel()
   {
   return label;
   }
   public String getValue()
   {
   return value;
   }
   public void setLabel(String temp)
   {
   this.label=temp;
   }
   public void setValue(String temp)
   {
   this.value=temp;
   }
}

Hope this helps

--Yoge

bojke wrote:

Hi,

I don't  see optionsCollection in struts1.1
Is there optionsCollection in struts1.1?
I have ArrayList as property of FormBean. ArrayList is collection of 
beans. Beans of course has a propreties.
Does anybody know how to dislpay e.g bean property beanName using 
html:options
in drop-down list.

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



optionsCollection struts 1.1

2004-03-04 Thread bojke
Hi,

I don't  see optionsCollection in struts1.1
Is there optionsCollection in struts1.1?
I have ArrayList as property of FormBean. ArrayList is collection of 
beans. Beans of course has a propreties.
Does anybody know how to dislpay e.g bean property beanName using 
html:options
in drop-down list.

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


RE: optionsCollection ...

2004-02-25 Thread Slattery, Tim - BLS
> Someone have one example of html:optionsCollection  with html:select.


   
 

The FormBean contains a domestic_Foreign property (a string), and a
domesticForeignList property. That returns a collection of beans, each of
which has "code" and "value" properties.

--
Tim Slattery
[EMAIL PROTECTED]


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



optionsCollection ...

2004-02-25 Thread Daniel
Someone have one example of html:optionsCollection  with html:select.


obrigado

Daniel S.




RE: optionsCollection with another default value

2003-11-24 Thread Daniel Lipofsky

Use one  tag followed by the
 tag.
- Dan

> -Original Message-
> From: Frank Schaare [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 24, 2003 3:15 AM
> 
> Hallo,
> 
> i´ve made a select from an optionsCollection Tag. The values are read 
> from a hashmap like
> value1 = one
> value2 = two
> value3 = three
> 
> Now i´d like to set a default value for this select, which is 
> NOT PART 
> of my HashMap, f.e "please select..." The rendered select should look 
> like this:
> please select...
> one
> two
> three
> 
> is there any way to achieve this result in struts ?

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



optionsCollection with another default value

2003-11-24 Thread Frank Schaare
Hallo,

i´ve made a select from an optionsCollection Tag. The values are read 
from a hashmap like
value1 = one
value2 = two
value3 = three

Now i´d like to set a default value for this select, which is NOT PART 
of my HashMap, f.e "please select..." The rendered select should look 
like this:
please select...
one
two
three

is there any way to achieve this result in struts ?

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


mapped properties, checkboxes, and optionsCollection

2003-11-09 Thread John Hayes
I have two problems that I think are related, so I'm including them both
in this email.  I'm using Struts 1.1.

Problem #1:

I am trying to use a mapped property on an html:checkbox, and it does
not appear to be setting the value of the property to true if the
checkbox is checked and submitted.  This is the line in my JSP:



In the reset method I set all Boolean objects in the map to
Boolean.FALSE as indicated in the html taglib documentation.  It works
fine if I use a "scalar" field with a boolean primitive like the
following:

protected boolean booleanValue = false;
public void setBooleanValue(boolean value)...
public boolean getBooleanValue()...

and



I'm wondering if there is a problem where the mapped property is not
being set properly (since checkbox is probably trying to set a boolean
value instead of Boolean).  Has anyone else encountered this before?

Problem #2

I am trying to use another mapped property in the same ActionForm
implementation on an html:optionsCollection.  

  
  
  

I initialize the dbList's value in the Map and the optionsCollection
loads properly in the browser.  However, on submission I only get the
first value if multiple values of the list are submitted in the Map for
the selectedDb key.  I suspect there might be a problem setting the
String array in the Map for some reason.

I also tried this with a "scalar" field and it worked just fine:

protected String[] selectedDbList = null;

public String[] getSelectedDbList() {
return (this.dbList);
}
public void setSelectedDbList(String[] selectedDbList) {
this.selectedDbList = selectedDbList;
}

and 





I get the impression that both these problems are bugs, and if so, I'd
be interested in looking into how to fix them.  So, if anyone has a idea
where I should look first it would be very helpful.  Or, if they're not
bugs, I'd really appreciate any help you can offer.  

-- 
John Hayes <[EMAIL PROTECTED]>


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



Re: Problems using the optionsCollection tag

2003-09-21 Thread James JKE95 Kerridge
PLEASE IGNORE THIS PROBLEM. NOW RESOLVED.


The optionsCollection tag does work properly. I was using it properly. 
Just had a build issue that caused the strange behaviour.

Thanks and sorry

James



From:   "James JKE95 Kerridge" <[EMAIL PROTECTED]> on 22/09/2003 
14:38
Please respond to "Struts Users Mailing List" 
<[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
cc: 
Subject:Problems using the optionsCollection tag

All,

I am having a problem using the optionsCollection tag.

I get this error:

javax.servlet.jsp.JspException: No getter method for property 
reasonsForTicketIssueOptions of bean org.apache.struts.taglib.html.BEAN
at 
org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:968)
at 
org.apache.struts.taglib.html.OptionsCollectionTag.doStartTag(OptionsCollectionTag.java:219)
at 
org.apache.strutsel.taglib.html.ELOptionsCollectionTag.doStartTag(ELOptionsCollectionTag.java:220)
at 
jsp_servlet._jsp._qf._ticketissuerequest.__ticketissuerequestformstep1._jspService(__ticketissuerequestformstep1.java:1140)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at 
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
at 
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
at 
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2546)
at 
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2260)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)


My JSP has this in it:

...


 

...


My form extends ValidatorForm and has these code fragments in it:

...

/**
 * holds the multiple selections of 'reason for ticket issue' from the 

form.
 */
private String[] reasonsForTicketIssue;

/** 
 * Getter for property reasonsForTicketIssue.
 * @return Value of property reasonsForTicketIssue.
 */
public String[] getReasonsForTicketIssue() {
return this.reasonsForTicketIssue;
}
 
/** Setter for property reasonsForTicketIssue.
 * @param reasonsForTicketIssue New value of property 
reasonsForTicketIssue.
 *
 */
public void setReasonsForTicketIssue(String[] reasonsForTicketIssue) {
this.reasonsForTicketIssue = reasonsForTicketIssue;
}

/**
 * gets the collection of values to support the 'reasons for ticket 
issue' property.
 */
public List getReasonsForTicketIssueOptions() {
return 
ReasonForTicketRequestOptionsProvider.getOptionsCollection();
}

...


Having traced through the code I find that the correct bean is looked up 
successfully (i.e. the form bean) but that there is no property for the 
'reasonsForTicketIssueOptions' property in the property descriptors that 
are used by PropertyUtils.

Am I correctly using the optionsCollection tag?

Is my 'public List getReasonsForTicketIssueOptions()' method correct?

Does any one have an example of using this tag where the form bean returns 

the collection of LabelValueBeans?

Surely what I am doing is standard hence the existence of the 
optionsCollection tag.

Thanks for any help.

James


***Confidentiality and Privilege Notice***

This email is intended only to be read or used by the addressee. 
It is confidential and may contain legally privileged information. 
If you are not the addressee indicated in this message (or 
responsible for delivery of the message to such person), you 
may not copy or deliver this message to anyone, and you should 
destroy this message and kindly notify the sender by reply email. 
Confidentiality and legal privilege are not waived or lost by
reason of mistaken delivery to you.

Qantas Airways Limited
ABN 16 009 661 901

Visit Qantas online at http://www.qantas.com.au






***Confidentiality and Privilege Notice***

This email is intended only to be read or used by the addressee. 
It is confidential and may contain legally privileged information. 
If you are not the addressee indicated in this message (or 
responsible for delivery of the message to such person), you 
may not copy or deliver this message to anyone, and you should 
destroy this message and kindly notify the sender by reply email. 
Confidentiality and legal privilege are not waived or lost by
reason of mistaken delivery to you.

Qantas Airways Limited
ABN 16 009 661 901

Visit Qantas online at http://www.qantas.com.au



Problems using the optionsCollection tag

2003-09-21 Thread James JKE95 Kerridge
All,

I am having a problem using the optionsCollection tag.

I get this error:

javax.servlet.jsp.JspException: No getter method for property 
reasonsForTicketIssueOptions of bean org.apache.struts.taglib.html.BEAN
at 
org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:968)
at 
org.apache.struts.taglib.html.OptionsCollectionTag.doStartTag(OptionsCollectionTag.java:219)
at 
org.apache.strutsel.taglib.html.ELOptionsCollectionTag.doStartTag(ELOptionsCollectionTag.java:220)
at 
jsp_servlet._jsp._qf._ticketissuerequest.__ticketissuerequestformstep1._jspService(__ticketissuerequestformstep1.java:1140)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at 
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
at 
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
at 
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2546)
at 
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2260)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)


My JSP has this in it:

...


 

...


My form extends ValidatorForm and has these code fragments in it:

...

/**
 * holds the multiple selections of 'reason for ticket issue' from the 
form.
 */
private String[] reasonsForTicketIssue;

/** 
 * Getter for property reasonsForTicketIssue.
 * @return Value of property reasonsForTicketIssue.
 */
public String[] getReasonsForTicketIssue() {
return this.reasonsForTicketIssue;
}
 
/** Setter for property reasonsForTicketIssue.
 * @param reasonsForTicketIssue New value of property 
reasonsForTicketIssue.
 *
 */
public void setReasonsForTicketIssue(String[] reasonsForTicketIssue) {
this.reasonsForTicketIssue = reasonsForTicketIssue;
}

/**
 * gets the collection of values to support the 'reasons for ticket 
issue' property.
 */
public List getReasonsForTicketIssueOptions() {
return 
ReasonForTicketRequestOptionsProvider.getOptionsCollection();
}

...


Having traced through the code I find that the correct bean is looked up 
successfully (i.e. the form bean) but that there is no property for the 
'reasonsForTicketIssueOptions' property in the property descriptors that 
are used by PropertyUtils.

Am I correctly using the optionsCollection tag?

Is my 'public List getReasonsForTicketIssueOptions()' method correct?

Does any one have an example of using this tag where the form bean returns 
the collection of LabelValueBeans?

Surely what I am doing is standard hence the existence of the 
optionsCollection tag.

Thanks for any help.

James


***Confidentiality and Privilege Notice***

This email is intended only to be read or used by the addressee. 
It is confidential and may contain legally privileged information. 
If you are not the addressee indicated in this message (or 
responsible for delivery of the message to such person), you 
may not copy or deliver this message to anyone, and you should 
destroy this message and kindly notify the sender by reply email. 
Confidentiality and legal privilege are not waived or lost by
reason of mistaken delivery to you.

Qantas Airways Limited
ABN 16 009 661 901

Visit Qantas online at http://www.qantas.com.au



resource bunlde and optionsCollection?

2003-06-24 Thread rab yazbeck
Hi there. 

Is there any way to use resource bunlde from within
  or ? i only
know that the resource bundle can only be used with
..

And by the way, is there any equivalent for struts
html tags in the JSTL?

Thanks.. Rab.

__
Yahoo! Plus
For a better Internet experience
http://www.yahoo.co.uk/btoffer

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



optionsCollection

2003-06-23 Thread Filip Polsakiewicz
Hi,

i have a collection of String values in my Form and want a selectbox with
options out of this collection beeing displayed on my jsp. How can i do
this. i tried  but
it says that there is no getter method for property alang in bean DE where
DE ist the first String in my Collection. I'd appreciate any hints.

Thanks

Filip Polsakiewicz


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



Re: Wanted best practice for i18n'd optionsCollection

2003-03-12 Thread Mark
Read my recent like 5 mins ago post responding to someones question about state and 
country taglib.  it is my answer to exactly what you're talking about.

regards,
mark

*** REPLY SEPARATOR  ***

On 03/13/2003 at 1:47 PM Christopher Cheng wrote:

>If we populate the items in the drop down menu collection, then I actually
>have to do the same thing again and again for every collection instead of
>leaving it to the framework to do so. The programmer has to figure out what
>specific collection he would need in the jsp and populate them in "Action"
>
>- Original Message -
>From: "Rick Reumann" <[EMAIL PROTECTED]>
>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>Sent: Friday, March 07, 2003 2:57 AM
>Subject: Re: Wanted best practice for i18n'd optionsCollection
>
>
>> On Fri, 7 Mar 2003 02:44:12 +0800
>> "Christopher Cheng" <[EMAIL PROTECTED]> wrote:
>>
>> > > On Monday, Mar 3, 2003, at 21:16 Canada/Eastern, Christopher Cheng
>> > > wrote:
>> > >
>> > > > I posted a similar question long time ago in this list. -> Nobody
>> > > > cares.
>> > > >
>> > > > So I developed my own custom tag to do it. What I did is
>> > > > populating the collection with locale keys in the label of the
>> > > > LabelValueBean and then get
>> > > > the exact message from the property file. If you want it, I can
>> > > > send you a
>> > > > copy of it.
>>
>> I haven't had a need to solve any i18n issues, but since you can get an
>> access to the user's locale in your Action form, wouldn't it be simpler
>> to just pass this locale into your business tier so you could populate a
>> collection the correct i18n data? The JSPs and tags wouldn't know the
>> difference or even care whether the collection was in English, German,
>> etc.
>>
>>
>> --
>> Rick Reumann
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




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



Re: Wanted best practice for i18n'd optionsCollection

2003-03-12 Thread Christopher Cheng
If we populate the items in the drop down menu collection, then I actually
have to do the same thing again and again for every collection instead of
leaving it to the framework to do so. The programmer has to figure out what
specific collection he would need in the jsp and populate them in "Action"

- Original Message -
From: "Rick Reumann" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, March 07, 2003 2:57 AM
Subject: Re: Wanted best practice for i18n'd optionsCollection


> On Fri, 7 Mar 2003 02:44:12 +0800
> "Christopher Cheng" <[EMAIL PROTECTED]> wrote:
>
> > > On Monday, Mar 3, 2003, at 21:16 Canada/Eastern, Christopher Cheng
> > > wrote:
> > >
> > > > I posted a similar question long time ago in this list. -> Nobody
> > > > cares.
> > > >
> > > > So I developed my own custom tag to do it. What I did is
> > > > populating the collection with locale keys in the label of the
> > > > LabelValueBean and then get
> > > > the exact message from the property file. If you want it, I can
> > > > send you a
> > > > copy of it.
>
> I haven't had a need to solve any i18n issues, but since you can get an
> access to the user's locale in your Action form, wouldn't it be simpler
> to just pass this locale into your business tier so you could populate a
> collection the correct i18n data? The JSPs and tags wouldn't know the
> difference or even care whether the collection was in English, German,
> etc.
>
>
> --
> Rick Reumann
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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



Re: Wanted best practice for i18n'd optionsCollection

2003-03-06 Thread Rick Reumann
On Fri, 7 Mar 2003 02:44:12 +0800
"Christopher Cheng" <[EMAIL PROTECTED]> wrote:
 
> > On Monday, Mar 3, 2003, at 21:16 Canada/Eastern, Christopher Cheng 
> > wrote:
> > 
> > > I posted a similar question long time ago in this list. -> Nobody 
> > > cares.
> > >
> > > So I developed my own custom tag to do it. What I did is
> > > populating the collection with locale keys in the label of the
> > > LabelValueBean and then get
> > > the exact message from the property file. If you want it, I can
> > > send you a
> > > copy of it.

I haven't had a need to solve any i18n issues, but since you can get an
access to the user's locale in your Action form, wouldn't it be simpler
to just pass this locale into your business tier so you could populate a
collection the correct i18n data? The JSPs and tags wouldn't know the
difference or even care whether the collection was in English, German,
etc.


-- 
Rick Reumann

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



Re: Wanted best practice for i18n'd optionsCollection

2003-03-06 Thread Christopher Cheng
Please comment

- Original Message - 
From: "Thomas Gourgon" <[EMAIL PROTECTED]>
To: "Christopher Cheng" <[EMAIL PROTECTED]>
Sent: Tuesday, March 04, 2003 10:03 PM
Subject: Re: Wanted best practice for i18n'd optionsCollection


> Hi Christopher,
> I would be interested in taking a look at this code as I am  currently 
> analysing the work involved in porting my client's website to struts 
> from mod_per. The site is a communication platform for educational 
> institution. It currently includes English, French, Spanish, German, 
> Portugees, Arabic, Chinese and Japanese so as you can see 
> internationalization is a big factor.
> 
> Best regards,
> 
> Thomas
> 
> 
> On Monday, Mar 3, 2003, at 21:16 Canada/Eastern, Christopher Cheng 
> wrote:
> 
> > I posted a similar question long time ago in this list. -> Nobody 
> > cares.
> >
> > So I developed my own custom tag to do it. What I did is populating the
> > collection with locale keys in the label of the LabelValueBean and 
> > then get
> > the exact message from the property file. If you want it, I can send 
> > you a
> > copy of it.
> >
> 
> Thomas Gourgon
> 
> Tritus Consultant Group Inc.
> www.tritus.ca
> 

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

Re: Wanted best practice for i18n'd optionsCollection

2003-03-03 Thread Christopher Cheng
I posted a similar question long time ago in this list. -> Nobody cares.

So I developed my own custom tag to do it. What I did is populating the
collection with locale keys in the label of the LabelValueBean and then get
the exact message from the property file. If you want it, I can send you a
copy of it.

- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 01, 2003 5:24 AM
Subject: Wanted best practice for i18n'd optionsCollection


> Hi all,
>
> I've successfully used the applications.properties method of isolating my
> messages, prompts etc. so I can use different locales in my struts pages.
I
> have some static select fields and I'm wondering what would be the best
way
> to use something like the optionsCollection to work with different
locales.
>
> As near as I can tell I might:
>
> - Create a custom tag that builds the collection for a particular locale
and
> sticks it into the Application Context if it is not already there.  Then
put
> a reference in my page context for the "generalized" collection property
to
> reference.
> - Then use OptionsCollection to display the collection of select options.
>
> I've not been able to figure out the best way to do this since there
doesn't
> seem to be locale information for the optionsCollection tag.
>
> Any suggestions would be gratefully appreciated!
>
> Thanks in advance,
>
> Bob
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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



Wanted best practice for i18n'd optionsCollection

2003-02-28 Thread Bob . Coss
Hi all,

I've successfully used the applications.properties method of isolating my
messages, prompts etc. so I can use different locales in my struts pages.  I
have some static select fields and I'm wondering what would be the best way
to use something like the optionsCollection to work with different locales.

As near as I can tell I might:

- Create a custom tag that builds the collection for a particular locale and
sticks it into the Application Context if it is not already there.  Then put
a reference in my page context for the "generalized" collection property to
reference.
- Then use OptionsCollection to display the collection of select options.

I've not been able to figure out the best way to do this since there doesn't
seem to be locale information for the optionsCollection tag.

Any suggestions would be gratefully appreciated!

Thanks in advance,

Bob

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



Re: Help with optionsCollection error

2003-02-26 Thread Peng Tuck Kwok
Ok here goes :
The original method for the attribute recipients was :
public void setRecipients(Vector input)
That caused the errors of the type mismatch ,
So I tried changing it to take to array of strings, like this
	public void setRecipients(String [] one, String [] two)
It doesn't complain about anything, but it doesn't pass any values to it 
as I have tried putting in a few println statements in there.



Ian Hunter wrote:
I don't understand the question -- if your example is working, the setter
method is getting called and it's storing whatever got passed to it.  Can
you ask the question a different way?
- Original Message -
From: "Peng Tuck Kwok" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, February 26, 2003 12:25 AM
Subject: Re: Help with optionsCollection error


Another question Ian, since I changed it, what values would be passed
into the two inputs ? I tried doing a System.out.println to see what's
in there but apparently the output does not come out.
Ian Hunter wrote:

Lowly me?  Contribute to the FAQ?  hee hee.  Glad to help.

(Hey, who's in charge of the FAQ around here?)

- Original Message -
From: "Peng Tuck Kwok" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 11:39 PM
Subject: Re: Help with optionsCollection error



Hi Ian, your tip worked like a charm and I substituted it with the
setRecipient(String key, String value) method. Hmm now I need to see
what exactly I put in there.
Ian ever thought of adding this as a faq in Struts ?

Peng Tuck Kwok wrote:


Will try that and post results. Thanks.

Ian Hunter wrote:



I think so -- whichever setter method within your ActionForm applies
to the
field named in your  tag has to be the ONLY setter method
named
whatever it's named.
That's contradictory to normal bean conventions where you would
normally


have

public void setValues(Vector values)
and
public void setValues(String key, String value)
for instance.  The introspection done by Struts can't tell the
difference so
you get an error thrown by BeanUtils.populate where it tries to call
setValues(String key, String value) with only one value.
There has been a fair amount of debate about this recently, but if you
have
overloaded setter methods, comment all but the one that suits the type
of


value you're really using, and see if it works.

I had to go from having
public void setIds(String ids[])
and
public void setIds(int i; String ids[])
to having

public void setIds(String ids[])
and
public void setId(int i; String ids[])
see the difference?  The "s" is gone in the case of the indexed
property.


See if that applies to your situation.

- Original Message -
From: "Peng Tuck Kwok" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 10:56 PM
Subject: Re: Help with optionsCollection error




I'm currently implementing the recipients as a vector of beans and I
do


provide method setRecipients which takes in a vector and sets the
recipients vector to it. Is that the setter method you are referring
to ?
Thanks.


Ian Hunter wrote:



The ActionForm descendant.



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


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



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



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


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



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


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



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


Re: Help with optionsCollection error

2003-02-26 Thread Ian Hunter
I don't understand the question -- if your example is working, the setter
method is getting called and it's storing whatever got passed to it.  Can
you ask the question a different way?

- Original Message -
From: "Peng Tuck Kwok" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, February 26, 2003 12:25 AM
Subject: Re: Help with optionsCollection error


> Another question Ian, since I changed it, what values would be passed
> into the two inputs ? I tried doing a System.out.println to see what's
> in there but apparently the output does not come out.
>
> Ian Hunter wrote:
> > Lowly me?  Contribute to the FAQ?  hee hee.  Glad to help.
> >
> > (Hey, who's in charge of the FAQ around here?)
> >
> > - Original Message -
> > From: "Peng Tuck Kwok" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > Sent: Tuesday, February 25, 2003 11:39 PM
> > Subject: Re: Help with optionsCollection error
> >
> >
> >
> >>Hi Ian, your tip worked like a charm and I substituted it with the
> >>setRecipient(String key, String value) method. Hmm now I need to see
> >>what exactly I put in there.
> >>
> >>Ian ever thought of adding this as a faq in Struts ?
> >>
> >>
> >>Peng Tuck Kwok wrote:
> >>
> >>>Will try that and post results. Thanks.
> >>>
> >>>Ian Hunter wrote:
> >>>
> >>>
> >>>>I think so -- whichever setter method within your ActionForm applies
> >>>>to the
> >>>>field named in your  tag has to be the ONLY setter method
> >>>>named
> >>>>whatever it's named.
> >>>>
> >>>>That's contradictory to normal bean conventions where you would
> >
> > normally
> >
> >>>>have
> >>>>
> >>>>public void setValues(Vector values)
> >>>>and
> >>>>public void setValues(String key, String value)
> >>>>
> >>>>for instance.  The introspection done by Struts can't tell the
> >>>>difference so
> >>>>you get an error thrown by BeanUtils.populate where it tries to call
> >>>>setValues(String key, String value) with only one value.
> >>>>
> >>>>There has been a fair amount of debate about this recently, but if you
> >>>>have
> >>>>overloaded setter methods, comment all but the one that suits the type
> >
> > of
> >
> >>>>value you're really using, and see if it works.
> >>>>
> >>>>I had to go from having
> >>>>public void setIds(String ids[])
> >>>>and
> >>>>public void setIds(int i; String ids[])
> >>>>
> >>>>to having
> >>>>
> >>>>public void setIds(String ids[])
> >>>>and
> >>>>public void setId(int i; String ids[])
> >>>>
> >>>>see the difference?  The "s" is gone in the case of the indexed
> >
> > property.
> >
> >>>>See if that applies to your situation.
> >>>>
> >>>>- Original Message -
> >>>>From: "Peng Tuck Kwok" <[EMAIL PROTECTED]>
> >>>>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >>>>Sent: Tuesday, February 25, 2003 10:56 PM
> >>>>Subject: Re: Help with optionsCollection error
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>>I'm currently implementing the recipients as a vector of beans and I
> >
> > do
> >
> >>>>>provide method setRecipients which takes in a vector and sets the
> >>>>>recipients vector to it. Is that the setter method you are referring
> >>>>>to ?
> >>>>>Thanks.
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>Ian Hunter wrote:
> >>>>>
> >>>>>
> >>>>>>The ActionForm descendant.
> >>>>>>
> >>>>>
> >>>>>
> >>>>>-
> >>>>>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>>>>For additional commands, e-mail: [EMAIL PROTECTED]
> >>>>>
> >>>>
> >>>>
> >>>>
> >>>>-
> >>>>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>>>For additional commands, e-mail: [EMAIL PROTECTED]
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >>>-
> >>>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>>For additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>>
> >>
> >>
> >>
> >>-
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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



Re: Help with optionsCollection error

2003-02-25 Thread Peng Tuck Kwok
Another question Ian, since I changed it, what values would be passed 
into the two inputs ? I tried doing a System.out.println to see what's 
in there but apparently the output does not come out.

Ian Hunter wrote:
Lowly me?  Contribute to the FAQ?  hee hee.  Glad to help.

(Hey, who's in charge of the FAQ around here?)

- Original Message -
From: "Peng Tuck Kwok" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 11:39 PM
Subject: Re: Help with optionsCollection error


Hi Ian, your tip worked like a charm and I substituted it with the
setRecipient(String key, String value) method. Hmm now I need to see
what exactly I put in there.
Ian ever thought of adding this as a faq in Struts ?

Peng Tuck Kwok wrote:

Will try that and post results. Thanks.

Ian Hunter wrote:


I think so -- whichever setter method within your ActionForm applies
to the
field named in your  tag has to be the ONLY setter method
named
whatever it's named.
That's contradictory to normal bean conventions where you would
normally

have

public void setValues(Vector values)
and
public void setValues(String key, String value)
for instance.  The introspection done by Struts can't tell the
difference so
you get an error thrown by BeanUtils.populate where it tries to call
setValues(String key, String value) with only one value.
There has been a fair amount of debate about this recently, but if you
have
overloaded setter methods, comment all but the one that suits the type
of

value you're really using, and see if it works.

I had to go from having
public void setIds(String ids[])
and
public void setIds(int i; String ids[])
to having

public void setIds(String ids[])
and
public void setId(int i; String ids[])
see the difference?  The "s" is gone in the case of the indexed
property.

See if that applies to your situation.

- Original Message -
From: "Peng Tuck Kwok" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 10:56 PM
Subject: Re: Help with optionsCollection error



I'm currently implementing the recipients as a vector of beans and I
do

provide method setRecipients which takes in a vector and sets the
recipients vector to it. Is that the setter method you are referring
to ?
Thanks.


Ian Hunter wrote:


The ActionForm descendant.



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


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



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



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


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



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


Re: Help with optionsCollection error

2003-02-25 Thread Ian Hunter
Lowly me?  Contribute to the FAQ?  hee hee.  Glad to help.

(Hey, who's in charge of the FAQ around here?)

- Original Message -
From: "Peng Tuck Kwok" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 11:39 PM
Subject: Re: Help with optionsCollection error


> Hi Ian, your tip worked like a charm and I substituted it with the
> setRecipient(String key, String value) method. Hmm now I need to see
> what exactly I put in there.
>
> Ian ever thought of adding this as a faq in Struts ?
>
>
> Peng Tuck Kwok wrote:
> > Will try that and post results. Thanks.
> >
> > Ian Hunter wrote:
> >
> >> I think so -- whichever setter method within your ActionForm applies
> >> to the
> >> field named in your  tag has to be the ONLY setter method
> >> named
> >> whatever it's named.
> >>
> >> That's contradictory to normal bean conventions where you would
normally
> >> have
> >>
> >> public void setValues(Vector values)
> >> and
> >> public void setValues(String key, String value)
> >>
> >> for instance.  The introspection done by Struts can't tell the
> >> difference so
> >> you get an error thrown by BeanUtils.populate where it tries to call
> >> setValues(String key, String value) with only one value.
> >>
> >> There has been a fair amount of debate about this recently, but if you
> >> have
> >> overloaded setter methods, comment all but the one that suits the type
of
> >> value you're really using, and see if it works.
> >>
> >> I had to go from having
> >> public void setIds(String ids[])
> >> and
> >> public void setIds(int i; String ids[])
> >>
> >> to having
> >>
> >> public void setIds(String ids[])
> >> and
> >> public void setId(int i; String ids[])
> >>
> >> see the difference?  The "s" is gone in the case of the indexed
property.
> >>
> >> See if that applies to your situation.
> >>
> >> - Original Message -
> >> From: "Peng Tuck Kwok" <[EMAIL PROTECTED]>
> >> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >> Sent: Tuesday, February 25, 2003 10:56 PM
> >> Subject: Re: Help with optionsCollection error
> >>
> >>
> >>
> >>> I'm currently implementing the recipients as a vector of beans and I
do
> >>> provide method setRecipients which takes in a vector and sets the
> >>> recipients vector to it. Is that the setter method you are referring
> >>> to ?
> >>> Thanks.
> >>>
> >>>
> >>>
> >>>
> >>> Ian Hunter wrote:
> >>>
> >>>> The ActionForm descendant.
> >>>>
> >>>
> >>>
> >>> -
> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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



Re: Help with optionsCollection error

2003-02-25 Thread Peng Tuck Kwok
Hi Ian, your tip worked like a charm and I substituted it with the 
setRecipient(String key, String value) method. Hmm now I need to see 
what exactly I put in there.

Ian ever thought of adding this as a faq in Struts ?

Peng Tuck Kwok wrote:
Will try that and post results. Thanks.

Ian Hunter wrote:

I think so -- whichever setter method within your ActionForm applies 
to the
field named in your  tag has to be the ONLY setter method 
named
whatever it's named.

That's contradictory to normal bean conventions where you would normally
have
public void setValues(Vector values)
and
public void setValues(String key, String value)
for instance.  The introspection done by Struts can't tell the 
difference so
you get an error thrown by BeanUtils.populate where it tries to call
setValues(String key, String value) with only one value.

There has been a fair amount of debate about this recently, but if you 
have
overloaded setter methods, comment all but the one that suits the type of
value you're really using, and see if it works.

I had to go from having
public void setIds(String ids[])
and
public void setIds(int i; String ids[])
to having

public void setIds(String ids[])
and
public void setId(int i; String ids[])
see the difference?  The "s" is gone in the case of the indexed property.

See if that applies to your situation.

- Original Message -
From: "Peng Tuck Kwok" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 10:56 PM
Subject: Re: Help with optionsCollection error


I'm currently implementing the recipients as a vector of beans and I do
provide method setRecipients which takes in a vector and sets the
recipients vector to it. Is that the setter method you are referring 
to ?
Thanks.



Ian Hunter wrote:

The ActionForm descendant.



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


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



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



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


Re: Help with optionsCollection error

2003-02-25 Thread Peng Tuck Kwok
Will try that and post results. Thanks.

Ian Hunter wrote:
I think so -- whichever setter method within your ActionForm applies to the
field named in your  tag has to be the ONLY setter method named
whatever it's named.
That's contradictory to normal bean conventions where you would normally
have
public void setValues(Vector values)
and
public void setValues(String key, String value)
for instance.  The introspection done by Struts can't tell the difference so
you get an error thrown by BeanUtils.populate where it tries to call
setValues(String key, String value) with only one value.
There has been a fair amount of debate about this recently, but if you have
overloaded setter methods, comment all but the one that suits the type of
value you're really using, and see if it works.
I had to go from having
public void setIds(String ids[])
and
public void setIds(int i; String ids[])
to having

public void setIds(String ids[])
and
public void setId(int i; String ids[])
see the difference?  The "s" is gone in the case of the indexed property.

See if that applies to your situation.

- Original Message -
From: "Peng Tuck Kwok" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 10:56 PM
Subject: Re: Help with optionsCollection error


I'm currently implementing the recipients as a vector of beans and I do
provide method setRecipients which takes in a vector and sets the
recipients vector to it. Is that the setter method you are referring to ?
Thanks.


Ian Hunter wrote:

The ActionForm descendant.



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


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



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


Re: Help with optionsCollection error

2003-02-25 Thread Ian Hunter
I think so -- whichever setter method within your ActionForm applies to the
field named in your  tag has to be the ONLY setter method named
whatever it's named.

That's contradictory to normal bean conventions where you would normally
have

public void setValues(Vector values)
and
public void setValues(String key, String value)

for instance.  The introspection done by Struts can't tell the difference so
you get an error thrown by BeanUtils.populate where it tries to call
setValues(String key, String value) with only one value.

There has been a fair amount of debate about this recently, but if you have
overloaded setter methods, comment all but the one that suits the type of
value you're really using, and see if it works.

I had to go from having
public void setIds(String ids[])
and
public void setIds(int i; String ids[])

to having

public void setIds(String ids[])
and
public void setId(int i; String ids[])

see the difference?  The "s" is gone in the case of the indexed property.

See if that applies to your situation.

- Original Message -
From: "Peng Tuck Kwok" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 10:56 PM
Subject: Re: Help with optionsCollection error


> I'm currently implementing the recipients as a vector of beans and I do
> provide method setRecipients which takes in a vector and sets the
> recipients vector to it. Is that the setter method you are referring to ?
> Thanks.
>
>
>
>
> Ian Hunter wrote:
> > The ActionForm descendant.
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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



Re: Help with optionsCollection error

2003-02-25 Thread Peng Tuck Kwok
I'm currently implementing the recipients as a vector of beans and I do 
provide method setRecipients which takes in a vector and sets the 
recipients vector to it. Is that the setter method you are referring to ?
Thanks.



Ian Hunter wrote:
The ActionForm descendant.



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


Re: Help with optionsCollection error

2003-02-25 Thread Ian Hunter
The ActionForm descendant.

- Original Message -
From: "Peng Tuck Kwok" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 10:39 PM
Subject: Re: Help with optionsCollection error


> You say :
> > My guess is the BeanUtils.populate error is because you wrote an indexed
> > setter method
> Which bean would that be? The form bean or the collections of beans that
>   the property refers to ?
>
> > and overloaded the String[] or Collection setter method.
> > Don't do that.
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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



Re: Help with optionsCollection error

2003-02-25 Thread Peng Tuck Kwok
You say :
My guess is the BeanUtils.populate error is because you wrote an indexed
setter method
Which bean would that be? The form bean or the collections of beans that 
 the property refers to ?

and overloaded the String[] or Collection setter method.
Don't do that.


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


Re: Help with optionsCollection error

2003-02-25 Thread Ian Hunter
My guess is the BeanUtils.populate error is because you wrote an indexed
setter method and overloaded the String[] or Collection setter method.
Don't do that.

- Original Message -
From: "Peng Tuck Kwok" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 10:20 PM
Subject: Help with optionsCollection error


> I've sucessfully managed to display a multiple options in 
> but when I click on submit I get errors.
>
> One condition is when I don't click on any of the options , this error
> would be failed to obtain specified collection when ever I try to access
> the bean attribute that contains the values. The bean attribute is a
> vector FYI.
>
> The second condition is when I click on one or more of the options and
> click submit I get a beanutils.populate error, type mismatch.
>
>
>size="8">
>  value="number"/>
>
>
> The form name is compose and recipients is a vector.
>
> Does anyone have a idea where I'm going wrong?
>
> TIA
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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



Help with optionsCollection error

2003-02-25 Thread Peng Tuck Kwok
I've sucessfully managed to display a multiple options in 
but when I click on submit I get errors.
One condition is when I don't click on any of the options , this error
would be failed to obtain specified collection when ever I try to access
the bean attribute that contains the values. The bean attribute is a
vector FYI.
The second condition is when I click on one or more of the options and
click submit I get a beanutils.populate error, type mismatch.
 

   
The form name is compose and recipients is a vector.

Does anyone have a idea where I'm going wrong?

TIA



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


RE: OptionsCollection and default value

2002-12-23 Thread John Menke


> Actually first just to appease me/us do a bean:write
> property="taskCodeType" right before you do the select options
> portion in your jsp. Then also view source of the page and see what
> you have listed as the values of the options (maybe your values aren't
> matching what is displayed, assuming you aren't using the label as the
> value of course). Let me know how it turns out.
>


Rick,


Task Code Type
  
  Internal
Client1
Client2
Development

It appears that I have the taskCodeType defined as char(15) in my
database --- that's why the value
is D(14 spaces)

I need to either make the values column char(15) or switch taskCodeType to
be a varchar.

Thanks for your help!

-jm



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: OptionsCollection and default value

2002-12-22 Thread David M. Karr
> "John" == John Menke <[EMAIL PROTECTED]> writes:

>> At this point, I would be executing this in the debugger, and
>> tracing through
>> the SelectTag code, and your form bean code.

John> I have to get JSP debugging setup to do that.  Do you know if eclipse
John> supports
John> JSP debugging with Tomcat?

You're not debugging JSP pages, you're debugging pure java code.  You just set
breakpoints in the tag handler code itself, and in your form bean code.

-- 
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]   ; SCJP



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: OptionsCollection and default value

2002-12-22 Thread Rick Reumann
On Sun, 22 Dec 2002 18:39:05 -0500
"John Menke" <[EMAIL PROTECTED]> wrote:
 
> 
> I have to get JSP debugging setup to do that.  Do you know if eclipse
> supports
> JSP debugging with Tomcat?
> 
Actually first just to appease me/us do a bean:write
property="taskCodeType" right before you do the select options
portion in your jsp. Then also view source of the page and see what
you have listed as the values of the options (maybe your values aren't
matching what is displayed, assuming you aren't using the label as the
value of course). Let me know how it turns out.


-- 
Rick

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: OptionsCollection and default value

2002-12-22 Thread John Menke
> At this point, I would be executing this in the debugger, and
> tracing through
> the SelectTag code, and your form bean code.
>

I have to get JSP debugging setup to do that.  Do you know if eclipse
supports
JSP debugging with Tomcat?

-jm


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: OptionsCollection and default value

2002-12-22 Thread David M. Karr
> "John" == John Menke <[EMAIL PROTECTED]> writes:

>> Are you sure that "taskCodeType" in your form bean is being set to
>> the appropriate value before being directed to the jsp?

John> I'm positive this works as I had the formbean working with html:text tags to
John> test and the taskCodeType variable displays fine.

John> When I change from html:text to html:select with html:optionsCollection the
John> option box is populated ok and I can update with values i select in the
John> option box, but the
John> current value is never selected initially.

At this point, I would be executing this in the debugger, and tracing through
the SelectTag code, and your form bean code.

-- 
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]   ; SCJP



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: OptionsCollection and default value

2002-12-22 Thread John Menke
>
> Are you sure that "taskCodeType" in your form bean is being set to
> the appropriate value before being directed to the jsp?
>

I'm positive this works as I had the formbean working with html:text tags to
test and the taskCodeType variable displays fine.

When I change from html:text to html:select with html:optionsCollection the
option box is populated ok and I can update with values i select in the
option box, but the
current value is never selected initially.



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: OptionsCollection and default value

2002-12-22 Thread Rick Reumann
On Sun, 22 Dec 2002 15:01:42 -0500
"John Menke" <[EMAIL PROTECTED]> wrote:
 
>  property="taskCodeTypeOptions"  />
> 
> 
> MY JSP WILL RUN AND POPULATE THE SELECT TAG CORRECTLY, BUT IT DOESN'T
> CHOOSE THE CORRECT INITIAL VALUE.
> 
> IE. THE "SELECTED" property is not set correctly.
> 

Are you sure that "taskCodeType" in your form bean is being set to
the appropriate value before being directed to the jsp?  


-- 
Rick

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: OptionsCollection and default value

2002-12-22 Thread David M. Karr
> "John" == John Menke <[EMAIL PROTECTED]> writes:

John> I have searched the archives and can't find a direct answer to this:
John> I am using html:optionsCollection within an  html:select tag.

John> My form bean has a method getTaskCodeTypeOptions that returns a collection
John> of beans with name and value properties

John> and my JSP is coded as follows:

John>  property="taskCodeTypeOptions"  />

John> MY JSP WILL RUN AND POPULATE THE SELECT TAG CORRECTLY, BUT IT DOESN'T CHOOSE
John> THE CORRECT INITIAL VALUE.

John> IE. THE "SELECTED" property is not set correctly.

Do you have a getter/setter for the "taskCodeType" property on your bean?

-- 
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]   ; SCJP



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




OptionsCollection and default value

2002-12-22 Thread John Menke
I have searched the archives and can't find a direct answer to this:

I am using html:optionsCollection within an  html:select tag.

My form bean has a method getTaskCodeTypeOptions that returns a collection
of beans with name and value properties

and my JSP is coded as follows:




MY JSP WILL RUN AND POPULATE THE SELECT TAG CORRECTLY, BUT IT DOESN'T CHOOSE
THE CORRECT INITIAL VALUE.

IE. THE "SELECTED" property is not set correctly.


Does anybody have this working?

-jm


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Re: OptionsCollection

2002-12-13 Thread shirishchandra . sakhare
Hi,
There are many ways of doing this.So first is as the collection is being 
displayed on screen,make it an attribute of form and popolate it in action on 
form.So in jsp u will access like a form attribute.

But the problem with this approach is If u get an error and forward back the 
user to same jsp, u loose the collection data as u are directly going to the 
screen.So the solution could be have a generic action which will be called in 
case of errors and the action will populate form with list before forwarding it 
to same jsp.

Else U can have lazy in itialising forms.i.e forms getList emthod itself will 
call service to get data if list is null.And then in this case ,u can just use 
an epty action class which does nothing but forwarsd to "success" which is the 
origicnal jsp.But this action will be mapped with the Original actions form so 
that the form will use its auto population mechanism to get the list..But i 
dont like this approach ..just not a good design i think.But very conveninent.


Hope this helps,
Regards,
Shirish

-Original Message-
From: marklowe [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 12:12 PM
To: struts-user
Cc: marklowe
Subject: Re: OptionsCollection


Okay... But a drop down menu is screen data.

And a list of companies is something that will be used more than once.

So I have a normal class in my model layer

ListCompanies

In my UserAction

(ListCompanies).getCompanies();

But this Action's primary job is to return a list of users (which it does).

As the list is screen data i should be defining this in my form bean? This
is something thats being confusing me for weeks. If i've a bunch of
collections how can i make them available to iterate tags and select menus,
without using useBean (sorry silly design constraint, but beyond my
control).

Hopefully I'm just being silly, i could really do with some pointers as
where i'm missing the point.

Cheers mark


On 13-12-2002 11:49, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:

> Also i dont understand why u need to access the request directly.I mean why
> are 
> u setting all the collections as request attributes.GEnerally I think the good
> design is when u r FormBEan represents the screen data.So in this case
> whatever 
> u need on screen will become attribute of form.
> I know it does not make much difference in implemantation but as a design it
> becomes pretty straight forward.I mean for an action , if u just look at the
> form, u know what is being displayed.So u just populate the form in action.
> 
> Any comments... :-))
> 
> 
> -Original Message-
> From: VEDRE [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 13, 2002 11:44 AM
> To: struts-user
> Cc: VEDRE
> Subject: RE: OptionsCollection
> 
> 
> You can either use attribute collection="users" for options tag if you store
> in request
> or you can use   name="formName" property="myList"   if you have
> a getMyList() method for the form(You have to fill call formName.setMyList()
> in your action class before forwarding to a jsp).
> 
> 
> checkout http://jakarta.apache.org/struts/userGuide/struts-html.html#options
> if you have not looked at the documentation.
> 
> -rana.
> 
> 
> -Original Message-
> From: Mark [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 13, 2002 5:36 AM
> To: Struts Users Mailing List
> Subject: OptionsCollection
> 
> 
> Hello
> 
> I've a number of collections already defined that end up being passed to my
> jsp's via the request object.
> 
> Users in this case is a map defined in my business logic class that does db
> queries.
> 
> users = (ListUsers).getUsers();
> 
> request.setAttribute("users",users);
> 
> 
> I itertate through this collection using iterate. But now i want to use this
> in a select menu.
> 
> Should I be thinking about making my collection available to my FormBean i.e
> making a getMyList() method.
> 
> Thanks in advance
> 
> mark
> 
> 
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 


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



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




Re: OptionsCollection

2002-12-13 Thread V. Cekvenich
Confused as to what your confusion is.

Are you confused that you see one thing and display another (which I get 
a lot from my students?).

There are 2 things going on, a client/browser side join not a db/server 
side join.
Example, you have a formBean with dept "101" a numeric field. You unit 
test this and CRUD. This is your Form Bean!!
Once you get that, then:
Now you want to display "Marketing" as a drop down instead of 101. So 
101-Marketing, 102-Sales, etc. You care a collection, yet another thing 
you put in scope.
The client side, using select and optionCollection tag displays current 
dept., and a choice of other depts.
So a user sees "Marketing" drop down, which comes from the name part of 
collection. But the current value is in the formbean.

.V

Mark wrote:
Okay... But a drop down menu is screen data.

And a list of companies is something that will be used more than once.

So I have a normal class in my model layer

ListCompanies

In my UserAction

(ListCompanies).getCompanies();

But this Action's primary job is to return a list of users (which it does).

As the list is screen data i should be defining this in my form bean? This
is something thats being confusing me for weeks. If i've a bunch of
collections how can i make them available to iterate tags and select menus,
without using useBean (sorry silly design constraint, but beyond my
control).

Hopefully I'm just being silly, i could really do with some pointers as
where i'm missing the point.

Cheers mark


On 13-12-2002 11:49, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:



Also i dont understand why u need to access the request directly.I mean why
are 
u setting all the collections as request attributes.GEnerally I think the good
design is when u r FormBEan represents the screen data.So in this case
whatever 
u need on screen will become attribute of form.
I know it does not make much difference in implemantation but as a design it
becomes pretty straight forward.I mean for an action , if u just look at the
form, u know what is being displayed.So u just populate the form in action.

Any comments... :-))


-Original Message-
From: VEDRE [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 11:44 AM
To: struts-user
Cc: VEDRE
Subject: RE: OptionsCollection


You can either use attribute collection="users" for options tag if you store
in request
or you can use   name="formName" property="myList"   if you have
a getMyList() method for the form(You have to fill call formName.setMyList()
in your action class before forwarding to a jsp).


checkout http://jakarta.apache.org/struts/userGuide/struts-html.html#options
if you have not looked at the documentation.

-rana.


-Original Message-
From: Mark [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 5:36 AM
To: Struts Users Mailing List
Subject: OptionsCollection


Hello

I've a number of collections already defined that end up being passed to my
jsp's via the request object.

Users in this case is a map defined in my business logic class that does db
queries.

users = (ListUsers).getUsers();

request.setAttribute("users",users);


I itertate through this collection using iterate. But now i want to use this
in a select menu.

Should I be thinking about making my collection available to my FormBean i.e
making a getMyList() method.

Thanks in advance

mark


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

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



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






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




Re: OptionsCollection

2002-12-13 Thread V. Cekvenich
Use Struts-menu from sf.net.

Mark wrote:

Hello

I've a number of collections already defined that end up being passed to my
jsp's via the request object.

Users in this case is a map defined in my business logic class that does db
queries.
 
users = (ListUsers).getUsers();

request.setAttribute("users",users);


I itertate through this collection using iterate. But now i want to use this
in a select menu. 

Should I be thinking about making my collection available to my FormBean i.e
making a getMyList() method.

Thanks in advance

mark




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: OptionsCollection

2002-12-13 Thread V. Cekvenich
Put it in application scope.

Mark wrote:

I've read the documentation.. The confusion is how do i access a collection
when the action returns another

Imagine i've a user form and a list of users on the same page.

[list returned via request via action]
Joe Bloggs
Another User
Etc

Add user form
Name 
Company 

I've already passed a list of users via the request object, and I'm not
happy with the concept of having to run an action everytime i want to get a
collection.

I could have a bunch of collections in my session but I'd prefer to use the
request. I know how to do this by instantiating a bean in my jsp, but I
can't do this due to some silly design constraints because this might
involve people having to learn something else.

I can think of a few ways of attempting this but I imagine that there must
be a way of doing this only defining collections once and being able to list
without calling an action. Ideally my collections will be availble on any
page, without having to instantiate anything.

So far I can only see that manipulating forms via FormBean . But then what
happens when i want the collection for something else? I could be confused
but when i read the struts docs i got the impression that this sort of thing
was possible. 

Many thanks mark
 

On 13-12-2002 11:44, "VEDRE, RANAPRATAP REDDY" <[EMAIL PROTECTED]> wrote:


You can either use attribute collection="users" for options tag if you store
in request
or you can use   name="formName" property="myList"   if you have
a getMyList() method for the form(You have to fill call formName.setMyList()
in your action class before forwarding to a jsp).


checkout http://jakarta.apache.org/struts/userGuide/struts-html.html#options
if you have not looked at the documentation.

-rana.


-Original Message-
From: Mark [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 5:36 AM
To: Struts Users Mailing List
Subject: OptionsCollection


Hello

I've a number of collections already defined that end up being passed to my
jsp's via the request object.

Users in this case is a map defined in my business logic class that does db
queries.

users = (ListUsers).getUsers();

request.setAttribute("users",users);


I itertate through this collection using iterate. But now i want to use this
in a select menu.

Should I be thinking about making my collection available to my FormBean i.e
making a getMyList() method.

Thanks in advance

mark


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

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







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




Re: OptionsCollection

2002-12-13 Thread Mark
Okay... But a drop down menu is screen data.

And a list of companies is something that will be used more than once.

So I have a normal class in my model layer

ListCompanies

In my UserAction

(ListCompanies).getCompanies();

But this Action's primary job is to return a list of users (which it does).

As the list is screen data i should be defining this in my form bean? This
is something thats being confusing me for weeks. If i've a bunch of
collections how can i make them available to iterate tags and select menus,
without using useBean (sorry silly design constraint, but beyond my
control).

Hopefully I'm just being silly, i could really do with some pointers as
where i'm missing the point.

Cheers mark


On 13-12-2002 11:49, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:

> Also i dont understand why u need to access the request directly.I mean why
> are 
> u setting all the collections as request attributes.GEnerally I think the good
> design is when u r FormBEan represents the screen data.So in this case
> whatever 
> u need on screen will become attribute of form.
> I know it does not make much difference in implemantation but as a design it
> becomes pretty straight forward.I mean for an action , if u just look at the
> form, u know what is being displayed.So u just populate the form in action.
> 
> Any comments... :-))
> 
> 
> -Original Message-
> From: VEDRE [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 13, 2002 11:44 AM
> To: struts-user
> Cc: VEDRE
> Subject: RE: OptionsCollection
> 
> 
> You can either use attribute collection="users" for options tag if you store
> in request
> or you can use   name="formName" property="myList"   if you have
> a getMyList() method for the form(You have to fill call formName.setMyList()
> in your action class before forwarding to a jsp).
> 
> 
> checkout http://jakarta.apache.org/struts/userGuide/struts-html.html#options
> if you have not looked at the documentation.
> 
> -rana.
> 
> 
> -Original Message-
> From: Mark [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 13, 2002 5:36 AM
> To: Struts Users Mailing List
> Subject: OptionsCollection
> 
> 
> Hello
> 
> I've a number of collections already defined that end up being passed to my
> jsp's via the request object.
> 
> Users in this case is a map defined in my business logic class that does db
> queries.
> 
> users = (ListUsers).getUsers();
> 
> request.setAttribute("users",users);
> 
> 
> I itertate through this collection using iterate. But now i want to use this
> in a select menu.
> 
> Should I be thinking about making my collection available to my FormBean i.e
> making a getMyList() method.
> 
> Thanks in advance
> 
> mark
> 
> 
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 


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




Re: OptionsCollection

2002-12-13 Thread Mark
I've read the documentation.. The confusion is how do i access a collection
when the action returns another

Imagine i've a user form and a list of users on the same page.

[list returned via request via action]
Joe Bloggs
Another User
Etc

Add user form
Name 
Company 

I've already passed a list of users via the request object, and I'm not
happy with the concept of having to run an action everytime i want to get a
collection.

I could have a bunch of collections in my session but I'd prefer to use the
request. I know how to do this by instantiating a bean in my jsp, but I
can't do this due to some silly design constraints because this might
involve people having to learn something else.

I can think of a few ways of attempting this but I imagine that there must
be a way of doing this only defining collections once and being able to list
without calling an action. Ideally my collections will be availble on any
page, without having to instantiate anything.

So far I can only see that manipulating forms via FormBean . But then what
happens when i want the collection for something else? I could be confused
but when i read the struts docs i got the impression that this sort of thing
was possible. 

Many thanks mark
 

On 13-12-2002 11:44, "VEDRE, RANAPRATAP REDDY" <[EMAIL PROTECTED]> wrote:

> You can either use attribute collection="users" for options tag if you store
> in request
> or you can use   name="formName" property="myList"   if you have
> a getMyList() method for the form(You have to fill call formName.setMyList()
> in your action class before forwarding to a jsp).
> 
> 
> checkout http://jakarta.apache.org/struts/userGuide/struts-html.html#options
> if you have not looked at the documentation.
> 
> -rana.
> 
> 
> -Original Message-
> From: Mark [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 13, 2002 5:36 AM
> To: Struts Users Mailing List
> Subject: OptionsCollection
> 
> 
> Hello
> 
> I've a number of collections already defined that end up being passed to my
> jsp's via the request object.
> 
> Users in this case is a map defined in my business logic class that does db
> queries.
> 
> users = (ListUsers).getUsers();
> 
> request.setAttribute("users",users);
> 
> 
> I itertate through this collection using iterate. But now i want to use this
> in a select menu.
> 
> Should I be thinking about making my collection available to my FormBean i.e
> making a getMyList() method.
> 
> Thanks in advance
> 
> mark
> 
> 
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 


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




RE: OptionsCollection

2002-12-13 Thread shirishchandra . sakhare
Also i dont understand why u need to access the request directly.I mean why are 
u setting all the collections as request attributes.GEnerally I think the good 
design is when u r FormBEan represents the screen data.So in this case whatever 
u need on screen will become attribute of form.
I know it does not make much difference in implemantation but as a design it 
becomes pretty straight forward.I mean for an action , if u just look at the 
form, u know what is being displayed.So u just populate the form in action.

Any comments... :-))


-Original Message-
From: VEDRE [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 11:44 AM
To: struts-user
Cc: VEDRE
Subject: RE: OptionsCollection


You can either use attribute collection="users" for options tag if you store
in request
or you can use   name="formName" property="myList"   if you have
a getMyList() method for the form(You have to fill call formName.setMyList()
in your action class before forwarding to a jsp).


checkout http://jakarta.apache.org/struts/userGuide/struts-html.html#options
if you have not looked at the documentation.

-rana.


-Original Message-
From: Mark [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 5:36 AM
To: Struts Users Mailing List
Subject: OptionsCollection


Hello

I've a number of collections already defined that end up being passed to my
jsp's via the request object.

Users in this case is a map defined in my business logic class that does db
queries.
 
users = (ListUsers).getUsers();

request.setAttribute("users",users);


I itertate through this collection using iterate. But now i want to use this
in a select menu. 

Should I be thinking about making my collection available to my FormBean i.e
making a getMyList() method.

Thanks in advance

mark


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

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



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




RE: OptionsCollection

2002-12-13 Thread VEDRE, RANAPRATAP REDDY
You can either use attribute collection="users" for options tag if you store
in request
or you can use   name="formName" property="myList"   if you have
a getMyList() method for the form(You have to fill call formName.setMyList()
in your action class before forwarding to a jsp).


checkout http://jakarta.apache.org/struts/userGuide/struts-html.html#options
if you have not looked at the documentation.

-rana.


-Original Message-
From: Mark [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 5:36 AM
To: Struts Users Mailing List
Subject: OptionsCollection


Hello

I've a number of collections already defined that end up being passed to my
jsp's via the request object.

Users in this case is a map defined in my business logic class that does db
queries.
 
users = (ListUsers).getUsers();

request.setAttribute("users",users);


I itertate through this collection using iterate. But now i want to use this
in a select menu. 

Should I be thinking about making my collection available to my FormBean i.e
making a getMyList() method.

Thanks in advance

mark


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

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




OptionsCollection

2002-12-13 Thread Mark
Hello

I've a number of collections already defined that end up being passed to my
jsp's via the request object.

Users in this case is a map defined in my business logic class that does db
queries.
 
users = (ListUsers).getUsers();

request.setAttribute("users",users);


I itertate through this collection using iterate. But now i want to use this
in a select menu. 

Should I be thinking about making my collection available to my FormBean i.e
making a getMyList() method.

Thanks in advance

mark


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Self reference in optionsCollection

2002-11-21 Thread Karr, David
There's no such notion of "this" in the standard tags.  You specify
exactly which bean you want to reference.

> -Original Message-
> From: David Morris [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, November 21, 2002 10:44 AM
> To: [EMAIL PROTECTED]
> Subject: Self reference in optionsCollection
> 
> 
> How do you reference "this" in an optionsCollection (or any 
> standard tag for that matter)? The nested tags support a 
> special notation of ./ or this/, which doesn't appear to carry 
> through to standard tags.
> 
> Thanks,
> 
> David Morris
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 

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




Self reference in optionsCollection

2002-11-21 Thread David Morris
How do you reference "this" in an optionsCollection (or any 
standard tag for that matter)? The nested tags support a 
special notation of ./ or this/, which doesn't appear to carry 
through to standard tags.

Thanks,

David Morris

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




optionsCollection error "Failed to obtain specified collection"after unsuccessful validate()

2002-11-14 Thread adam kramer

I'm using the Struts nightly build from nov. 13.

Initially I populate an ArrayList in a Validator form in an Action with
authentication types for a login screen.

In the jsp page, the authentication types are displayed with an
optionsCollection tag:





These are displayed successfully when the screen is diasplayed.
When I submit and purposefully leave out a required field (like username)
from the login form and submit, the screen should redisplay with
appropriate messages (it does without the optoinsCollection and select
tags). It doesn't. I get the message:

javax.servlet.jsp.JspException: Failed to obtain specified collection
at 
org.apache.struts.taglib.html.OptionsCollectionTag.doStartTag(OptionsCollectionTag.java:233)

So where is the collection going? It is in the form instantiation because
I 'set' it in the form in the initial action. Does the form reset() and
get rid of every attribute, including the array list?

Any help is appreciated.

Thanks,
Adam K.

p.s. I got the same problem with putting the Array List in the request
object after an unsuccessful validation.


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>




RE: Get better performance with optionsCollection

2002-08-09 Thread Jacob Hookom

Try JSTL and see if that helps any.

Going on the caching idea, use  to write the output of the
iteration to an application scope variable, and only execute that bit
with a conditional if options not in application scope.

That way, you store the resulting html code in the application without
needing to regenerate it on every request.

Regards,
Jake

| -Original Message-
| From: Joe Latty [mailto:[EMAIL PROTECTED]]
| Sent: Friday, August 09, 2002 3:40 AM
| To: Struts Users Mailing List
| Subject: RE: Get better performance with optionsCollection
| 
| Not exactly sure if this will help performance but I am using the
| org.apache.struts.util.LabelValueBean and the optionsCollection. Works
a
| treat, one other thing is maybe cacheing your "landliste" if this is
| possible.
| 
| Joe
| 
| -Original Message-
| From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
| Sent: Friday, 9 August 2002 5:59 PM
| To: [EMAIL PROTECTED]
| Subject: Get better performance with optionsCollection
| 
| 
| Hi!
| 
| I use a select-tag im my JSP. But now a have a performance problem,
| because
| I have an options-list with more than 100 entrys. Is there someone who
can
| tell me hot to make this faster (better way to do this!).
| 
| My Settings:
| 
| JSP:
|   
|   
|   
| 
| 
| Form-Object:
|   public Vector getLandliste()
|   {
|   // Returns a Vector with Land-List-Entry-Objects
|   }
| 
| 
| Thanks:
| 
| Marc
| 
| --
| To unsubscribe, e-mail:
| <mailto:[EMAIL PROTECTED]>
| For additional commands, e-mail:
| <mailto:[EMAIL PROTECTED]>
| 
| 
| --
| To unsubscribe, e-mail:   <mailto:struts-user-
| [EMAIL PROTECTED]>
| For additional commands, e-mail: <mailto:struts-user-
| [EMAIL PROTECTED]>
| 
| ---
| Incoming mail is certified Virus Free.
| Checked by AVG anti-virus system (http://www.grisoft.com).
| Version: 6.0.380 / Virus Database: 213 - Release Date: 7/24/2002
| 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.380 / Virus Database: 213 - Release Date: 7/24/2002
 


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




Re: Get better performance with optionsCollection

2002-08-09 Thread Cliff Rowley

Alternatively, sometimes it may be more efficient both in terms of
performance and user interaction to think about how you present your
users with data, and how you receive interaction.  A very long drop-down
list may be (and often is) cumbersome.

Some points to think about:

- Is the list of items in this list likely to grow?  If so, is the
drop-down list approach still going to be acceptable when you have 200
or 300, 400, ... items?

- Is the list of items going to be used frequently by a user?  If so,
then any 'slight' annoyance will be amplified as time progresses (don't
assume a user will 'get used to it' - while it may be true in some
cases)

Can you present the data in another way?  For example, I recently took
over the development of a half finished ColdFusion based booking system
(which, incidentally I scrapped and built from scratch using Struts) and
the previous inhabitant had used drop-down lists pretty much everywhere
to make selections.  In one particular instance, when creating a
reservation using the system, the user was presented with a drop-down
list containing the names of all the customers in the database - which
is fine while there are only 50 customers there - but with new customers
being added daily, this is obviously not a long term solution.

To overcome this, I provide the user with a means to select a customer
by clicking a button which takes them to a customer selection screen. 
>From that screen they can view a paged list, or type a search term into
a text box.  When a customer is selected they are returned to the
reservations screen to continue creating a new reservation.  This
solution is not only future proof, but it is also much more user
friendly.  OK, so it's a couple more mouse clicks - but far less
irritating and cumbersome than scrolling up and down a lengthy drop-down
list - and also more featured.  (Incidentally the customer selection
process is also entirely detached from the reservation creation process,
and used in several places in the booking system - mmm reuse).

Obviously I am not suggesting you implement the exact same system - it
is just an example.  Usually, unless I have made a glaringly obvious
mistake, I take another look at my solution when I come across
performance problems - and quite often the result is a better interface.

I hope that made sense, it's been a long night and I don't feel
particularly articulate today.

On Fri, 2002-08-09 at 08:58, [EMAIL PROTECTED] wrote:
> Hi!
> 
> I use a select-tag im my JSP. But now a have a performance problem, because I have 
>an options-list with more than 100 entrys. Is there someone who can tell me hot to 
>make this faster (better way to do this!).
> 
> My Settings:
> 
> JSP:
>   
>   value="code"/>
>   
> 
> 
> Form-Object:
>   public Vector getLandliste()
>   {
>   // Returns a Vector with Land-List-Entry-Objects
>   }
> 
> 
> Thanks:
> 
> Marc
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
> 
> 
-- 

Regards

---
 Cliff Rowley| [EMAIL PROTECTED]
 Software Engineer   |   www.doctype.co.uk
 +44 (0) 1206 514263 | www.cliffrowley.com
---


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Get better performance with optionsCollection

2002-08-09 Thread Joe Latty

Not exactly sure if this will help performance but I am using the
org.apache.struts.util.LabelValueBean and the optionsCollection. Works a
treat, one other thing is maybe cacheing your "landliste" if this is
possible.

Joe

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, 9 August 2002 5:59 PM
To: [EMAIL PROTECTED]
Subject: Get better performance with optionsCollection


Hi!

I use a select-tag im my JSP. But now a have a performance problem, because
I have an options-list with more than 100 entrys. Is there someone who can
tell me hot to make this faster (better way to do this!).

My Settings:

JSP:





Form-Object:
public Vector getLandliste()
{
// Returns a Vector with Land-List-Entry-Objects
}


Thanks:

Marc

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


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




Get better performance with optionsCollection

2002-08-09 Thread Marc.Hofer

Hi!

I use a select-tag im my JSP. But now a have a performance problem, because I have an 
options-list with more than 100 entrys. Is there someone who can tell me hot to make 
this faster (better way to do this!).

My Settings:

JSP:





Form-Object:
public Vector getLandliste()
{
// Returns a Vector with Land-List-Entry-Objects
}


Thanks:

Marc

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




can the optionscollection tag use an array?

2002-07-02 Thread Bill Milbratz

Hi,

I'm looking over the documentation for the new  tag
and wanted to clarify a detail:

Can the 'collection of objects' (identified by the 'property' attribute)  be
an array of objects? Or must it be a java.util.Collection?

This is an issue because use of arrays would cut down a bit on our object
creation.

I know  can use an array, but I didn't want to make
assumptions about  .

thanks,

bill m

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Problems with optionsCollection tag and Weblogic 6.1

2002-03-26 Thread Arnaud Heritier

It's done Marcelo

===>

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7485>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7485

Bad release of tag html:optionsCollection

   Summary: Bad release of tag html:optionsCollection
   Product: Struts
   Version: 1.1 Beta 1
  Platform: All
   URL: http://www.mail-archive.com/struts-
user%40jakarta.apache.org/msg26926.html
OS/Version: All
Status: NEW
  Severity: Normal
  Priority: Other
 Component: Custom Tags
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]


The use of the optionsCollection tag with Weblogic produces errors.
The problem should be in the release method.

OptionsCollectionTag is initialized with :

protected String label = "label";
protected String name = Constants.BEAN_KEY;
protected String property = null;
private String style = null;
private String styleClass = null;
protected String value = "value";

but the release method defines :

label = null;
name = null;
property = null;
style = null;
styleClass = null;
value = null;

so label, name and value don't have their default values.



> -Message d'origine-
> De:   Marcelo Vanzin [SMTP:[EMAIL PROTECTED]]
> Date: mardi 26 mars 2002 16:05
> A:Struts Users Mailing List
> Objet:Re: Problems with optionsCollection tag and Weblogic 6.1
> 
> Arnaud Heritier wrote:
> > but the release method defines :
> > 
> > label = null;
> > name = null;
> > property = null;
> > style = null;
> > styleClass = null;
> > value = null;
> 
>   Hmmm, I guess this is something that needs to be fixed. :-) I think I 
> missed this in the code...
> 
> > Do you used the name and value attributes in the tag 
> 
>   I use "property" but not "name", so when the name is set to "null" I am 
> screwed... thanks for the help!!!
> 
>   Have you warned the taglib developers about it? (I'll be building Struts 
> 1.1b with this fix for internal use.)
> 
> -- 
> []'s
> Marcelo Vanzin
> Touch Tecnologia
> [EMAIL PROTECTED]
> "Life is too short to drink cheap beer"
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


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




Re: Problems with optionsCollection tag and Weblogic 6.1

2002-03-26 Thread Marcelo Vanzin

Arnaud Heritier wrote:
> but the release method defines :
> 
> label = null;
> name = null;
> property = null;
> style = null;
> styleClass = null;
> value = null;

Hmmm, I guess this is something that needs to be fixed. :-) I think I 
missed this in the code...

> Do you used the name and value attributes in the tag 

I use "property" but not "name", so when the name is set to "null" I am 
screwed... thanks for the help!!!

Have you warned the taglib developers about it? (I'll be building Struts 
1.1b with this fix for internal use.)

-- 
[]'s
Marcelo Vanzin
Touch Tecnologia
[EMAIL PROTECTED]
"Life is too short to drink cheap beer"


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Problems with optionsCollection tag and Weblogic 6.1

2002-03-26 Thread Arnaud Heritier

I don't know if it is the source of the problem but in struts 1.1 B1 the code of 
OptionsCollectionTag is initialized with :

protected String label = "label";
protected String name = Constants.BEAN_KEY;
protected String property = null;
private String style = null;
private String styleClass = null;
protected String value = "value";

but the release method defines :

label = null;
name = null;
property = null;
style = null;
styleClass = null;
value = null;

so label, name and value don't have their default values.

it can produce the error.


Do you used the name and value attributes in the tag 


Arnaud 

> -Message d'origine-
> De:   Arnaud Heritier [SMTP:[EMAIL PROTECTED]]
> Date: mardi 26 mars 2002 15:42
> A:'Struts Users Mailing List'
> Objet:RE: Problems with optionsCollection tag and Weblogic 6.1
> 
> I didn't watch the code but the difference between tomcat and weblogic is that 
>weblogic reuse the taglibraries in the same page.
> Tomcat create a new TagClass for each tag instance while Weblogic reuse the first 
>instance and call the release method.
> 
> This method should reinit all default values in the release method.
> I'm using struts 1.0.2 with WLS 6.1 SP2 and i don't have any problem.
> But I know that there's a lot of bug in WLS 6.1.
> 
> arnaud
> 
> > -Message d'origine-
> > De: Marcelo Vanzin [SMTP:[EMAIL PROTECTED]]
> > Date:   mardi 26 mars 2002 15:32
> > A:  Struts Users
> > Objet:  Problems with optionsCollection tag and Weblogic 6.1
> > 
> > 
> > Hello there,
> > 
> > I've started to use Struts 1.1, and one of the things I was testing was 
> > the "html:optionsCollection" tag, to replace one we coded here (based on 
> > html:options) that did the same thing.
> > 
> > Everything worked fine when testing in Tomcat, but when running our JSPs 
> > in Weblogic (6.1 sp1) something realy strange happens.
> > 
> > The first time the tag is called, it works fine. But if you call it a 
> > second time in the same page, it fails with an exception:
> > 
> > javax.servlet.jsp.JspException: Cannot find bean null in scope null
> > at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:692)
> > at 
> > 
>org.apache.struts.taglib.html.OptionsCollectionTag.doStartTag(OptionsCollectionTag.java:217)
> > 
> > I have a page with 4 calls to this tag, and it always fails in the second 
> > call. If I comment the 1st one, then it will fail on the 3rd (and the 
> > one that previously caused the exception will render fine).
> > 
> > I've taken a look at the tag code, and it does not seem to have anything 
> > unusual, so I think this is an issue with Weblogic.
> > 
> > Has anyone seen this behaviour, and has some idea of a workaround?
> > 
> > (We're struggling to install sp2 now, maybe when we manage to install it 
> > this bug may be fixed, who knows...)
> > 
> > -- 
> > []'s
> > Marcelo Vanzin
> > Touch Tecnologia
> > [EMAIL PROTECTED]
> > "Life is too short to drink cheap beer"
> > 
> > 
> > --
> > To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


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




RE: Problems with optionsCollection tag and Weblogic 6.1

2002-03-26 Thread Arnaud Heritier

I didn't watch the code but the difference between tomcat and weblogic is that 
weblogic reuse the taglibraries in the same page.
Tomcat create a new TagClass for each tag instance while Weblogic reuse the first 
instance and call the release method.

This method should reinit all default values in the release method.
I'm using struts 1.0.2 with WLS 6.1 SP2 and i don't have any problem.
But I know that there's a lot of bug in WLS 6.1.

arnaud

> -Message d'origine-
> De:   Marcelo Vanzin [SMTP:[EMAIL PROTECTED]]
> Date: mardi 26 mars 2002 15:32
> A:Struts Users
> Objet:Problems with optionsCollection tag and Weblogic 6.1
> 
> 
>   Hello there,
> 
>   I've started to use Struts 1.1, and one of the things I was testing was 
> the "html:optionsCollection" tag, to replace one we coded here (based on 
> html:options) that did the same thing.
> 
>   Everything worked fine when testing in Tomcat, but when running our JSPs 
> in Weblogic (6.1 sp1) something realy strange happens.
> 
>   The first time the tag is called, it works fine. But if you call it a 
> second time in the same page, it fails with an exception:
> 
> javax.servlet.jsp.JspException: Cannot find bean null in scope null
> at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:692)
> at 
> 
>org.apache.struts.taglib.html.OptionsCollectionTag.doStartTag(OptionsCollectionTag.java:217)
> 
>   I have a page with 4 calls to this tag, and it always fails in the second 
> call. If I comment the 1st one, then it will fail on the 3rd (and the 
> one that previously caused the exception will render fine).
> 
>   I've taken a look at the tag code, and it does not seem to have anything 
> unusual, so I think this is an issue with Weblogic.
> 
>   Has anyone seen this behaviour, and has some idea of a workaround?
> 
>   (We're struggling to install sp2 now, maybe when we manage to install it 
> this bug may be fixed, who knows...)
> 
> -- 
> []'s
> Marcelo Vanzin
> Touch Tecnologia
> [EMAIL PROTECTED]
> "Life is too short to drink cheap beer"
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


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




Problems with optionsCollection tag and Weblogic 6.1

2002-03-26 Thread Marcelo Vanzin


Hello there,

I've started to use Struts 1.1, and one of the things I was testing was 
the "html:optionsCollection" tag, to replace one we coded here (based on 
html:options) that did the same thing.

Everything worked fine when testing in Tomcat, but when running our JSPs 
in Weblogic (6.1 sp1) something realy strange happens.

The first time the tag is called, it works fine. But if you call it a 
second time in the same page, it fails with an exception:

javax.servlet.jsp.JspException: Cannot find bean null in scope null
at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:692)
at 
org.apache.struts.taglib.html.OptionsCollectionTag.doStartTag(OptionsCollectionTag.java:217)

I have a page with 4 calls to this tag, and it always fails in the second 
call. If I comment the 1st one, then it will fail on the 3rd (and the 
one that previously caused the exception will render fine).

I've taken a look at the tag code, and it does not seem to have anything 
unusual, so I think this is an issue with Weblogic.

Has anyone seen this behaviour, and has some idea of a workaround?

(We're struggling to install sp2 now, maybe when we manage to install it 
this bug may be fixed, who knows...)

-- 
[]'s
Marcelo Vanzin
Touch Tecnologia
[EMAIL PROTECTED]
"Life is too short to drink cheap beer"


--
To unsubscribe, e-mail:   
For additional commands, e-mail: