开发者

How to send value of textfield using onClickTopics struts2 jquery plugin

开发者 https://www.devze.com 2023-01-10 12:23 出处:网络
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 text

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

0

精彩评论

暂无评论...
验证码 换一张
取 消