2016년 11월 12일 토요일

notifier - displaying listview


is there a way to show a listview in a notifier?

I'd like to use the notifier with two input messages? 

-- 

Use a List Picker?
ABG

-- 
that's a bit intricate.
as you can see i have two value called "tags" and "tag value". When i click "add tag" i join "tag" with ":" and "value"

for example i put in tag "age" and in tag value "35", and i have the result of "age: 35"


now i see this sub list called tag in a screen with a listview

when i click on a row of list view, see the notifier

if i select Delete the value picked n listview is deleted (i'm trying to do that, not sure how but i'm not worried), but if i pick "modify" the notifier opens that

if you see ""fssa: 342" is the "tag" + ":" + "tag value".
when i insert in the message box something, this could replace the value.....since i want to remake the same structure as the first, i'd like to have a message box with "tag" and another with ""tag value"

it's possible somehow?

ps abraham, what do you mean with listpicker? i'm interested in using listpicker with notifier

psps i read somewhere that i could change color of buttons in notifier by using codes, but i can't find how

thank

-- 

ps abraham, what do you mean with listpicker? i'm interested in using listpicker with notifier




When I suggested the List Picker, I thought maybe you were looking for its unique ability to be popped up over your screen, like a Notifier, under blocks control,
without even needing the ListPicker button visible on the screen.

 Regarding your interest in using a Notifier.TextResponse to collect a new value for a tag:value pair,
I see only one input text field in that popup.  However, you can work around that by either
remembering the Selection of the ListView that triggered the Notifier, to tell you the tag for which a new value is being input,
or by asking the user to enter both the the tag and value with the colon (:) between them, then splitting at ":" to get the list (tag, value).

ABG



-- 
i'm trying this method

so i put in the first text dialog the "tag name", and in the second text dialog "tag value"
the problm is that when i add the "replace list item" i have the error:

 "Replace list item: Attempt to replace item number 1 of a list of length 0: ()
Note: You will not see another error reported for 5 seconds."

why?

-- 
Where do you add items to the global list Tags ?

I see several places where you might be confusing the two global variables Tag and Tags.

Why do you retrieve from the TinyDB tag Tags and store the result in the global Tag?
I would expect you to store into the global Tags.

Programmers sometimes make things harder for themselves by using names that are too short
or too close together, differing only by one letter.

You can easily rename global variables in their initialize blocks, and the new name will propagate.
Choose more verbose names, like newTag for a newly entered tag.

Also, ListView.SelectionIndex should be available outside the ListView events, so
there should be no need for keeping a copy of it in a global.

Also, if you are using Notifiers for input of two different things, like tags and values,
spend an extra byte or two to pull in an extra Notifier from the Designer, and rename them
TagNotifier and ValueNotifier, so you can catch their input in separate event blocks
for separate handling.

ABG


-- 
great ideas.
till tomorrow

-- 
IT WORKS!!!!!!




the only problem is that the replacement are within brackets.....where have i to delete them? considering that i may input something with parentheses and i do not want to delete voluntary parentheses


edit, i have to look for some problem, when i modify elements in the list there are some redundancies

-- 
Why did you make the global NewValue a list?

You never  will be having more than one value per tag, right?

That's where your unwanted parentheses are coming from.

When you get a new text value for Newvalue fro the text Notifier,
just set global NewValue to the new value.
Don't use an add item to list block for that, since NewValue shouldn't be  list.

ABG

-- 
what an idiot.


-- 
It's not idiocy, just a defensive habit you haven't learned yet:
AI2 tutorials don't mention how to name variables properly,
to separate single from plural (add an s to the name) or to
add relation information (the unspoken of between name parts:
ZornSon = Son of Zorn
CustomerName = Name of Customer

ABG


-- 
sir, you are my vergilius in the hell of android




-- 

sir, you are my vergilius in the hell of android



Aeneid a break.
ABG

-- 

댓글 없음:

댓글 쓰기