How can I select a state of a Button(as2)? - actionscript-2

One more time i need your help.
I´m working in a project which have many buttons, with textfield inside of them. I need to change the text of those textfields. How can I do it using as2?
Regards

TextFieldNameHere.text = "test";
or
TextFieldNameHere.text = StringVariableNameHere

Related

Can't use RelativeLayout in Kotlin Programmatically

I am new to Kotlin programming. I didn't have any problems in other layouts, but now I need to use relativeLayout. I will create hundreds of buttons and their positions will be relative to each other I have to do this programmatically. I was able to find java examples but I couldn't find many resources in Kotlin because addRule is not here. Can you give me a small example of this?
Thanks in advance.
Thanks for ansver. I solved the addRule problem. now i see only one button at start instead of 1000 button, i think i have problem assigning id. Here is my simple code. i just want programmatically add years at top line between 1000-2000. After that, I will add the beginning and end of an event in 1378 to a bottom line as button. so i can assign dates easily, i chose relativeLayout for this.
val buttonParam = LayoutParams( 100, 100 ) var counter:Int=1000 while (true) { var btnId:Int=counter val myButton = Button(this) myButton.id=btnId buttonParam.addRule(RelativeLayout.RIGHT_OF, btnId-1) myButton.text = btnId.toString() myButton.layoutParams = buttonParam binding.rl.addView(myButton) counter=counter +1 if(counter==2000) break }
Edit: İ solve my problem. the problem is i create 1 buttonParam. Now i am creating parameter for every buttons.

Keyboard shortcuts on Flutter web

I'm adding keyboard shortcuts to a Flutter web application.
I have a form within a custom FocusableActionDetector where the shortcut has form like this:
SingleActivator(LogicalKeyboardKey.digit2)
and action is like:
CustomActivateIntent: CallbackAction<CustomActivateIntent>(
onInvoke: (intent) { provider.value = "2"; },)
In the same form I have a couple of numeric TextFormFields. To permit writing the character "2" I have to put these text fields inside some new FocusableActionDetector, otherwise the previous detector catches the command and the text field loses the "2" character, and this is already quite weird... Moreover, after writing in any of the text fields the form focus detector doesn't work anymore.
I think this could be related to the focus system, which is yet not that clear to me.
Can anyone help find a clean solution?
I found a workaround: the FocusableActionDetector is now preceded by an if statement. The code looks like the following:
// I extract the form to a widget to make it clearer
var searchWidget = SearchWidget();
child: textEditingInProgress
? searchWidget
: FocusableActionDetector(
child: searchWidget,
...,
),
The textEditingInProgress bool is a field in a provider and is controlled by the FocusNodes belonging to the TextControllers.
Still this is not a perfect solution, in particular I'd like to understand why the previous approach was not working.

Make Text Field item as Read Only in APEX 5.0

I have some text field page items on my APEX 5.0 page and I want to make the textboxes as read only/non-editable. During the page load I want to use these text boxes for only the data display on the page and should be non-editable.
Can somebody advice on how to do that? What attributes need to set for this?
This answer is a bit late to the party, but I found myself confronted to this problem and I wanted to share the solution I came up with.
In fact you just need to create your item as a text area, let say P1_Text_Area and you give it a readonly attribute using JavaScript. Write thoses 2 lines in the "Function and Global Variable Declaration" of your page:
var disItem = document.getElementById('P1_Text_Area');
disItem.readOnly = true;
Hope this helps someone in need.
in item properties find the
Read Only group
and set Read Only Condition Type as Always
or the option that suits to you
You can use disabled + save session state ==> read only

Prevent user from selecting the highlighted item by enter key (combobox)

Actually, I'm trying to use a combo-box in Ext.Net to select a value from its selecting list. This combo-box is editable and user can type any value he want.
On selecting list, I want to prevent user from selecting the highlighted item by pressing Enter key and let him just select it by mouse click. for this, i tried to use an listener on bound list "ItemKeyDown" but it did nothing. Other events related to mouse par example, working fine but all events related to key are not working.
I don't know if i have missed something in configurations or what.
Anyone can give me any advise to make theses listeners work?
Thanks in advance,
var combo = Html.X().ComboBox().DisplayField(mark).ValueField(type).Editable(true)
.ID(combo_id).EnableKeyEvents(true).AutoSelect(false).SelectOnFocus(true)
.QueryMode(DataLoadMode.Local).ValidateOnBlur(false).ValidateOnChange(false)
.ListcConfig(Html.X().BoundList()
.Listeners(l => l.ItemKeyDown.Handler = "console.log('ItemKeyDown');")); /// ItemKeyDown not displayed in console.
I post the solution i got from Ext.Net support team so if someone need it in future:
#(Html.X().ComboBox()
.Listeners(events => {
events.Expand.Handler = #"this.listKeyNav.map.removeBinding({
key: Ext.EventObject.ENTER
});";
events.Expand.Delay = 1;
events.Expand.Single = true;
})
)

Sencha Touch 2 Field Focus

Does anyone know the Sencha Touch 2 equivalent of ExtJS4's:
form.getForm().findField("myfield");
Thanks.
use form.getValues(); assuming you can get the form element... if you needs to do that use refs... on my mobile rigjt now, i can post more sample code later if necessary
I use that way:
var field = vorm.down("textfield[name=username]");
Example:
form.down("selectfield[name=username]").setLabel('User');
form.down("selectfield[name=username]").setValue('email#te');
form.down("selectfield[name=username]").setPlaceHolder('email#test.com');