How to get values of controls inside ModalPopupExtender? - modalpopupextender

Hi I have a control with lots of textboxes and repeater inside a ModalPopupExtender how do i get those controls values?

An example would be something like this:
((TextBox)SomePopupExtender.FindControl("SomeTextBox")).Text = "New Text";

Related

save data to popupmenu

I have a popup-menu that has an option, add own material, and when this is chosen, a pushbutton is enabled that say SAVE. I alose have a bunch of edit-boxes.
What I want to do is to make a callback so whenever I click the SAVE, the data from one of the textboxes will possible to select in the popupmenu. when this is selected, I want to set the other edit-boxes to contain the same data that they did when I clicked the save button.
Thanks in advance
I'm not quite sure to fully understand what you want, but you can use the handle of the popup menu to get the string/string array in contains at the time you press the pushbutton. Then you can put those inside the textboxes using their handles as well.
For instance:
MyStrings = get(handlesToYourPopupMenu,'String');
or
MyStringsArray = cellstr(get(handlesToYourPopupMenu,'String'));
which contains the content of the popup menu as a cell array.
and
set(handlesToYourEditBox,'String',MyString);
Is that what you mean? If not please ask :)
EDIT:
To add the new data to the existing content of your text box, use concatenation. Since the content is in a cell array, you can do the following:
NewString = [OldString {CurrentString}];
where CurrentString is obtained with
get(hanlesToYourEditBox,'String');
Therefore to update the content of the popup menu you could write this:
set(handlesToPopUpMenu,'String',[MyStringsArray {get(hanlesToYourEditBox,'String')}]):

Select jQuery UI Button by Label or $.Data

My buttons are input type=button, id field set, and no text in between the tags since it appears to the right of my buttons rather than inside. (sorry, won't let me publish the html for some reason).
I .button() them and set their label. All works as expected, but I can't select them by :contains().
How do you select jQuery UI buttons by their labels?
Thanks in advance!
Edit
I don't select by id because the text of the button changes based upon a variable in my db. Is there a way to select by .data?
You should create a button and look how jQuery creates it. When you look at the example in the documentation you see that .button() creates a span element in the button element that contains the label. So you can query on this inner span element which has a class of ui-button-text.
But I think that you should overthink your code and rework it so that you can select on the ID since they are made to identify things.
Edit: Then go for the first advice
var buttons = $('button').filter(function (index) {
$('.ui-button-text:contains("' + your_string + '")', this).length > 0
});

Smart GWT how to select item in ComboBoxItem

I have what seems like it should be a really simple problem, but somehow it is not. SmartGwt has a way of taking something easy and making it overly complicated!
I have a ComboBoxItem populated by a LinkedHashMap. All I want to do is to be able to programmatically select a row/value to display. In plain GWT, this would be something like:
listBox.setSelected(1)
I have searched and searched, and I have come up empty. Please someone help!!!
Suppose your map has values like
items.put(1,"a");
items.put(2,"b");
ComboBoxItem listBox = new ComboBoxItem();
listBox.setValueMap(items);
Then
listBox.setValue(1) will display "a" in listBox
listBox.setvalue(2) will display "b" in listBox
You Can set value's for drop down in Combobox item through setValuMap(String array[])
String []valueMap = {"A","B"};
comboBoxItem.setValueMap(valueMap);
this will set the value in string array to combox box. You can set value programmatically through setValue(String value) function.
comboBoxItem.setValue("A");
http://www.smartclient.com/smartgwt/javadoc/com/smartgwt/client/widgets/form/fields/ComboBoxItem.html

Dashcode - how to register and use my own filterPredicate procedurally

In my Dashcode mobile app I have a listView that is bound to a datasource. By default it shows everything in the datasource. If I add a search field the user may limit the list to just the records that match their search text.
I want to create my own preset searches attached to buttons that would be able to load a list view and show only the records from my datasource that match my custom search.
It seems like this ought to be possible, but so far I haven't figured out how to register my own filterPredicate and then use it.
I'm guessing this is what I want to do because it seems like this is what the search field part does.
Has anyone figured out how to do this?
Any help would be appreciated
According to the dashcode starter section, you could use something along the lines of:
itemDescription = Class.create(DC.ValueTransformer, {
transformedValue: function(value){
return "Page: " + value;
}
});

GWT TextBox widget

I have a well populated Object which has properties like color,size,weight etc.
I need to get these object properties and place them in a TextBox.
So i want to do something like
`textBox.getLine1.setText(Object.getColor());
textBox.getLine2.setText(Object.getWeight());`
That is i need a textBox in which i can edit individual lines.
I am planning to have a widget which has a FlexTable inside the TextBox but i am not sure how to work on it.
Can someone please help me on this?
Thanks
Probably you're looking for the RichTextArea widget
You can check the documentation here: RichTextArea
And an old, but nice tutorial here: Tutorial
I did something similar: I needed to let user select one or several text rows and let each row be clickable to perform an action.
So I used a VerticalPanel with Labels.
VerticalPanel labelPanel = new VerticalPanel();
For a given index Label:
Label selectedLabel = (Label) labelPanel.getWidget(index);
DOM.setElementAttribute(selectedLabel.getElement(), "id", "label-selected");
CSS code as you wish!
If you must use a TextArea, which is a standard <input type="text"> element, you would have to find line breaks and create a Selection, and then replace it with whatever you want. You could also read the entire text, change it, and then update the entire TextArea value again.
I would recommend splitting your widget into multiple single line TextBoxes.