Results 1 to 2 of 2
  1. #1
    Chinnu55 is offline Member
    Join Date
    Apr 2011
    Rep Power

    Default To pass bean property values to a javascript function and generate dojo datagrid.


    I want to create dojo datagrid, for that I need to pass column information to dojo datagrid.

    I have a jsp page which gets the column data in a arraylist which contains the bean objects.

    i.e. List filterImages contains --> bean1 - [name1, age1, hiredate1]
    bean2 - [name2, age2, hiredate2]
    bean3 - [name3, age3, hiredate3]

    I am currently using <login:iterate>

    Java Code:
    <logic:iterate id="image" name="<%=USER_KEY%>"
    		property="filterImages">  [B]// filterImage is a list[/B]
             <bean:define id="filterId" name="image" property="filterId"/>
    	<bean:define id="name" name="image" property="name" type="java.lang.String" />
    	<script language="JavaScript" type="text/javascript">
    		    [B]getTableInformation[/B](name, "<bean:write name="image" property="createTime"
     format="dd MMM yyyy HH:mm:ss" locale="true"/>", 
    "<bean:write name="image" property="lastEditTime" format="dd MMM yyyy HH:mm:ss" locale="true"/>");
    getTableInformation(..) is javascript function. - which provides the column data to dojo datagrid.

    I know my approach is not correct, but couldn't find any thing helpful.

    My goal is to pass bean property values like "name", "createTime" and "lastEditTime" to a javascript fucntion and generate datagrid table.

    Please let me know what is the better approach.


  2. #2
    unaTRASotra is offline Member
    Join Date
    Nov 2011
    Rep Power

    Default Re: To pass bean property values to a javascript function and generate dojo datagrid.

    you have to use expression language to pass the values to javascript function:

    getTableInformation(${}, ${bean.createTime}, ${bean.lastEditTime})

    (use expression language to reach whereever you stored these data)

Similar Threads

  1. How to pass a javascript function into APPLET PARAM
    By Ambergahill in forum Java Applets
    Replies: 0
    Last Post: 11-28-2010, 04:57 PM
  2. How to set the property of Bean by constructor injection
    By Java Tip in forum Spring Framework
    Replies: 1
    Last Post: 05-05-2008, 09:01 AM
  3. Struts Form Bean with property
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-27-2007, 10:10 AM
  4. property of a java bean
    By suloverboy in forum New To Java
    Replies: 3
    Last Post: 12-14-2007, 09:31 PM
  5. Cannot pass the correct property value to a form
    By piterskiy74 in forum Web Frameworks
    Replies: 0
    Last Post: 12-11-2007, 03:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts