Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-05-2008, 02:52 AM
Member
 
Join Date: Apr 2008
Posts: 2
vivekbakshi is on a distinguished road
How to use "selectOneRadio" to enable/disable a Picklist
Hi,

I m having a requirement to enable/disable two picklists using "<h:selectOneRadio>".
Kindly reply if anyone has done similar thing before or if any one can provide any suggestions on how to acheive this?

Thanks in Advance!
Vivek
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-07-2008, 04:14 PM
Member
 
Join Date: Apr 2008
Posts: 2
vivekbakshi is on a distinguished road
Finally,

I found a way to get this done... I managed to get this work using JavaScript. Look for the code below.

<script type="text/javascript">

function enablePickList(form,radio,picklist1,picklist2)
{
var radio = document.formsformform+\":\"+radio[0].checked;
if(radio)
{
document.getElementById(form+":"+picklist1).disabl ed = false;
document.getElementById(form+":"+picklist2).disabl ed = true;
}
else
if(!radio)
{
document.getElementById(form+":"+picklist1).disabl ed = true;
document.getElementById(form+":"+picklist2).disabl ed = false;
}
}
</script>

<h:selectOneRadio id="myRadio1"
value="#{GLAccountDimension.enablePicklist}" onclick="enablePickList ('glaccountinsert','myRadio1','AccountLevelList1', 'AccountLevelList2');">

<j:selectItem itemValue="true" itemLabel="Select">
<h:selectOneMenu id="AccountLevelList1"
value="#{GLAccountDimension.glAccountLevel1}"
immediate="true" disabled="true">
<j:selectItems value="#{GLAccountDimension.glAccountLevel1List}" />
</h:selectOneMenu>
</j:selectItem>

<j:selectItem itemValue="false" itemLabel="Select">
<h:selectOneMenu id="AccountLevelList2"
value="#{GLAccountDimension.glAccountLevel2}"
immediate="true" disabled="true">
<j:selectItems value="#{GLAccountDimension.glAccountLevel2List}" />
</h:selectOneMenu>
</j:selectItem>
</h:selectOneRadio>
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
failure at Class.forName("oracle.jdbc.driver.OracleDriver"); RonNYC Eclipse 1 03-14-2008 03:51 PM
Hwlp with "Open", "Save", "Save as..." trill New To Java 1 07-31-2007 08:53 AM
Exception in thread "main" java.net.ConnectException: Connection timed out osval Advanced Java 1 07-27-2007 11:59 PM
Error: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException romina New To Java 1 07-25-2007 11:55 PM
ArrayList: Exception in thread "main" java.lang.NullPointerException susan New To Java 1 07-16-2007 07:32 AM


All times are GMT +3. The time now is 09:21 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org