Sie sind nicht angemeldet.

Fernando

Fortgeschrittener

  • »Fernando« ist der Autor dieses Themas

Beiträge: 330

Wohnort: Habana, Cuba

Beruf: Architect, Photographer.

  • Nachricht senden

1

Montag, 28. Mai 2018, 21:35

[solved] How to get the current item name in combobox plugin?

Hi,

This is a example:<combobox name="mycb"
<item name="myitem1" caption=" bla1'
onclick="tracing_this_itemname "/>
</combobox>

<action name="tracing_this_itemname ">
trace(get(layer[get(name)].item.name))
</action>

The red code is bad. How to get the current item name?
Note: I need to get dynamically this name in order to use this code for any item, any combobox.

Greets,
Fernando

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Fernando« (29. Mai 2018, 16:21)


jordi

Profi

Beiträge: 583

Wohnort: Barcelona

Beruf: creating ideas & coding them

  • Nachricht senden

Fernando

Fortgeschrittener

  • »Fernando« ist der Autor dieses Themas

Beiträge: 330

Wohnort: Habana, Cuba

Beruf: Architect, Photographer.

  • Nachricht senden

3

Dienstag, 29. Mai 2018, 00:31

Hi Jordi. Thanks... But Where in the link the answer is? *confused*

Is it here?
layer[cbname].item[itemname].*

I think that my problem is other:

<combobox name="cbname">
<item name="myitem1"/>
</combobox>

trace(layer[get(name)].item[????}.name); In this case it is not the number of index what I want to enter but something generic as get (name) is it

The idea is obtaining the value "myitem1" without having to give no piece of information. Of similar way to using get(name) that precisely you get the combobox name ("cbname")

Please if you have a solution put an example, ;-)

Greets,
Fernando

Fernando

Fortgeschrittener

  • »Fernando« ist der Autor dieses Themas

Beiträge: 330

Wohnort: Habana, Cuba

Beruf: Architect, Photographer.

  • Nachricht senden

4

Dienstag, 29. Mai 2018, 03:46

Simplifying the question

Hi, this a question relative a any combobox with action in a specific item

This works fine:
trace(get(layer[get(name)].item[1].name);

This works fine too: (It does not make sense a lot but it works...)
trace(get(layer[get(name)].item[item1name].name);

Is there any possibilities of referring to the name of the item that generates the action?
trace(get(layer[get(name)].item[get(?)].name);

Almost sure that it is impossible, only I ask in case there is some trick *sleeping*

Best Regards,
Fernando

5

Dienstag, 29. Mai 2018, 09:12

Hi,

here:

Quellcode

1
trace(layer[get(name)].item[get(layer[get(name)].selecteditemindex)].name);


or here maybe a bit nicer:

Quellcode

1
2
copy(cb, layer[get(name)]);
trace(cb.item[get(cb.selecteditemindex)].name);


Best regards,
Klaus

Fernando

Fortgeschrittener

  • »Fernando« ist der Autor dieses Themas

Beiträge: 330

Wohnort: Habana, Cuba

Beruf: Architect, Photographer.

  • Nachricht senden

6

Dienstag, 29. Mai 2018, 16:20

Thanks very much, Klaus. That is just the answer that it needed!!! *thumbsup*
Best Regards,

Fernando

Ähnliche Themen