use radar + textfield plugin together

  • Hello,

    I hope I'm on the right subforum right now. I have a question about using the radar and texfield plugin together. I have 2 pano's now and they are linked by a hotspot and a radar. I also have two textfield-hotspots (polygonal). I have 3 xml-files, for the 2 pano's and a 'general' one. The xml for the polygonal textfield-hotspots is in the pano1.xml-file. When I open pano1.html, the textfields work. When I open the general html (xml)-file, the textfields don't pop-up. I can see the polygonal hotspots, but when clicking on them, nothing happens.

    The next thing is: how do I close the first textfield when the second shows up? I tried
    set(plugin[htmltext2].enabled,true);
    set(plugin[htmltext].enabled,false);
    but that doesn't work well. I also like to close an active textfield when going to another pano (by clicking on a hotspot).

    And another question: I want to make a pano with 10 textfield-hotspots (or maybe more or less ;)). Is it possible to make one action to close the active window? I don't like to have action hidewindow, hidewindow2, hidewindow3 ... hidewindow10. And the same for the actions to show the textfield. I want to have the same way of popping up, but with another text.

    I hope someone can help me out. I'm sorry they're all beginners questions :(.

    I can't post the xml because it's too many characters ;).

  • xml:
    general xml file:

  • pano1.xml (it's actually valkenburg1.xml ;)):

    The third xml is not important, that one is just a 'flat' pano with a hotspot to pano1 and works correct.

  • Hi,

    Your pano1.xml (it's actually valkenburg1.xml ;)): has a parser error... there is a missing </font>:

    Code
    <data name="htmldata">
    <p>
    <font face="Verdana, Arial, Helvetica, sans-serif" size="+4">
    bla
    <a href="event:action(hidewindow,htmltext);">Sluiten</a>
    </font>
    </p>
    </data>
    Quote

    The next thing is: how do I close the first textfield when the second shows up? I tried
    set(plugin[htmltext2].enabled,true);
    set(plugin[htmltext].enabled,false);

    try using set(plugin[X].visible,true/false);

    Code
    set(plugin[htmltext2].visible,true);
    set(plugin[htmltext].visible,false);
    Quote

    And another question: I want to make a pano with 10 textfield-hotspots (or maybe more or less ;)). Is it possible to make one action to close the active window? I don't like to have action hidewindow, hidewindow2, hidewindow3 ... hidewindow10. And the same for the actions to show the textfield. I want to have the same way of popping up, but with another text.

    Try using only one textfield plugin... and change his htmldata content inside each action:

    Code
    set(plugin[htmltext].html,data:htmldataX);

    Your code would be:

    SAlut.


  • Your pano1.xml has a parser error... there is a missing </font>

    Oops. Didn't copy-paste very well. It's ok in my xml. That was not the reason the texfield plugin doesn't work together with the radar. I still can't find out why.

    Quote

    Try using only one textfield plugin... and change his htmldata content inside each action:

    Code
    set(plugin[htmltext].html,data:htmldataX);

    Ok, thx. Isn't there a possibility to use the same action every time, but change only the data (something like

    Code
    onclick="action(hidewindow,htmltext2); action(show_jaap,jaaptext);"


    but then something that works ;))?

    Quote

    Your code would be:


    Thanks for your help!

  • Ok, what I did now:

    Code
    <hotspot name="jaap"
    	blabla
    	onclick="set(htmldata,jaap); action(hidewindow,htmltext2); action(show_text);"
    	blabla
    
    
    	<hotspot name="hanneke"
    	blabla
    	         onclick="set(htmldata,hanneke); action(hidewindow,htmltext); action(show_text);"
    	blabla

    And:

    This works well. Can I make it shorter?

    The not-working textfields had nothing to do with the radar-plugin, but with the loadpano-action. The flag should be 'merge', not 'keepall'. And I added 'keep="all"' to every plugin that is used by the radar.

    Edited 2 times, last by maaike (November 29, 2009 at 1:49 PM).

  • Hi,

    Instead of a custom variable like set(htmldata,jaap); to check for, try to set directly the htmldata of the textfield plugin... set(plugin[htmltext].html,data:htmldataX);... like this:

    Code
    <hotspot name="jaap"
    	blabla
    	onclick="set(plugin[htmltext].html,data:htmldata); action(hidewindow,htmltext2); action(show_text);"
    	blabla
    
    
    <hotspot name="hanneke"
    	blabla
    	onclick="set(plugin[htmltext].html,data:htmldata2); action(hidewindow,htmltext); action(show_text);"
    	blabla

    Now, the if statements inside your action(show_text) are not needed...

    Another way would be to pass a parameter to your action(show_text)... action(show_text,PARAMETER)... ( note that this is already used in the action(hidewindow) )...
    So the code would be:


    note in line 12 the %1.... more info about how to pass parameters to an action https://krpano.com/docu/actions/#action

    SAlut.

  • Ok, thanks, that's better!

    I do not fully understand the %1-thing. I copied the 'hidewindow' from the textfield-example. But I don't understand yet why hidewindow uses %1, and hidewindow2 not.

  • Hi,

    Quote

    I do not fully understand the %1-thing.

    %1 correspond to the first argument given in the action call:
    action(show_text,data:htmldata);
    so,
    set(plugin[htmltext].html,%1);
    correspond to:
    set(plugin[htmltext].html,data:htmldata);

    Take a look to the action doc for more explaination: https://krpano.com/docu/actions/#action

    Quote

    I copied the 'hidewindow' from the textfield-example. But I don't understand yet why hidewindow uses %1, and hidewindow2 not.

    I think there is not particular reason why one use parameters and the other do not... It is probably because this is an example and Klaus show us different ways to do (helping us to learn krpano characteristics *wink* ).
    Notice that hidewindow2 actions apply only for the plugin on that actions... hidewindow is more generic thanks to the fact that it use parameters to tell what plugin to hide...

    SAlut.

Participate now!

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