« Return to Thread: Grails - J2ee integration

Re: Grails - J2ee integration

by JuliusH :: Rate this Message:

Reply to Author | View in Thread

Hi,

JSP

<tr>
 <td>
  <select onchange="jQuery.ajax({
    url: '/ajax/optfoo',
    data: 'optid=' + this.value,
    cache: false,
    success: function(html) {
    jQuery('#models').html(html);
    }});" >

    <option></option>
    <option value="1">OPT_A</option>
    <option value="2">OPT_B</option>
    <option value="3">OPT_C</option>
  </select>
 </td>
</tr>

<tr>
 <td>
  <label for="model"> &nbsp; Model &nbsp; </label>* &nbsp; : &nbsp;
 </td>
 <td>
  <div id="models">

  </div>
 </td>
</tr>


Grails

def optfoo = {
  def model = optid.findByoptId(params.optid)

  render model ..... // Check Grails Doc for Render as HTML/XML/JSON .....
}


Cheers,

Julius


On 06 Jul , 2009, at 12:18 , Ruchi Singhal wrote:


Hi All,

I wish to do very simple thing -

In one of the divs in a JSP of my existing J2ee application I wish to render
a grails app(ajax based).I  could achieve this by simply using an iFrame,but
I dodnot wish to use it for performance reasons.Is there any other way out


 « Return to Thread: Grails - J2ee integration