• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Show the value in select tag

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have declare ar arry in form bean class and use two select box having same property name.
when i am retrive i am putting into the array.

but in the select box it is not showing.

can any body know, how to retrive an array into select box.

Thanks,
Achyut
 
Greenhorn
Posts: 20
Android Hibernate Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator



this select options will have same key-value .


Only pioneer take the untravelled path.

 
Achyut Behera
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How i am using in my jsp i have written below.
<sLogic:iterate name="interCompanyRent" id="interCompany">
<TR>
<TD align="right"><layout:label>Rem Div:</layout:label></TD>
<TD>
<rem:select property="divisionId" value='"<bean:write name="interCompany" property="divisionId"/>' >
<html:option value="">-- Select Division --</html:option>
<html:options collection="all_division_list" property="id" labelProperty="label" />
</rem:select>
</TD>
<TD align="center"><layout:label>Account No:</layout:label></TD>
<TD>
<INPUT name="accountNo" type="text" size="20" value="<bean:write name="interCompany" property="accountNo"/>"/>
</TD>
</sLogic:iterate>

In the rem:select tag i m using value attribute, but it is not retriving.
Can you please give me the details in the class level what things i have to define .
and how to set into that drop down box.

Thanks in Advance,
Achyut

 
Achyut Behera
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have define in my select tag as per your code.
Is it like this way?
<rem:select property="divisionId" styleId="divisionId">
<sLogic:notEmpty name="interCompanyRent" property="divisionId" >
<bean:define id="id" name="interCompanyRent" property="divisionId" />
<html:option value="">-- Select Division --</html:option>
<html:options collection="all_division_list" property="id" labelProperty="label" />
</sLogic:notEmpty>
</rem:select>

when i am setting this way it showing jsp compiling error
[Servlet Error]-[No getter method for property divisionId of bean interCompanyRent]: javax.servlet.jsp.JspException: No getter method for property divisionId of bean interCompanyRent

<rem:select property="divisionId" styleId="divisionId">
This divisionId is an array in formbean class.
<sLogic:notEmpty name="interCompanyRent" property="divisionId" >
I have store the value in session scope as name interCompanyRent.
And InterCompanyRent is a bean class where i have set the divisionId.

I need to know how i will define the bean class. and how to retrive and set.
Please help. Its urgent.

Thanks in Advance,
Achyut

 
Achyut Behera
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need help.

Can anybody look into this problem.

Thanks,
Achyut
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're not giving much to go on. Post the config of the action that displays the JSP and the code of the action where the bean is put in to scope.
 
Achyut Behera
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the action class i m set the value into the bean class and store into session.

request.setAttribute("interCompanyRent", interComp.getInterCompanyRent());

interComp.getInterCompanyRent() returns list data structure.

here is the bean class.

public class InterCompanyRentChang
{
private Long divisionId;
private String accountNo;
private String amount;
private List interCompanyRent=new ArrayList();

and setter getter methods for each variable.
}

I am iterating in jsp. want to set the value in jsp drop down box.
Is there anything i am missing. Let me know.

Thanks,
Achyut
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic