You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Fernando

Intermediate

  • "Fernando" started this thread

Posts: 205

Location: Habana, Cuba

Occupation: Architect, Photographer, Programmer.

  • Send private message

1

Monday, May 28th 2018, 9:35pm

[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

This post has been edited 1 times, last edit by "Fernando" (May 29th 2018, 4:21pm)


jordi

Intermediate

Posts: 483

Location: Barcelona

Occupation: creating ideas & coding them

  • Send private message

Fernando

Intermediate

  • "Fernando" started this thread

Posts: 205

Location: Habana, Cuba

Occupation: Architect, Photographer, Programmer.

  • Send private message

3

Tuesday, May 29th 2018, 12:31am

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

Intermediate

  • "Fernando" started this thread

Posts: 205

Location: Habana, Cuba

Occupation: Architect, Photographer, Programmer.

  • Send private message

4

Tuesday, May 29th 2018, 3:46am

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

Tuesday, May 29th 2018, 9:12am

Hi,

here:

Source code

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


or here maybe a bit nicer:

Source code

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


Best regards,
Klaus

Fernando

Intermediate

  • "Fernando" started this thread

Posts: 205

Location: Habana, Cuba

Occupation: Architect, Photographer, Programmer.

  • Send private message

6

Tuesday, May 29th 2018, 4:20pm

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

Fernando

Similar threads