This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Show the value in select tag

 
Achyut Behera
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • 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
 
Rajul Konkar
Greenhorn
Posts: 20
Android Hibernate Java
  • Mark post as helpful
  • send pies
  • 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
  • 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"/>' >
<htmlption value="">-- Select Division --</htmlption>
<htmlptions 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
  • 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" />
<htmlption value="">-- Select Division --</htmlption>
<htmlptions 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
  • Quote
  • Report post to moderator
I need help.

Can anybody look into this problem.

Thanks,
Achyut
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic