nadiah jabbar
Posts: 0
Joined: Fri Jun 20, 2014 3:42 am

Displaying Data

if i want to enter the actual amount for the carrot or banana, how do i add in and display the data?

Image

if i add in the actual amount for carrot it will be displayed underneath the input box.
can i use the same button and input box for this?

this is my mapping

Image

Image

and if i try to add in the amount for the different fruits this will occur.
Image

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Displaying Data

Hi Nadiah,

Sorry but your app logic is not clear for us.
Thus please describe in details steps how it should work.

Regards.

Lim Samantha
Posts: 0
Joined: Wed Jun 11, 2014 6:50 am

Displaying Data

Hi, for example, when i enter 10 at the actual amount under the input, 10 will display below after i click the 'add' button. (shown in the first picture)

  • on behalf of Nadiah
Lim Samantha
Posts: 0
Joined: Wed Jun 11, 2014 6:50 am

Displaying Data

this is another example.
if i add in 12 for the actual amoount, the label below will change to 12.
hope this is a better explanation and u could help us with it. Image

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Displaying Data

Hi Lim,

Your goal is to get value from input component and set it to label component.

If so you need to:

Add JS event handler on button "click" event and populate it with following code:

pre

//Get value from input
//Note: you need replace "bananaInputName" with your input component name.
var bananaValue = Apperyio("bananaInputName").val();

//Set value to label.
//Note: you need replace "labelName" with your input component name.
Apperyio("labelName").text(bananaValue);

/pre

Regards.

Lim Samantha
Posts: 0
Joined: Wed Jun 11, 2014 6:50 am

Displaying Data

Hi, i've tried your codes but now it only display for the first input
How do I make it work for all the items I have?
In addition, how do i save the actual amount I've added into database?

Lim Samantha
Posts: 0
Joined: Wed Jun 11, 2014 6:50 am

Displaying Data

here are the screenshots.

Image

Image

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Displaying Data

Lim,

Please use this code:

pre

var BindInputToLegend = function(inputName, labelName, buttonName){

Code: Select all

 var onButtonClick = function(){ 
     //Get value from input 
     var bananaValue = Apperyio(inputName).val(); 
     //Set value to label. 
     //Note: you need replace "labelName" with your input component name. 
     Apperyio(labelName).text(bananaValue); 
 }; 

 Apperyio(buttonName).click("click", onButtonClick); 

};

BindInputToLegend("inputName1", "labelName1", "buttonName1");
BindInputToLegend("inputName2", "labelName2", "buttonName2");
BindInputToLegend("inputName3", "labelName3", "buttonName3");
BindInputToLegend("inputName4", "labelName4", "buttonName4");

/pre

Regards.

nadiah jabbar
Posts: 0
Joined: Fri Jun 20, 2014 3:42 am

Displaying Data

hello.
We only used one button and one input on the page.
however,when we test it,more than one button will appear due to the mapping.

Image

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Displaying Data

Hi Cody,

Please to try wrap your "callbackUrl" into "encodeURIComponent" function.

The problem is you don't escape some characters that's should be escaped.

For example your code should be:

pre

var url = "https://www.facebook.com/dialog/oauth...=" + Facebook_Settings['client_id'] + "&redirect_uri=" + encodeURIComponent(callbackUrl) + "&scope=publish_actions&response_type=token";

/pre

Regards.

Return to “Issues”