Group radio button itemrenderers of two different lists
Hello ,
How do I group radio button item-renderers of two different lists? If i select a radio button of list 1, then the list 2 Radiobutton which was selected previously should be un-selected. How to do?
Are you looking for something like this:
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark">
<fx:Declarations>
<fx:Component className="MyRenderer">
<s:ItemRenderer>
<s:RadioButton id="rb" label="{data}" group="{outerDocument.rbg}" width="100%" height="100%" />
</s:ItemRenderer>
</fx:Component>
<s:RadioButtonGroup id="rbg" />
</fx:Declarations>
<s:List id="myList" itemRenderer="MyRenderer">
<s:dataProvider>
<s:ArrayList>
<fx:String>0</fx:String>
<fx:String>1</fx:String>
<fx:String>2</fx:String>
</s:ArrayList>
</s:dataProvider>
</s:List>
<s:List id="myList2" x="150" itemRenderer="MyRenderer">
<s:dataProvider>
<s:ArrayList>
<fx:String>A</fx:String>
<fx:String>B</fx:String>
<fx:String>C</fx:String>
</s:ArrayList>
</s:dataProvider>
</s:List>
</s:Application>
Similar Messages
-
JComboBox display two different lists
I have a JComboBox in a JTable column. The requirement is that the JComboBox displays two different lists based upon which mouse button is clicked on the JComboBox. i.e When user clicks on mouse Button1 the JComboBox should popup with a list of products(user default products). But, when the user clicks on mouse Button2 the JComboBox should popup with a different list of products(all the products).
Any help will be appreciated,
Thanks in advance!UNDEBUGGED, UNTESTED, OFF THE CUFF CODE
public class myEditor extends AbstractCellEditor implements TableCellEditor {
private int sel = 0;
private String[][] str = {{"Option 1", "Option 2", "Option 3"},
{"Select 1", "Select 2", "Select 3"}};
private JComboBox[] fieldCombos = new JComboBox[str.length];
private DefaultCellEditor[] fieldEditors = new DefaultCellEditor[str.length];
public myEditor() {
for (int i=0; i<fieldEditors.length; i++) {
fieldCombos[i] = new JComboBox();
for (int j=0; j<str[0].length; j++) {
fieldCombos.addItem(str[0][j]);
fieldEditors[i] = new DefaultCellEditor(fieldCombos[i]);
public Component getTableCellEditorComponent(JTable table, Object value,
boolean isSelected, int row, int column) {
fieldCombos[sel].setSelectedItem(value);
return fieldEditors[sel];
public void setSelector(int Selector) {
if (Selector>=0 && Selector<str.length) sel=Selector; -
Is it possible to make a fillable form have variable fields - so if you select a radio button it triggers a different form field to be seen depending on which radio button is selected??
Yes, one needs to use some custom JavaScript code to control the other fields' properties.
Disabling (graying-out) Form Fields by Thom Parker -
Can a combobox contain two different list seperated by vdivider ?
Hi,
I need a combobox which contains list item of two types.
These items should be in two different list in a combobox seperated
with vidivider. Is this is possible.
Any one with suggestion or solution can help a lot.
Thanks...hi,
Actually the i have an arrayCollection which which is having
items as some strings, thing is that some strings having numbers at
their end like text2,text5... and some are like text,demo.... these
strings are added in arrayCollection such that the strings with
numbers are at top and then are strings without number.
I want that the combobox should show numbered strings in
first half of list then there should be a
verticalDivider(mx:VDividedBox) and the string without numbers in
second half.
I mean to say a combobox with mx:VDividedBox which is having
two lists. something like this,
<mx:ComboBox width="250" dataProvider="" >
<mx:itemRenderer>
<mx:Component>
<mx:VDividedBox>
<mx:List dataProvider="" labelField="" >
</mx:List>
<mx:List dataProvider="" labelField="" >
</mx:List>
</mx:Component>
</mx:itemRenderer>
</mx:ComboBox>
Here it is some thing like i want but how to provide the
dataprovider to this i don't know.
Is it possible ? any how i need a solution for it...Please
reply if have some solution -
How to Use Switch Statement with Exclusion Group (radio buttons)?
Wouldn't you know, just when I though I'd really be making progress, I've come across another problem I can't solve. In a homeowners insurance application I am building, there is an exclusion group that needs to set the value of several variables
I have setup in the form properties/variables. These variables take on different values depending on the users choice. For the exclusion group, in the object pallet, I have set the binding to normal, and have checked the "Specify Item Values" check box. Also the values for the choices have been assigned 1,2,3,4,5.
Here is my code for the change event fir the exclusion group (This is exactly what I have tried). For now, the values for the variables to take on in the different cases, are completely arbitrary.
switch (this.change.rawValue) // I have tried so many things here
case "1": // I have tried the caption, single quotes in all combinations
addLivingExp = "1";
damageOthersProperty = "2";
liabilityIncl = "3";
maxCoverage = "4";
minCoverage = "5";
persProperty = "6";
relatedPrivateStruct = "7";
break;
case "2":
addLivingExp = "10";
damageOthersProperty = "20";
liabilityIncl = "30";
maxCoverage = "40";
minCoverage = "50";
persProperty = "60"
relatedPrivateStruct = "70";
break;
case "3":
addLivingExp = "100";
damageOthersProperty = "200";
liabilityIncl = "300";
maxCoverage = "400";
minCoverage = "500";
persProperty = "600"
relatedPrivateStruct = "700";
break;
case "4":
addLivingExp = "1000";
damageOthersProperty = "2000";
liabilityIncl = "3000";
maxCoverage = "4000";
minCoverage = "5000";
persProperty = "6000"
relatedPrivateStruct = "7000";
break;
case "5":
addLivingExp = "10000";
damageOthersProperty = "20000";
liabilityIncl = "30000";
maxCoverage = "40000";
minCoverage = "50000";
persProperty = "60000"
relatedPrivateStruct = "70000";
break;
default:
minCoverage= 5;
break;
There must be something obvious I am missing? Eternally grateful for advice on this.
StephenThere are two issues in this script:
1. You are not using the accessor 'value' to set form variables
2. You are not correctly getting the value of the radio button list in the switch clause
Please see the working script below.
Ben Walsh
www.avoka.com
switch (this.rawValue)
case "1":
addLivingExp.value = "1";
damageOthersProperty.value = "2";
liabilityIncl.value = "3";
maxCoverage.value = "4";
minCoverage.value = "5";
persProperty.value = "6";
relatedPrivateStruct.value = "7";
break;
case "2":
addLivingExp.value = "10";
damageOthersProperty.value = "20";
liabilityIncl.value = "30";
maxCoverage.value = "40";
minCoverage.value = "50";
persProperty.value = "60"
relatedPrivateStruct.value = "70";
break;
case "3":
addLivingExp.value = "100";
damageOthersProperty.value = "200";
liabilityIncl.value = "300";
maxCoverage.value = "400";
minCoverage.value = "500";
persProperty.value = "600"
relatedPrivateStruct.value = "700";
break;
case "4":
addLivingExp.value = "1000";
damageOthersProperty.value = "2000";
liabilityIncl.value = "3000";
maxCoverage.value = "4000";
minCoverage.value = "5000";
persProperty.value = "6000"
relatedPrivateStruct.value = "7000";
break;
case "5":
addLivingExp.value = "10000";
damageOthersProperty.value = "20000";
liabilityIncl.value = "30000";
maxCoverage.value = "40000";
minCoverage.value = "50000";
persProperty.value = "60000"
relatedPrivateStruct.value = "70000";
break;
default:
minCoverage.value = 5;
break; -
Grouping Radio Buttons in DataTable
I am looking for code snippet which renders radio button group in datatable. I have the following snippet which has the following problems
1) it displays -1 next to radio button as its the value assign to selectedRowId in backing bean
2) the radio button selection doesnt clear off . i.e. i can select multiple radio buttons at the same time
3) when i select first radion button it correctly displays the index as 0 but for subsequent radio buttons it doesnt show correct index value
Here is the snippet
<a4j:outputPanel >
<h:dataTable id="deviceDetailTable" styleClass="list" rowClasses="odd,even"
value="#{deviceDetailBean.tableRow}" var="vartableRow"
width="80%">
<h:column id="column1">
<h:selectOneRadio id="radio1" value="#{deviceDetailBean.id}">
<a4j:support event="onclick" reRender="selectors" />
<f:selectItem itemValue="#{deviceDetailBean.selectedRowId}" />
</h:selectOneRadio>
</h:column>
<h:column>
<f:facet name="header"><h:outputText value="MAC"/></f:facet>
<h:outputText id="mac" value="#{vartableRow.mac}" />
</h:column>
<h:column>
<f:facet name="header"><h:outputText value="Namespace"/></f:facet>
<h:outputText id="mac" value="#{vartableRow.namespace}" />
</h:column>
<h:column>
<f:facet name="header"><h:outputText value="IP Address"/></f:facet>
<h:outputText id="mac" value="#{vartableRow.ipAddress}" />
</h:column>
<h:column>
<f:facet name="header"><h:outputText value="Host Name"/></f:facet>
<h:outputText id="mac" value="#{vartableRow.hostName}" />
</h:column>
<h:column>
<f:facet name="header"><h:outputText value="Name Type"/></f:facet>
<h:outputText id="mac" value="#{vartableRow.nameType}" />
</h:column>
</h:dataTable>
</a4j:outputPanel>
Here is the snippet in Backing Bean
private Integer id;
private int selectedRowId = -1;
with setter/getter methods
Regards
BansiHello There,
I too am stuck up with the same problem. My HTML document contains two radio buttons which belong to the same group. But when displayed on a Jeditorpane the radio buttons does'nt behave as a part of a group. Both the radio buttons get selected. If you have come across a solution..please help me..
Thanx
Mohamed Zafer -
Grouping radio buttons in JEditorPane
I can't seem to make grouping of radio buttons work for an html page that's loaded into a JEditorPane. The content type is set properly to text/html. Is there a little trick that I'm missing??
Once I select a button that's not part of a previous group, it unselects that previous group anyway!!Hello There,
I too am stuck up with the same problem. My HTML document contains two radio buttons which belong to the same group. But when displayed on a Jeditorpane the radio buttons does'nt behave as a part of a group. Both the radio buttons get selected. If you have come across a solution..please help me..
Thanx
Mohamed Zafer -
Group Radio buttons controlling input fields
Hi All ,
I have 3 radio buttons which is grouped in teh form component . beside the 3 radio buttons i have 3 input fields , now i when i click the first radio button the input field beside the radio button should input enabled , rest of the input fields should be disabled ,
Please share your ideas!!
Thanks,
Pradeep.Harsha ,
This is the code in mu get_def method
APPEND INITIAL LINE TO et_action_definition ASSIGNING <ls_action_definition>.
<ls_action_definition>-id = 'ADDROW'.
<ls_action_definition>-action_type = if_fpm_constants=>gc_action_type-validation_independent.
<ls_action_definition>-imagesrc = '~Icon/AddRow'.
<ls_action_definition>-VISIBLE = CL_WD_UIELEMENT=>E_VISIBLE-VISIBLE.
<ls_action_definition>-enabled = abap_true.
I need the buttons in my list as below
And in List UIBB i have added 2 buttons
in the get def i am getting 2 records for add and del but dont know why i am not getting the buttons on screen .
i have a edit page screen in that i have 2 UIBB , 1st Form UIBB and 2nd LIST UIBB , but when i click the form UIBB its showing as section 1, and the LIST UIBB also in the section1 , i don't think it will be the issue . -
Grouping Radio Buttons on a Dialog Box
Hi,
Sorry to post this, I could not get any doc that could help.
I have three groups of radio buttons in a dialog box and, I set the Group property of each of the first radio button in a group to true. But it does not seem to work. Did I miss something?
Thanks for your help.Found the solution:
I Used 'ADMRadioGroupSuite1' Suite - RadioGroupSuite ("ADM Radio Group Suite") to group them. -
Can someone give me info how to set couple radio buttons as one group? In other word, in UI, only one of them has enable state in the group.
TIA,
MorHi
Have a look for ClusterPanelWidget in the fr file.
Hans -
Create Site Column and add it to two different list as dependent lookup column
I want to create two lookup lists that will have one common column. The common column values will vary depending on the list.
For ex: List A holds Countries (USA) and their Currency code (USD). List B holds States (New York) and their code (NY). The lists are completely independent of each other. I would like to create a common site column named "Code" of type
Text and use it across these two lists. Is it possible?
My solution so far -
a. created the site column (programmatically) which is pretty straight forward.
b. created list definition with two fields (Title and Code).
c. created list instance for Country list. Added data rows in the elements.xml. But not sure how to add Code field as dependent lookup.
If I remove the code field from the elements.xml, the solution deploys successfully creating the Country list with just the Title field. But I need both the fields. Any help is appreciated.
Here is a look at the elements.xml with data rows for Country list instance
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<ListInstance Title="List Instance" OnQuickLaunch="TRUE" TemplateType="10001" Url="Lists/CountryList" Description="Country Values">
<Data>
<Rows>
<Row>
<Field Name="Title">USA</Field>
<Field Name="Code">USD</Field>
</Row>
<Row>
<Field Name="Title">Japan</Field>
<Field Name="Code">Yen</Field>
</Row>
<Row>
<Field Name="Title">Australia</Field>
<Field Name="Code">AUD</Field>
</Row>
</Rows>
</Data>
</ListInstance>
</Elements>Hi,
According to your post, my understanding is that you want to add lookup field to the list in elements.xml.
I recoment you to create lookup column as site column, then bind the lookup column to the contnet type, and then use the contnet type in the list.
For more information, you can refer to:
http://spcodes.blogspot.com/2013/02/create-custom-content-type-with-lookup.html
http://social.msdn.microsoft.com/Forums/office/en-US/d5ec08d5-cfa7-4bbb-9459-78d04674ee59/add-a-lookup-column-in-the-schemaxml?forum=sharepointcustomizationlegacy
http://www.justanothertechnologyguy.com/2013/01/how-to-create-and-connect-lookup-fields.html
Best Regards,
Linda Li
Linda Li
TechNet Community Support -
How to insert data into two different lists in sharepoint 2010
I have a page containing a dropdown list having two departments like IT, HR.
If i select HR, one input form will display for filling HR related info, these i need to store in HR list.
In the same way for other dept through custom coding.
someone help me on thisHello
chiranjeevi avala
I think You can do it using event listener on Item Creation event of your HR List and put your functionality to add elements in IT list over their.
for more info check this link:
http://msdn.microsoft.com/en-us/library/office/ms437502(v=office.14).aspx
http://msdn.microsoft.com/en-us/library/office/gg749858(v=office.14).aspx
***If my post is answer for your query please mark as answer***
***If my answer is helpful please vote*** -
Fetch Data from two different Lists (Based on criteria)
I have two lists. One is for Designations and another is for
Hirings. Designations list holds all available designations and Hiring list has list of hired employees. Data may look like following...
Designations list:
PostTitle
Software Engineer
Web Developer
Graphic Designer
Trainer
Manager
Team Lead
and Hiring list may look like following
Hirings list:
PostTitle
Employee
Start Date End Date
Trainer David
05-Jun-14
Manager Peter
06-Jun-14 30-Jun-14
PostTitle is lookup column in hirings list. Now, I have to create several views over this data... one of them is of "Vacant Posts" that will fetch all those records from Designations which are either not referenced in hirings or are referenced
in hirings but has some end date.
Vacant Posts View:
Fetch all records from Designation which are NOT in Hirings
UNION
Fetch all records from Designations which are in Hirings But has some END DATE.
Please guide me how can I create this Vacant Posts view ? Is their any out of the box functionality available ? what are the easiest possible ways to accomplish this?
Zia.Yes You can Use CAML.
Below Query can be helpful to start with.
Function GetSharePointList1() {
context = SP.ClientContext.get_curre
nt();
oList = context.get_web().get_lists().getByTitle('SharePoint List 2');
var camlQuery = new SP.CamlQuery();
camlQuery.set_viewXml(query);
items = oList.getItems(camlQuery);
context.load(items);
context.executeQueryAsync(
Function.createDelegate(this, onSuccessSharePointList1),
Function.createDelegate(this, onFail)
function onSuccessSharePointList1(){
recNum = items.get_count();
if(recNum != 0){
var listItemEnumerator = items.getEnumerator();
while(listItemEnumerator.moveNext()){
var oListItem = listItemEnumerator.get_current();
$().SPServices({
operation: "GetListItems",
async: false,
listName: "SharePoint List 2",
CAMLViewFields: "<ViewFields><FieldRef Name='Worklocation'/></ViewFields>",
CAMLQuery: "<Query><Where><Eq><FieldRef Name='Title'/><Value Type='Text'>" + ReferenceID +
"</Value></Eq></Where></Query>",
completefunc: function (xData, Status) {
$(xData.responseXML).SPFilterNode("z:row").each(function() {
Worklocation = ($(this).attr("ows_Worklocation"));
s = ..... (display all in table format)
$("#resultTable").append(s);
i++;
Thanks and Regards Rahul Dagar -
Variable drop-down lists according to radio-button input
I need to restrict the display of drop-down lists according to a particular radio-button selection earlier on the form. Can I use a javascript call on the client side without linking to an external database along these lines:
If radiobutton1 == 1
then dropdownlist1 uses list1
elseif radiobutton1 == 2
then dropdownlist1 uses list2
and so forth.
Obviously the syntax is incorrect, but I need to know if it can be done before digging in further.Let's assume we have tree grouped radio buttons in a group of buttons, and a combo box object which displays a different list of elements depending of the chosen option.
A very simple way to do it would be, for example, the following one:
b [*] Radio Button Group - OnClick Event
i // List of elements that will be loaded in the combo box object
> var colorList = new Array("White","Blue","Red","Green");
> var dayList = new Array("Monday","Tuesday","Wednesday","Thursday");
> var tmarkList = new Array("Nike","Adidas","Reebook","Levis");
i // ComboBox Object
> var combo = xfa.resolveNode("Formulario1.ComboBox");
i // Cleaning the combo...
> combo.clearItems();
> combo.addItem("Select one option to the list","");
i // Filling the Combo
i // "this" returns a button group where there are three radio buttons
i // and the "rawValue" returns the selected index chosen in radio
i // buttons.
> switch(this.rawValue)
> {
> case "1":
> for(nJ = 0; nJ < colorList.length; nJ++)
> combo.addItem(colorList[nJ]);
> break;
> case "2":
> for(nJ = 0; nJ < dayList.length; nJ++)
> combo.addItem(dayList[nJ]);
> break;
> case "3":
> for(nJ = 0; nJ < tmarkList.length; nJ++)
> combo.addItem(tmarkList[nJ]);
> break;
>} -
How to handle two radio buttons in modulepool program
hi,
i am creating 2 radio buttons on the initial screen of a modulepool program, here i am unable ot handle those 2 radio buttons.
when executing by default these two radio buttons are selected.
pls send me the sample code that how to handle.Prasad,
In the Screen Painter, highlight both radio buttons at the same time (using CNTL key).
From menu bar, choose: Edit > Grouping > Radio Button Group > Define.
Now they are "linked" to each other.
Don;t forget those points.
Maybe you are looking for
-
Create Background Job after data saved in module
Hello, I have a program that has a start selection screen with material group, you enter your data, execute. When it has finished you get a ALV of sales order with items where you can make changes to dates and other details and save. I would like t
-
I have a file that I havel been adding to for years. I opened it a week ago but today I tried and I got the window message "the required index.xml file is missing" How do I get this to open? I have Pages '09 4.1 Not sure when that was put on or up
-
How can I create multiple selection check boxes in a report row?
Hello, I'd like to know how a multiple selection checkbox can be created in report rows. In brief, I need to create a questionnaire template and each one of the questions will have multple options checkboxes, that means that the user can select more
-
New mac mini? I only got mine 2 months ago
I just bought my mac mini in mid April. does anyone know if I can change it to the new upgraded version? I also have the applecare protection plan if that makes any difference. Thanks
-
Hi I have Predefined message on the sender side and recever side, This is Proxy to SOAP scenarion in PI 7.1, There is a field Called Busness Partener in the Sender side which is defined as Table in the Predined Message on ECC side. This will have mu