Dan Sweeney
Posts: 0
Joined: Thu Feb 21, 2013 9:49 am

Change list item text with java

Hello

I have a list which is populated through a REST service & works fine. I've also added an Input control to each list item.

My intention is to save anything the user types for each list item in a local database (works fine) and read this data back out when the list loads next time.

Unfortunately I can't seem to set the text value of an item in a list using Java, it works on a label or Input outside of the list but not inside.

Any ideas?

Thanks

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

Change list item text with java

Hello! Could you clarify please are you going to change text in List which you get from mapping? What JS you use?

Dan Sweeney
Posts: 0
Joined: Thu Feb 21, 2013 9:49 am

Change list item text with java

Hello

I have a label that is mapped within the list object and also an input which is not mapped.

It's the input text that I am trying change.

I've tried setting a local variable and then setting the input text property on an event.

I've also tried setting the input text property through java using:
Tiggzi("textinput1").attr("text", "test");
and also
Tiggzi("textinput1").text = "test";

Thanks

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

Change list item text with java

1) There is no difference if the component inside the List or not. Try the following JS:

codeTiggzi("labelName").text("test");/code for Label

codeTiggzi("inputlName").val("test");/code for Input

2) There is different situation if you map array to List and as a result you have many List items (with the same name). Let us know if you have this one.

Dan Sweeney
Posts: 0
Joined: Thu Feb 21, 2013 9:49 am

Change list item text with java

My problem is with an array mapped to the list. Although the input control is not mapped itself.

Can you tell me the solution to that then please.

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

Change list item text with java

Hi Dan,

Could you please share your app with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a ?

Dan Sweeney
Posts: 0
Joined: Thu Feb 21, 2013 9:49 am

Change list item text with java

Ok, done.

It's the scrHomeWorkout screen. For now I'm just trying to do it on the mobilecollapsblock_109 expand event

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

Change list item text with java

Hi Dan,

To change Input value inside of List Item use the following code:
codeAppery('mInputWOutExcercise', this).val('text');/code
In such case variable "this" points to the collapsible block. The code will access Input inside of collapsible block.

Dan Sweeney
Posts: 0
Joined: Thu Feb 21, 2013 9:49 am

Change list item text with java

That works, thanks

Return to “Issues”