Page 1 of 5

Trouble getting Update Rest Service to work

Posted: Tue May 21, 2013 8:51 pm
by ssquire

Guys,
I am having trouble creating a working Update Rest Service. I have been through some of your links, but still I am very confused. I can't even get a good test response. Is there any help that explains how to establish an Update Rest Service end-to-end in detail (ie. similar to what you've done with create & delete)?


Trouble getting Update Rest Service to work

Posted: Tue May 21, 2013 9:13 pm
by Kateryna Grynko

Hi Steven,

What exactly happens when you do Test in Rest service?


Trouble getting Update Rest Service to work

Posted: Sun Jun 02, 2013 2:04 pm
by ssquire

Katya,

Sorry for taking so long to get back but it's been a grueling graduation season for me.

Anyway, I've got my Update Service testing successfully. However, when I test my app - the fields I've identified in the Update Service as fields that can be updated are not editable. How do I make them editable in my app? Would you mind taking a look at this please? I've used the "Value Change" event for my "Collapsible Block" to implement this.

The project is shared with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a.

Thanks!


Trouble getting Update Rest Service to work

Posted: Mon Jun 03, 2013 12:11 pm
by Maryna Brodina

Hello! Could you tell us your app name?


Trouble getting Update Rest Service to work

Posted: Mon Jun 03, 2013 12:49 pm
by ssquire

It's called Baseball_Tools_Pro.

Thx


Trouble getting Update Rest Service to work

Posted: Mon Jun 03, 2013 4:21 pm
by Kateryna Grynko

Hi Steven,

1) "How do I make them editable in my app" - You should use Input component instead of a Label component

2) Delete service doesn't work because you do not install local_gameDataIdLabel
You need to add Run JavaScript action on mobilecollapsblock_11 - Swiperight event. Run it before the action
mobilecollapsblock_11-Swiperight-Invoke service.
Add the following code to JavaScript:
codevar id = $(this).find("[dsid=gameDataIdLabel]").text();
localStorage.setItem("local_gameDataIdLabel", id);/code
3) You can't map Collapsible block values to Request parametrs directly.
Delete all request parameters mapping in gameUpdateService and on mobilecollapsblock_11-Value change run the following code:
codevar thisBlock = $(this);
var newDate = thisBlock.find("[dsid=gameDateLabel_14]").val();
var newNotes = thisBlock.find("[dsid=gameNotesLabel_15]").val();
var newName = thisBlock.find("[dsid=mobilecollapsblockheader_12]").text();
var id = thisBlock.find("[dsid=gameDataIdLabel]").text();
gameUpdateService.execute({"data":{"object_id":id, "GameDate":newDate, "GameName":newName, "GameNotes":newNotes }})/code


Trouble getting Update Rest Service to work

Posted: Thu Jun 06, 2013 12:23 pm
by ssquire

Katya,
I need to change the size of my Input Components replacing Game Date & Game Notes Labels so that it show multiple lines of text. Is there a way to do that?


Trouble getting Update Rest Service to work

Posted: Thu Jun 06, 2013 4:11 pm
by Kateryna Grynko

Hi Steven,

The labels become with multiple lines by default. If you need them always to have multiple lines you can separate the string as you need (by number of words, by length) and paste html-code < br .

You would also need to change label value programmatically:
codeAppery("label_name")&#46;html( variable_with_text_with_br_html );/code


Trouble getting Update Rest Service to work

Posted: Thu Jun 06, 2013 4:42 pm
by ssquire

I'm sorry Katya. I think I confused you. In one of the previous responses I asked you why I couldn't edit the text in the fields associated with my update service. Then you answered by telling me it was because they were label components and not input components. So I am in the process of changing the label components of Game Date & Game Notes to input components, so they can be edited and updated. In doing that, the Game Notes component needs to have multiple lines & right now it only has a single line. How do I make the input component that I am changing it to multiple lines?


Trouble getting Update Rest Service to work

Posted: Thu Jun 06, 2013 5:08 pm
by Kateryna Grynko

You can try to fill Labels using popup with Textarea, i.e. label click initializes popup contains Textarea component with OK and Cancel buttons.