views:

198

answers:

0

Hi all, I'd like to send my textfield value when onClickTopics of one button. This button will reload the data from Jquery grid, but before reloading back bean of struts needs to compare few values from textfield.

This is my button tag:

<sj:a button="true" onClickTopics="submitSuccess" indicator="indicator" targets="result">Tampilkan</sj:a>

this is my textfield :

<sj:textfield id="namaDistributor" name="namaDistributor" label="Nama Distributor"/>

when onclick, it'll reload grid, but how to pass namaDistributor value to backbean from below script.

$.subscribe('submitSuccess', function(event,element) {
 alert(element);
 $("#gridtable").trigger("reloadGrid");
});

Edited : I tried another alternative for passing new value of GridTable but it doesn't display updatable values too.

when I clicked grid, it'll go to grid action with data passed from form :

$('#search').click(function(){
    // Make the ajax request
        $.ajax({
            data : "idDistributor=JKT005",
            url: 'DataPenjualanPerDistributor.find.action',
            dataType: "json",
            success: function(data) {
                alert('Grid :'+data.gridtable);
                // Set the input value from the returned string            
                $('#gridtable').val(data.gridtable);
            }
        });
});

Really thanks

Mr.K