PDA

View Full Version : Redirect on function exit


mduh
05-15-2015, 05:17 PM
Hello,

I have defined new toolbar button, which triggers custom function. I would like to redirect to external url, once the function execution is finished.

I tried following function return:


<?xml version='1.0'?><doc><url>http://example.com</url></doc>



<?xml version='1.0'?><doc><ok type='blank'>http://example.com</ok></doc>



<?xml version='1.0'?><doc><redirect>location='http://example.com'</redirect></doc>


but none of theme work. I receive 'The plug-in failed or returned invalid xml '. Could you please post me example of correct implementation of such redirect?

Thanks,
-Maciej

fly
05-18-2015, 11:47 AM
Hello,

Could you please show your xml with button description.

If you need to add any certain url, you need to add url to button description.

Please see the documentation (http://en.5.ispdoc.com/index.php/Description_of_lists#Toolbar_button_.28the_toolbtn _element.29)

mduh
05-18-2015, 12:06 PM
The toolbar xml:


<metadata name="vm" type="list" key="id" keyname="name" autoupdate="300">
<toolbar>
<toolbtn func="uh.console" name="console" img="t-go" type="edit"/>
</toolbar>
</metadata>



BTW: Is there any recent documentation about user interface development? It would be very helpful to have description of how to build xml interface, supported function return values, etc.

Thanks,
-Maciej

jeremy
05-19-2015, 01:33 AM
Hello.

Try second way, but without <?xml version='1.0'?> . It's should work.


<doc><ok type='blank'>http://example.com</ok></doc>


But remember, new window open this way can be blocked by brower like pop-up window.

If you want to open url in current tab of browser, try this:

<doc><ok type='url'>http://example.com</ok></doc>