I adding a button to the ribbon tool bar in Tridion 2011 SP1. When I click on the button it will open an aspx page.Inside that aspx page I need to access the current field name where the cursor is presently. Please provide me which object to be used? For schema name I used $display.getView().getItem().getSchemaId(). Similarly is there any way to get the current field name?
I adding a button to the ribbon tool bar in Tridion 2011 SP1. When
Share
The closest I got is using this code (in the Component edit window):
This will return the name of the current field, even though the method name suggests it does something else.
If you want to get the same value from your popup, call it on the
openerlike this:Better solution
Instead of looking up the field name from within the popup, you should really pass it into your popup as a argument when your command is invoked. You can get it from the
targetparameter that is passed to the_executemethod of your Command.And then read it in your popup’s JavaScript using: