This is a forum where members new and old can come to ask questions and get info and opinions. It is not a place to advertise your business or have other forms of advertising, whether it be in your posts or signature.

All links in the forum will not be indexed by Search Engines and any unapproved forms of advertising or spam will be dealt with accordingly, deleted, and that member's account banned.

Forums

Overview » Ajax & JavaScript » How to pass checkbox ststus to java method as parameter
Reply

How to pass checkbox ststus to java method as parameter

Anil Reddy
Member



Since: 23 Feb 2009
Posts: 1
Posted 23 Feb 2009 22:17:08

Hi,

I've one checkbox,I need to capture the status of this checkbox(i.e checked is "true" and unchecked is "false" to the java method as parameter.

Please advise if there is any way i can accomplish this..

I've check box like this
[code> <h:selectBooleanCheckbox id="checkMedia" onclick="toggleDeleteAll()"/> [/code]
Javascript to get the status of check box like this..

 function toggleDeleteAll(){
        if(deleteAll == 'false')
            deleteAll = 'true';
        else
            deleteAll = 'false';
        return  deleteAll;
    }


I need to pass the return value of the javascript to the java method in command link action like this.

<h:commandLink id="delete" action="#{VehicleListingController.delete(VehicleListingController.vehicle,deleteAll)}" value="DELETE">

Please advise me if anybody has inputs..

Thanks,
Anil

Hi,

I've one checkbox,I need to capture the status of this checkbox(i.e checked is "true" and unchecked is "false" to the java method as parameter.

Please advise if there is any way i can accomplish this..

I've check box like this
[code> <h:selectBooleanCheckbox id="checkMedia" onclick="toggleDeleteAll()"/> [/code]
Javascript to get the status of check box like this..

 function toggleDeleteAll(){
        if(deleteAll == 'false')
            deleteAll = 'true';
        else
            deleteAll = 'false';
        return  deleteAll;
    }


I need to pass the return value of the javascript to the java method in command link action like this.

<h:commandLink id="delete" action="#{VehicleListingController.delete(VehicleListingController.vehicle,deleteAll)}" value="DELETE">

Please advise me if anybody has inputs..

Thanks,
Anil

Reply to this topic

Message
Reply
Follow us on Facebook Follow us on twitter Subscribe to the RSS feed
Activate your free membership today | Login | Currency