Trouble in combo box
hi all...
i have used combo box in my application where using the action class i have inserted the values into the database. the bean is giving the already stored value and fails to refresh when the combo is changed.
platform - JSF
OS - Windows
Version - 2000
Language J2EE
source code:
declaration in bean:
private String status;
private String reviewStatus;
public javax.faces.model.SelectItem[] getReviewStatus(){
javax.faces.model.SelectItem[] reviewStatus = {
new javax.faces.model.SelectItem(new Integer(1),"Pending"),
new javax.faces.model.SelectItem(new Integer(2),"Pending Reviewed"),
new javax.faces.model.SelectItem(new Integer(3),"Reviewed")
return reviewStatus;
public void setReviewStatus(String String){
reviewStatus=String;
public javax.faces.model.SelectItem[] getStatus(){
javax.faces.model.SelectItem[] status = {
new javax.faces.model.SelectItem(new Integer(1),"Active"),
new javax.faces.model.SelectItem(new Integer(2),"Inactive")
return status;
result:
i dont get error but the value does't get changed in the JSF from but it gets updated in database.
code tags?
Similar Messages
-
Having trouble with combo box in action script 3
I have created a combo box in action script 3.0 and have some things working and others not. I am creating a store for shirts, caps, etc..... so need different things and rates. Can anyone help me?
[email protected]Creating a STORE for my website and used combo buttons with types of shirts for one button, 2nd button with color, and third with sizes.
Using Action Script 3.0 making these work and having trouble.
HELP meaning if you can connect to my computer remotely and see where my problem is. I am happy to pay if works. -
Having trouble with combo box.
What im trying to do is put a string array into this combo box called jComboBoxParts how do i make it show? Right now when i load it, all i see is "Item1..."Item2...etc". Here is my code.
String[] partsString = { "oil can", "windshield", "tires", "v6 Cylinder head", "fuse"};
JComboBox[] jComboBoxParts = new JComboBox[partsString.length];
for(int i=0; i < partsString.length; i++)
jComboBoxParts[i] = new *JComboBox(*partsString);
with the bolded work i get an error. Please help.eva21 wrote:
What im trying to do is put a string array into this combo box called jComboBoxParts how do i make it show? Right now when i load it, all i see is "Item1..."Item2...etc". Here is my code.
String[] partsString = { "oil can", "windshield", "tires", "v6 Cylinder head", "fuse"};
JComboBox[] jComboBoxParts = new JComboBox[partsString.length];
for(int i=0; i < partsString.length; i++)
jComboBoxParts[i] = new *JComboBox(*partsString);
with the bolded work i get an error. Please help.
That's ugly in so many ways...
This:
JComboBox[] jComboBoxParts = new JComboBox[partsString.length];does not do what you think it does. Instead, it creates an array of JComboBoxes initialized to the length of elements in your string array. So instead of a single JComboBox capable of holding 5 elements (which is what you were trying to do), you created 5 JComboBoxes capable of holding n elements.
What you want to do is something like this:
import javax.swing.*;
class Demo extends JFrame {
private JComboBox box;
public Demo() {
initComponents();
private void initComponents() {
String[] items = { "oil can", "windshield", "tires", "v6 cylinder head", "fuse" };
box = new JComboBox(items);
this.getContentPane().add(box);
this.pack();
this.setSize(200, 60);
this.setLocationRelativeTo(null);
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
this.setTitle("Combox Box Demo");
public static void main(String[] argv) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new Demo().setVisible(true);
}Another alternative, if you don't have the array of strings available when you instantiate your JComboBox, you could do something like this:
String items = { "oil can", "brakes", "windshield", "tail light", "something else", "blah", "more blah" };
for( String item : items )
myJComboBox.addItem(item); -
I am using a combo box with the code below, but each time I
arrive on this
screen that displays cbTREATMENT, the combo box first draws
itself with the
default style, then applies my style, which looks a bit ugly
onscreen.
Anything I can do to rectify this?
Thanks.
cbTREATMENT.setStyle( "fontSize", "13" );
cbTREATMENT.setStyle( "color", "0x000000" );
cbTREATMENT.setStyle( "fontWeight", "bold" );
cbTREATMENT.setStyle( "fontFamily", "arial" );
cbTREATMENT.dropdown.rowHeight = 18;
cbTREATMENT.dataProvider=["","name1","name2","name3];
cbTREATMENT.text=vTREATMENT;Thanks for the reply, but I'm not sure what you mean, can you
explain any
further?
"niki tsanov" <[email protected]> wrote in
message
news:fm5qnf$elq$[email protected]..
> Store your combobox only into the library after that try
with
> createClassObject() to make dynamicly ComboBox item into
the stage for me
> work perfect -
VBA Userforms – Getting errors when item from combo box is not selected
Hi there
Thank you in advance for taking the time to check this out.
Objective:
I have 2 combo boxes, one is dependent on what has been selected in the first combo box (dynamic named range), they work fine except for an irritating error when the user accidentally clicks in the empty
Cmbox_IncCategory and it won’t allow the user to go back to the
cmbx_Category_Type box if the user forgot he had to make a selection from that first before selecting the
Cmbox_IncCategory.
The error that pops up is “Invalid property value”.
I tried having text in there to say “please select from Cmbox_IncCategory first, but that didn’t fix it.
I tried to ‘If error resume next’ but that didn’t like it either. Now I am stumped.
Main combo box= cmbx_Category_Type
2nd combo box (displaying a list dependent on what was selected in Main combo box)= Cmbox_IncCategory
I know there must be a way to fix it so that if a user clicks on the combo box, but doesn’t make a selection it won’t lock up the form.
Yes, it is a mandatory field, and I was considering using a message box to advise the user that this must be completed, but I am not sure how to do it (and avoid the errors
Here’s the current code I have for the combo boxes.
Me.Cmbox_IncCategory = "" 'Clears the contents of the 2nd combobox when another category is chosen
On Error Resume Next
'I can't seem to have the Incident Category combobox to be empty when the form is open _
I have tried Cmbox_IncCategory.Value = "", but I get an error. I then tried Cmbox_IncCategory.text = "" _
but also get the error. I don't know how else to get it to work .. I tried both codes in the _
form_initialize, but get an error ... I'm stumped !
Select Case Me.cmbx_Category_Type
Case "Crime"
Me.Cmbox_IncCategory.RowSource = "Inc_Cat_CRIME"
Case "Property Damage - Minor - NS"
Me.Cmbox_IncCategory.RowSource = "Inc_Cat_PROPRTY_NS"
Case "Property Damage - Significant - S"
Me.Cmbox_IncCategory.RowSource = "Inc_Cat_Proprty_S"
Case "Safety"
Me.Cmbox_IncCategory.RowSource = "Inc_Cat_SAFETY"
Case "Security Breach"
Me.Cmbox_IncCategory.RowSource = "Inc_Cat_BREACH_S"
Case "Support"
Me.Cmbox_IncCategory.RowSource = "Inc_Cat_SUPPORT"
Case "Vehicle"
Me.Cmbox_IncCategory.RowSource = "Inc_Cat_VEHICLE_S"
End Select
End Sub
I’d be really grateful if someone could help me out, or perhaps direct me to where I might find some coding that will achieve the result I am seeking.
This links to
My Sample form
With much gratitude,
TheShyButterfly
Hope you have a terrific day, theShyButterflyHi Peter,
Thank you for your quick response :) Brave man! :)
Both combo boxes are blank to start with (because nothing has been selected). If I click on the first combo box (cmbx_Category_Type) which lists the main events/category types, but I don't select any thing, and I click in the secondary box
(Cmbox_IncCategory) and then click on any other control, I get an “Invalid property value” error. When I click OK on the error (a few times) and I return to the code window, it gives no indication where/what is breaking
the code/causing the error. I have no choice but to exit the form by stopping in the code window.
If I click on the first textbox, (cmbx_Category_Type), and then do the right thing and make a selection, then I have no problems with the secondary textbox (Cmbox_IncCategory).
As I am not that up on VBA I am trying to follow your instructions... I have changed the code as follows, removed and replaced the rowsource name, but I encounter the very same problem.
When I changed my code from Me.Cmbox_IncCategory="" to yours myCombo.ListIndex = -1 (changing the combo box name to reflect my combo box name) and adding the second line of code ...
Me.Cmbox_IncCategory.ListIndex = 0 I still got the same behaviour and error.
I even tried moving each row of the named rows down one row (so that there would be a 'blank' row which could be selected to get out of trouble, but it wasn't very successful either.
Have you opened my form to see what happens, I included the link so whoever was looking at my problem (and yes, I have many I know), could see for themselves what it is doing/not doing.
The code now reads as below (is this what you meant?) - the results were as I mentioned above.
Me.Cmbox_IncCategory.ListIndex = -1 'Clears the contents of the 2nd combobox when another category is chosen
Me.Cmbox_IncCategory.ListIndex = 0
' On Error Resume Next
'I can't seem to have the Incident Category combobox to be empty when the form is open _
I have tried Cmbox_IncCategory.Value = "", but I get an error. I then tried Cmbox_IncCategory.text = "" _
but also get the error. I don't know how else to get it to work .. I tried both codes in the _
form_initialize, but get an error ... I'm stumped !
Select Case Me.cmbx_Category_Type
Case "Crime"
Me.Cmbox_IncCategory.RowSource = "Inc_Cat_CRIME"
Case "Property Damage - Minor - NS"
Me.Cmbox_IncCategory.RowSource = "Inc_Cat_PROPRTY_NS"
Case "Property Damage - Significant - S"
Me.Cmbox_IncCategory.RowSource = "Inc_Cat_Proprty_S"
Case "Safety"
Me.Cmbox_IncCategory.RowSource = "Inc_Cat_SAFETY"
Case "Security Breach"
Me.Cmbox_IncCategory.RowSource = "Inc_Cat_BREACH_S"
Case "Support"
Me.Cmbox_IncCategory.RowSource = "Inc_Cat_SUPPORT"
Case "Vehicle"
Me.Cmbox_IncCategory.RowSource = "Inc_Cat_VEHICLE_S"
End Select
End Sub
I appreciate your patience :) I am growing in knowledge, but its a slow process. Please let me know if there is anything else I can help clarify for you :)
This links to
My Sample form
Thanking you again
TheShyButterfly
Hope you have a terrific day, theShyButterfly -
Hello,
I need some help with something that I am having trouble wrapping my head around. I am in the midst of creating some forms for our office that were originally MS Word files that have since been converted to PDF's. On these forms (which are now compiled into one PDF) there is a field for a name and one fore a licence number. What I would like to do (if possible) is have a drop down combo box with the pilots name. Once the name has been selected, it automatically populates the pilots name and licence number on the subsequent forms.
Is this possible and if so, does someone have a tutorial on how to do this? I have not had much luck looking online but thought perhaps someone on here may have tired something similar before.
Thanks.
ChrisYes it's possible. For some help, check out: http://www.acrobatusers.com/tutorials/2007/js_list_combo_livecycle/
There is a part 2 to this article that may help as well.
George -
Combo box retaining selected value?
Hi,
I have a requirement to display a value based on a selection in a combo box. This is a training company and we wish to view the number of people booked onto a selected course.
I am using a web service to bring the data into Xcelsius in two columns - 'Course' and 'no of people'.
I can get the combo box to read the list of courses, but when the data from the web service refreshes, the combo box reverts back to the default selection.
Is there any way to avoid this? I have just downloaded Xcelsius SP1, in case that's relevant.
Thanks,
NeilHi there Neil,
Any progress since the last post? There really shouldn't be a reset of the component state based on the input of data to the Excel sheet. I don't have any WS with multiple row/column output, so I'm having difficulty testing that scenario. I've tried with QaaWS, which should be roughly the same in that regard; with a QaaWS I'm having no troubles.
Outside chance: Do you have Behavior > Common > Selected Item bound to one of the WS output cells? That might reset the component state.
Another idea: Use a Trigger Cell or Connection Refresh Button instead of Refresh Every, if it really is a bug. This will prevent the connection from refreshing and resetting your component. It sounds like your WS doesn't have Input Value filtering and isn't volatile data, so Refresh Every is unnecessary for your usage. A Trigger Cell or Connection Refresh button will refresh the WS just once, for the initial access.
Source Data: It's found in the properties sheet under General > Data Insertion > Insertion Type > Source Data.
<br>
Javier -
Bugging Array by using COMBO BOX component !!!
Hi,
Today, I create a flash with Array. I did use prototype
method to add one more fantastic function to sort the array
randomly. But when I include one combo box component with static
value in to the parent file, I have a big trouble. The flash file
stop running & give the alert of endless looping. Ah ha, what a
funny thing is happened out there?
If you want to produce this bug, please follow me.
Step1: Create 1 flash movie & name it "test.fla". Copy
the code below into the first frame.
Array.prototype.randomSort = function():Array {
var arr1:Array = this;
var arr2:Array = new Array();
var rand:Number;
while (arr1.length>0) {
trace(arr1.length);
rand = Math.floor(Math.random()*arr1.length);
if (rand == 1 && arr1.length == 1) {
rand = 0;
arr2.push(arr1[rand]);
arr1.splice(rand, 1);
return arr2;
Step2: Export the movie by Ctrl+Enter -> we will have
test.swf huh?
Step3: Create another flash & name it "main.fla".
Step4: In main.fla, create an empty movieclip symbol &
name it loader_mc. Drag it to the stage & five the instance
name "XXXloader_mc" for example.
Step5: In main.fla, Drag one combo box component to the stage
& add some data to the combo
Step6: In the first frame of main.fla, load the test movie
into XXXloader_mc. Try this
XXXloader_mc.loadMovie("test.swf");
Step7: Export main.fla. Ctrl+Enter again.
Congratulation, you are in the problem.both together caused the problem and i don't see a problem
with your randomSort() method although destroying the original
array seems like a bad idea and is one of the 2 reasons for your
problem:
one, the combobox is executing your method (and every other
array prototype method that exists) every time it's clicked. that
looks like a bug in the combobox component.
and two, your prototype is causing a problem because it
destroys the arrays that call your method. -
Use Combo Boxes and Datepart "m" and "y" to filter forms and reports
I am trying to build a Form to filter through Sales Order Records going back up to four years to find purchasing patterns of customers and to find more potential sales. I am using a simple main form, with 2 subforms joined on the Sales Representative
[accntrep], one which show current orders for a given month and the other orders from past months and years. I've got 3 combo boxes, 1 to select sales representative, 1 to select a month using date part and 1 to select a month. This would be very
flexible in easily searching any month in any year of the recordset. I know I will be using something like "DatePart("m",[Date])=2 And Year([Date])=Year(Date())-4" (Feb 2011) to filter my records, but I am having troubling writing
the procedure just right. I am using 2-column combo boxes 1 column for text i.e (April, May, June etc.) and a second for the Date Part Expression. I think I need to concatenate the values into the filter, but I cannot come up with exactly how to
get this done. Any ideas??
Thanks,
jsIf there is any doubt in your mind then I will suggest a sanity debug trick; temporarily add 2 textboxes
in T1 put its control source: =ComboBoxNameMonth
in T2 put its control source: =ComboBoxNameYear
don't put what I typed - put in their actual control names for those 2 comboboxes
this way you can see what is actually the value of those combo boxes... depending on what they are bound to - those values may not be what you are expecting them to be.....obviously alter the properties of the comboboxes until they have the values they should
Am a little unclear on filtering your records in regard to how the data is not structured whether for example: Nov 2015 is in 2 separate fields or a single field like 11/2015 or what - not sure it is a true date field or possibly a text field...so
the next part of this depends on the data structure. -
Help with linking combo boxes so that some options are made unavailable
Hello!
I'm having trouble setting up an interactive PDF form with multiple combo boxes.
I have designed an interactive PDF form in InDesign CS6 but am doing the final preparation and formatting in Adobe Acrobat XI Pro.
First of all, I am not sure if I should be using combo boxes or list boxes, but the combo box seemd to look better after I export the PDF and also left the field blank, ready for selection from the drop-down menu.
Basically I have a list of drop-down lists, but not all combinations are compatible. For example, after maing "Selection 1" in "Combo box 1", I need only "Selection 1", "2", and "3" [out of the total 5] to be available in "Combo box 2".
I need to be able to apply this algorhythm to the next few combo boxes as well.
Moreover, I would need some of the checkboxes disabled [the user won't be able to check them at all]when I make a certain selection in some of the combo boxes.
Needless to say, I don't know any Java, coding or making calculations in LiveCycle Designer, so I don't even know where to begin.
I have attached a screen grab of my form and what I want to achieve.
Any help would be very much appreciated.
Thank you!If it is static data, I would suggest you to cache it rather than having it in each of the user session. You can have configuration/code to refresh when needed. Please look at any available caching frameworks (EhCache, OSCache etc...)
-
Embedded Fonts a Combo Box and complete madness
I have a combo box that has an array of fonts loaded into
them, not here is my problem. For some reason, when i select the
fonts in the array, some of them change and some of them dont. I
have created font symbols like instructed in the live docs, but i
dont get why they arent showing up..
i.e. I have 7 fonts loaded into this combo box and i can
select Arial Bold and my text field will show the text in arial
bold, but when i select hobo, i get some substitute!
here's my code, maybe you guys will see something i
haven't.. the fonts in particular i am having trouble with: Bookman
Old Style, BrushScript and Hobo.there are many points/issues here. here are some:
1. Your array called fonts contains eight strings such as
'new Arial()', whereas i think what you were trying to achieve here
is to create references to the fonts in the library. to do this
remove the quotation marks.
2. To be able to create references to the fonts in the
library, ensure that the font symbols in the library contain class
names, with base classes of flash.text.Font. do this by selecting
'Linkage' on your library fonts.
3. Ensure that your text field is set to embed fonts - either
in authoring, or with actionscript
eg.outputTB1.embedFonts=true;
4. you set up fonts_array with eight font names and then in
your for loop, you again add eight fonts to this array. this is
redundant.
5. in the for loop you have the line: fonts_array.push(new
String(fonts[ i]));
this appears to be an attempt at converting a reference to a
font into a font name. this isn't going to work. if you had set up
references to fonts to begin with (see point 1), and this line
wasn't redundant (see point 4), you would extract the font name
like so: fonts_array.push(fonts[ i].fontName)
6. maintaining two arrays of fonts is unecessary. i would
recommend just maintain your fonts array with references to fonts,
and extract font names from these references. this would look
something like the code attached below.
7. One last thing - i notice that you have at least two of
your fonts - arial and arial bold, probably have different
formatting. if some are bold and some are not, you will need to
specify the bold property also. eg. font.bold=true -
How to populate data in the data table on combo box change event
hi
i am deepak .
i am very new to JSF.
my problem is i want to populate data in the datatable on the combo box change event.
for example ---
combo box has name of the city. when i will select a city
the details of the city should populate in the datatable. and if i will select another city then the datatable should change accordingly..
its urgent
reply as soon as possible
thanks in advancei am using Rational Application Developer to develop my application.
i am using a combo box and i am assigning cityName from the SDO.
and i am declaring a variable in the pageCode eg.
private String cityName;
public void setCityName(String cityName){
this.cityName = cityName;
public String getCityName(){
return cityName;
<h:selectOneMenu id="menu1" styleClass="selectOneMenu" value="#{pc_Test1.loginID}" valueChangeListener="#{pc_Test1.handleMenu1ValueChange}">
<f:selectItems
value="#{selectitems.pc_Test1.usercombo.LOGINID.LOGINID.toArray}" />
</h:selectOneMenu>
<hx:behavior event="onchange" target="menu1" behaviorAction="get"
targetAction="box1"></hx:behavior>
and also i am declaring a requestParam type variable named city;
and at the onChangeEvent i am writing the code
public void handleMenu1ValueChange(ValueChangeEvent valueChangedEvent) {
FacesContext context = FacesContext.getCurrentInstance();
Map requestScope = ext.getApplication().createValueBinding("#{requestScope}").getValue(context);
requestScope.put("login",(String)valueChangedEvent.getNewValue());
and also i am creating another SDO which is used to populate data in datatable and in this SDO in the where clause i am using that requestParam .
it is assigning value in the pageCode variable and in the requestParam but it is not populating the dataTable. i don't no why??
it is possible that i may not clear at this point.
please send me the way how my problem can be solved.
thanks in advance -
I am developing a desktop application in Wpf using MVVM and Entity Frameworks. I have the following tables:
1. Party (PartyId, Name)
2. Case (CaseId, CaseNo)
3. Petitioner (CaseId, PartyId) ............. Link Table
I am completely new to .Net and to begin with I download Microsoft's sample application and
following the pattern I have been successful in creating several tabs. The problem started only when I wanted to implement many-to-many relationship. The sample application has not covered the scenario where there can be a any-to-many relationship. However
with the help of MSDN forum I came to know about a link table and managed to solve entity framework issues pertaining to many-to-many relationship. Here is the screenshot of my application to show you what I have achieved so far.
And now the problem I want the forum to address is how to bind a combo box so that it retrieves Party.Name for the corresponding PartyId in the Link Table and also I want to populate it with Party.Name so that
users can choose one from the dropdown list to add or edit the petitioner.Hello Barry,
Thanks a lot for responding to my query. As I am completely new to .Net and following the pattern of Microsoft's Employee Tracker sample it seems difficult to clearly understand the concept and implement it in a scenario which is different than what is in
the sample available at the link you supplied.
To get the idea of the thing here is my code behind of a view vBoxPetitioner:
<UserControl x:Class="CCIS.View.Case.vBoxPetitioner"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:v="clr-namespace:CCIS.View.Case"
xmlns:vm="clr-namespace:CCIS.ViewModel.Case"
mc:Ignorable="d"
d:DesignWidth="300"
d:DesignHeight="200">
<UserControl.Resources>
<DataTemplate DataType="{x:Type vm:vmPetitioner}">
<v:vPetitioner Margin="0,2,0,0" />
</DataTemplate>
</UserControl.Resources>
<Grid>
<HeaderedContentControl>
<HeaderedContentControl.Header>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<TextBlock Margin="2">
<Hyperlink Command="{Binding Path=AddPetitionerCommand}">Add Petitioner</Hyperlink>
| <Hyperlink Command="{Binding Path=DeletePetitionerCommand}">Delete</Hyperlink>
</TextBlock>
</StackPanel>
</HeaderedContentControl.Header>
<ListBox BorderThickness="0" SelectedItem="{Binding Path=CurrentPetitioner, Mode=TwoWay}" ItemsSource="{Binding Path=tblParties}" />
</HeaderedContentControl>
</Grid>
</UserControl>
This part is working fine as it loads another view that is vPetioner perfectly in the manner I want it to be.
Here is the code of vmPetitioner, a ViewModel:
Imports Microsoft.VisualBasic
Imports System.Collections.ObjectModel
Imports System
Imports CCIS.Model.Party
Namespace CCIS.ViewModel.Case
''' <summary>
''' ViewModel of an individual Email
''' </summary>
Public Class vmPetitioner
Inherits vmParty
''' <summary>
''' The Email object backing this ViewModel
''' </summary>
Private petitioner As tblParty
''' <summary>
''' Initializes a new instance of the EmailViewModel class.
''' </summary>
''' <param name="detail">The underlying Email this ViewModel is to be based on</param>
Public Sub New(ByVal detail As tblParty)
If detail Is Nothing Then
Throw New ArgumentNullException("detail")
End If
Me.petitioner = detail
End Sub
''' <summary>
''' Gets the underlying Email this ViewModel is based on
''' </summary>
Public Overrides ReadOnly Property Model() As tblParty
Get
Return Me.petitioner
End Get
End Property
''' <summary>
''' Gets or sets the actual email address
''' </summary>
Public Property fldPartyId() As String
Get
Return Me.petitioner.fldPartyId
End Get
Set(ByVal value As String)
Me.petitioner.fldPartyId = value
Me.OnPropertyChanged("fldPartyId")
End Set
End Property
End Class
End Namespace
And below is the ViewMode vmParty which vmPetitioner Inherits:
Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports CCIS.Model.Case
Imports CCIS.Model.Party
Imports CCIS.ViewModel.Helpers
Namespace CCIS.ViewModel.Case
''' <summary>
''' Common functionality for ViewModels of an individual ContactDetail
''' </summary>
Public MustInherit Class vmParty
Inherits ViewModelBase
''' <summary>
''' Gets the underlying ContactDetail this ViewModel is based on
''' </summary>
Public MustOverride ReadOnly Property Model() As tblParty
'''' <summary>
'''' Gets the underlying ContactDetail this ViewModel is based on
'''' </summary>
'Public MustOverride ReadOnly Property Model() As tblAdvocate
''' <summary>
''' Gets or sets the name of this department
''' </summary>
Public Property fldName() As String
Get
Return Me.Model.fldName
End Get
Set(ByVal value As String)
Me.Model.fldName = value
Me.OnPropertyChanged("fldName")
End Set
End Property
''' <summary>
''' Constructs a view model to represent the supplied ContactDetail
''' </summary>
''' <param name="detail">The detail to build a ViewModel for</param>
''' <returns>The constructed ViewModel, null if one can't be built</returns>
Public Shared Function BuildViewModel(ByVal detail As tblParty) As vmParty
If detail Is Nothing Then
Throw New ArgumentNullException("detail")
End If
Dim e As tblParty = TryCast(detail, tblParty)
If e IsNot Nothing Then
Return New vmPetitioner(e)
End If
Return Nothing
End Function
End Class
End Namespace
And final the code behind of the view vPetitioner:
<UserControl x:Class="CCIS.View.Case.vPetitioner"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:vm="clr-namespace:CCIS.ViewModel.Case"
mc:Ignorable="d"
Width="300">
<UserControl.Resources>
<ResourceDictionary Source=".\CompactFormStyles.xaml" />
</UserControl.Resources>
<Grid>
<Border Style="{StaticResource DetailBorder}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="Petitioner:" />
<ComboBox Grid.Column="1" Width="240" SelectedValuePath="." SelectedItem="{Binding Path=tblParty}" ItemsSource="{Binding Path=PetitionerLookup}" DisplayMemberPath="fldName" />
</Grid>
</Border>
</Grid>
</UserControl>
The problem, presumably, seems to be is that the binding path "PetitionerLookup" of the ItemSource of the Combo box in the view vPetitioner exists in a different ViewModel vmCase which serves as an ObservableCollection for MainViewModel. Therefore,
what I need to Know is how to route the binding path if it exists in a different ViewModel?
Sir, I look forward to your early reply bringing a workable solution to the problem I face.
Warm Regards,
Arun -
Not able to populate data in the combo box
Hi Guys,
I m new to flex development and I want to populate the data
coming from the databasein the combobox.I am able to get the length
.but not able to populate the data.
Can anyone helpme out?
The code is below:
The data displayed in the combox box is displayed as
[object],[object] etc.I m sure that the data is coming from the
database and its not populated in the combo box.any help is
appreciated.
private function getParkinfo(event:ResultEvent):void
{ Alert.show(event.result.length.toString());
countries.dataProvider = event.result;
<mx:ComboBox id="countries" />What does the data look like in the result? Is it XML? Post a
sample of it. -
Display data in list and combo box
hi all....
how to display data from database in list and combo box? i use MYSQL...
help me please..... tq...1 - Write a query to retrieve the data you want from database
2 - In a servlet, connect to database, Run the query, scroll through the result set and put the data into a list of Java Objects.
3 - Set a request/session attribute of that list of objects
4 - Forward to JSP
5 - In JSP, create a <select> box, and then use a <c:forEach> loop to generate <option> tags from the list.
Maybe you are looking for
-
Interactive Report - Is it possible?
Hi again, I wondered if it possible in SQL Server Reporting Services 2008 R2, to create a report which an end user can input Comments into. The comments would be free text and wouldn't for part of the Views/Table where the Datasource comes from. This
-
Scanner/Fax That Works?
Anyone want to suggest a laser scanner/fax machine/printer (all in one) that works in 10.6 - one that simply 1) will scan from a document feeder so that multi-pages can be made/saved into one PDF on any computer on the network and sent to clients (ab
-
In finder, the HELP window doesn't show up.
help please... i'm trying to find some answers from the finder help.. so i type some keyword and so there are some topics showing under the help so i click the topic i wanna c. but.... when i click nothing happening... now new help window shown,,, so
-
E-mail forward / reply glitch
When I reply to an e-mail using my Pre, the text of the e-mail string below is all bunched up together and changed to times new roman. It's so bad that you cannot distinguish one email from the next in the string of the reply. I also have a problem
-
ALTERNATE COLOR SCHEME TRICK FOR MAC'S
Hey all. Just want to share a quick little trick I just found on my computer...Press Control, Option, Command (Apple button) and 8 on your keyboard. This will switch the color scheme on your monitor to negative color - all colors are now reversed - w