ssquire
Posts: 0
Joined: Tue Feb 12, 2013 4:36 am

Trouble getting Update Rest Service to work

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)?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Trouble getting Update Rest Service to work

Hi Steven,

What exactly happens when you do Test in Rest service?

ssquire
Posts: 0
Joined: Tue Feb 12, 2013 4:36 am

Trouble getting Update Rest Service to work

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!

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Trouble getting Update Rest Service to work

Hello! Could you tell us your app name?

ssquire
Posts: 0
Joined: Tue Feb 12, 2013 4:36 am

Trouble getting Update Rest Service to work

It's called Baseball_Tools_Pro.

Thx

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Trouble getting Update Rest Service to work

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

ssquire
Posts: 0
Joined: Tue Feb 12, 2013 4:36 am

Trouble getting Update Rest Service to work

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?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Trouble getting Update Rest Service to work

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

ssquire
Posts: 0
Joined: Tue Feb 12, 2013 4:36 am

Trouble getting Update Rest Service to work

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?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Trouble getting Update Rest Service to work

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

Return to “Issues”