[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

    Edited once, last by Fernando (May 29, 2018 at 4:21 PM).

  • 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, *wink*

    Greets,
    Fernando

  • 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

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!