How to create a global variable that can be accessed in all layers of the application. Accessing an element ID and updating - android-jetpack

I am trying to update a text dynamically but without success. clicking on a button the text is updated

Related

Transfering variable from one page to antother page containing HTML area same component in people code

I amd new in people code , creating one application in which we need to transfer variable from one peoplecode page to antother page containing HTML area. When i am trying to do the same i am getting blank page.
You don't need to transfer variable values from one peoplecode event (e.g. page1.activate) to another (e.g. page2.activate).
First and better solution: Assign your html area object to a component record field and you can access its value within context of your component.
Another solution: Declare a variable at component level

ASP.Net 4.0 image select and change source

If I have a set of image (buttons) or even just plane images, 5 in a row, and I want to achieve the following, what would be the easiest way, I can't realy find a good solutions to this:
On clicking either of the images, it needs to get a new src, but others need to be restored to the original state.
A Asp:Label needs to be set on clicking, based on the image clicked
On doing a PostBack, I need to know which one is selected
Asside from this, it's asp.net 4.0, so single quotes are giving me javascript pain.
On clicking either of the images, it needs to get a new src, but others need to be restored to the original state.
First of all you have to create a function in which you will set all 5 images to the original state.
Then be sure to give same class name to each image element.
After that crate a function which will fire according to class name like
$(".classname").click(function(){
//first call the function which will set all 5 images to original state.
//then change the source of the current image. onwhich user has clicked as below:
$(this).attr("src","new source");
// here you can store the id of current image in a variable to keep the record which images have been clicked
});
A Asp:Label needs to be set on clicking, based on the image clicked
you can easily set the Asp:Label in above function. If you are familiar with javascript code. Its too simple to set.
On doing a PostBack, I need to know which one is selected
After creating the first function your rest of two steps get completed them selves.
in above function you have saved the IDs of images on which a user has clicked in a variable.
on doing postback you can easily save the varibale's data in hiddenfield or assign it to static varibale or what ever the way you like.
at last you can access it in code behind.
If i have to do this thing. i'll follow the above process. Its far easy and fast process. Everything can be done at client side.
what you think?

Navigating between views in flex

I am trying to develop a mobile application using flex. Whenever I use 'navigator.popView()' to go back to the last view that was shown, it loads a new view on to the screen, instead of using the old one itself.
On the first screen, I have a TextInput into which I enter some text, when I push next and then push back the TextInput is empty. I want to retain the text in the TextInput.
It is advisable not to keep views in memory by default, so discarding old views and creating new ones is really the desired behavior. You should bind the content of your TextInput to a variable and store and retrieve only its text value.

Disable update post button after submit keeps the post as a draft

I have a form in WordPress that has a dynamically generated text box so the user can enter multiple text boxes. This works fine but if the user presses the save/update button multiple times it is saving multiples of the same data from these generated text boxes.
I tried a JavaScript solution to disable the button once pressed which works, my data saves correctly from the generated text boxes but then if it is a new post only it ever saves as a draft.
Is there a solution?
Instead of using disable on the #publish button, .hide(); worked instead.

Flex: How can I Load data, then create required components?

I have a flex application that has three tabs. Each of these tabs has a component that loads a ‘form’ that has a dropdown combo box. These combo boxes depend on external data in order to populate correctly. Currently the first tab is being created and the data that should be populated in the combo box is not in there. The combo box for the second tab is populated with the required data.
What I’d like to do is create an event that is dispatched after the data is loaded. When this event happens I’d like to then create these tabs, or the components of the tabs. Is there a way to wait for the data to be loaded before the application creates the components?
You could create the components in actionscript.
this code will create a ComboBox:
var newBox = new ComboBox();
newBox.dataProvider = aDataProvider;
// You could alternativley use (v/h)box.addChild(newBox)
// to add it as a child of a specific element
Application.application.addChild(newBox);
You can use that sort of technique to create the components in actionscript, you will still need to set all the properties that are usually set in mxml, but they all have the same names.

Resources