Page 1 of 7

Displaying Data

Posted: Thu Jul 03, 2014 1:29 am
by nadiah jabbar

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


Displaying Data

Posted: Thu Jul 03, 2014 9:43 am
by Evgene Karachevtsev

Hi Nadiah,

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

Regards.


Displaying Data

Posted: Fri Jul 04, 2014 2:59 am
by Lim Samantha

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

Displaying Data

Posted: Sat Jul 05, 2014 8:43 am
by Lim Samantha

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


Displaying Data

Posted: Mon Jul 07, 2014 12:55 am
by Yurii Orishchuk

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.


Displaying Data

Posted: Mon Jul 07, 2014 3:18 am
by Lim Samantha

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?


Displaying Data

Posted: Mon Jul 07, 2014 3:19 am
by Lim Samantha

here are the screenshots.

Image

Image


Displaying Data

Posted: Mon Jul 07, 2014 4:47 am
by Yurii Orishchuk

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.


Displaying Data

Posted: Mon Jul 07, 2014 6:04 am
by nadiah jabbar

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


Displaying Data

Posted: Tue Jul 08, 2014 1:05 am
by Yurii Orishchuk

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.