How to set the edit text disabled from other class - android-studio

How to set the edit text of other activity to be disabled when i click specific button.
because i have 2 buttons, which will eventually go to same layout. But I want when i click the 1st button, the edit text will be disabled/read only while if I clicked the 2nd button the edit text will be enabled.

NOTE:
The thing is, when the first activity visible, second activity will be pause state. while pause state, you cannot update the UI,. so what you can do is, just pass one flag from first activity to second activity,based on the flag set the enable or disable operation on edittext.thats all.
Intent firstActivity= new Intent(FirstActivity.this,SecondActivity.class);
firstActivity.putExtra("flag","disable");
startActivity(firstActivity);
in Second Activity,onCreate() method
String flag=getIntent().getStringExtra("flag");
if(flag.equals("disable")){
edtText.setEnable(false);
}else{
edtText.setEnable(true);
}

Related

How can I force read updates in all Smart Panel fields before reading it after a user updates and closes it?

I have a smart panel where I preset a default value for a field within it. If the user changes the value of that field, when the popup is closed, the value remains the old, preset value. I've had this happen in two separate instances: one regarding setting a time and one regarding selectors. The fields are set to commit changes = true. Is there any way to force the code to grab the new value set by the user instead of keeping the value set before displaying the smart panel popup?
Example:
Smart panel has a view called Option. OptionA will be set to something before the popup is executed. After the popup is closed by the user, even if the user changed the selector's value, the code will see the originally set value to OptionA set programmatically before the popup was executed.
Option.Current.AOption = 10;
if (Option.AskExt(true) == WebDialogResult.OK)
{
//This will display the original value
Document.Ask(Option.Current.OptionA, MessageButtons.OK)
}
Initial popup:
User changed:
Popup after closing and executing Document.Ask():

Can I grab and populate a screen made by a programmatically triggered button push?

Am I able to grab a screen that is created by a programmatically triggered button push call and populate it with values?
My specific example is that I want to grab the new e-mail screen that is made when I execute this code:
CRCommunicationDraft graph = PXGraph.CreateInstance<CRCommunicationDraft>();
graph.AddNew.PressButton();
I want to grab the screen created after AddNew.PressButton() is executed. Is there any way to do this?
For this specific case, I think is answered here:
How can I open an editable, sendable e-mail screen with prepopoulated values?
For most cases you want to:
Override the Action Handler of the button. You can use OVERRIDE METHOD button of customization editor for that. In your case override the AddNew action event handler.
Create a new graph instance for your target screen, here it is CREmailActivityMaint.
Assign to or insert a record into the current DataView of that graph, in your case use CREmailActivityMaint.Message DataView.
Redirect to the screen, using PXRedirectHelper class.

Confused about setup type

I have my setup type dialog looking like this :
The top option is a custom one I added.
So in my next button push event, I have this :
So what I would now like to do is load up the custom setup dialog, but those features should be enabled / disabled depending on what was selected.
OR
If completer or first custom option is selected, I want to open a dialog conditionally.
Is this possible?
You can do the following:
Note the 'value' attribute of your new radio button (by default it should be '3')
Add the appropriate events with the condition _IsSetupTypeMin = "value"
Here is an example showing how to define the 'Next' button behavior to do the following:
When selecting 'typical' it will select the proj_files feature and
proceed to the ReadyToInstall dialog
When selecting 'custom' it would
go to the CustomSetup dialog
When selecting the special option it
will add feature2 and remove the proj_files feature, then proceed to
the CustomSetup dialog.

How to make popUp not submit form on startup?

I am using JDeveloper 11.1.2.3.0,
I have a createInsert button that has ShowPopUp Behavior operation included. In the popUp I have inserted a form whose attributes will be clean from the createInsert operation. When I click the button the popUp shows up all right but showing an error about the mandatory fields of the form. The fields of the form of course are empty because I just opened it. So I think that the popUp is autoSubmiting the form at the starting point.
Does anyone have an idea how to stop it from doing this?
I have changed the createInsert button PartialSubmit property to false but nothing changed.
Ok found the solution. The popUp was not submitting anything actually but during the CreateInsert operation the iterator opens a new row in every related component within that page (form, table etc). So when my popUp opened up with the new form fields, a new row was being created in the back-stage in my read-only table. I changed the iterator in a new one from another Application Module for each case and everything is fine now.

How to identify a button click in coded UI Customised code

In UIMAP.CS file in both the Recorded method and assertion method, I am not able to identify the button click.
Is there any way I can get hold of the button click event?
I am able to get hold the button in to a UITESTCONTROL variable but the options I was able to see are "exists", "enabled","name" etc...
I tried checking it with assertions too when I dragged the cross hair on to the clicked button , assertions are generated only for checking the existence,correctness of text and name but not the events occured on it..
Please help in this regard..
Please make sure that the Control/Object on which you want to use the Click operation is a button and not any Web Element or control which does not support the Click operation.
Once verified, you can do the following:
Record a New Session and while recording click on that button, stop your recording.
Open the UIMap.cs and navigate to that button control. The intellitrace would show you all the available options for that control.
Thanks
Nikhil

Resources