Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Amir Khan 1287 posts 2744 karma points
    Sep 30, 2009 @ 19:41
    Amir Khan
    0

    Execute XSLT Search from Flash Form.

    Hi,


    Is it possible to execute an XSLT search macro from flash? I'm using CWS. I want to be able to design a form in flash with a search button that executes a search as the Search Macro with CWS does.

    Thank you,

    Amir

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Sep 30, 2009 @ 22:42
    Douglas Robar
    0

    No problem at all.

    You simply want to be sure that your flash calls the page with the XSLTsearch macro on it (/search.aspx, by default), and that flash sends a querystring or form field called 'search' that contains the text you want searched. The form method can be either post or get.

    In plain HTML, it would be:

    <form action="/search.aspx">
        <input name="search" type="text" value="Search" id="search" />
    </form>

    cheers,
    doug.

  • bob baty-barr 1180 posts 1294 karma points MVP
    Oct 01, 2009 @ 02:33
    bob baty-barr
    0

    depending on what level of action script you are using you could call a javascript function embeded in the template to call the search.aspx page as well...

    as3 usese the call externalInterace() function to access javascript on the embedding page...

    or you can just use the navigateToUrl() and pass the conent of the search texfield as querystring

    are you going to parse the returned xml in flash? if so, i would LOVE to see this implementation :) - if only i had more time, i would love to make something like this as a widget that could be embedded all over the place... man, that woudl be awesome... oh, for more time.

  • Amir Khan 1287 posts 2744 karma points
    Oct 01, 2009 @ 20:10
    Amir Khan
    0

    Bob,

    The results page is going to be in html, just had my designers insist that the text you enter in the search box, which is in the middle of a motion graphic, be in a specific font ;)

    Your idea is actually interesting. I could see it being the beginning of a framework to use Umbraco as a CMS for Flash sites.

    -AK

  • Thomas Kahn 602 posts 506 karma points
    Oct 02, 2009 @ 09:07
    Thomas Kahn
    0

    I have used javascript/jQuery to communicate with flash. As Bob is suggesting, setting up functions on the embedding page that are called from flash is a nice way to interact!

    /Thomas Kahn

  • Amir Khan 1287 posts 2744 karma points
    Oct 06, 2009 @ 19:03
    Amir Khan
    0

    I've installed Runway XSLTsearch package, the search.aspx page is working great. When i put the form above on my homepage, type in a search term and press enter, all i get is a ? after the url, no interaction with the search page. When I place the XSLTsearch macro on the homepage it works great. Any ideas what I'm doing wrong?

    here's the code i'm using for the html form:

    <form action="http://dev.russia2018-2022.com/search.aspx">
        <input name="search" type="text" value="Search" id="search" />
    </form>


    Thank you,

    Amir

  • dandrayne 1138 posts 2262 karma points
    Oct 06, 2009 @ 20:29
    dandrayne
    0

    Try method="get" on your form, also in the xsltsearch file,

    changing

    <form action="?" method="post" class="xsltsearch_form">

    to

    <form action="?" method="get" class="xsltsearch_form">

    should have the same effect on the search page

  • Amir Khan 1287 posts 2744 karma points
    Oct 07, 2009 @ 08:14
    Amir Khan
    0

    Still nothin. I also tried the following:

     

    <form action="?" method="get" class="xsltsearch_form">
    <input name="search" type="text" class="input">

    </input>&nbsp;<input type="submit" value="Search" class="submit" />
    </form>
  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Oct 07, 2009 @ 12:09
    Douglas Robar
    0

    XSLTsearch 2.8 will work with either POST or GET methods (earlier verisons only used GET).

    I suspect that your html page has two form tags on it, or that the enter keystroke is being consumed by another form and therefore isn't sending the action to the search.aspx page. Just using action="?" will only work if you are on the search.aspx page already or you have a way of handling postbacks. XSLTsearch is simpler than that so you want to set the action to the search.aspx page specifically.

    I've kind of lost track of your page and it's problems. Can you summarize what is in your html (especially if there are two form tags), and what does and doesn't happen when you enter text in the form and click the submit button?

    cheers,
    doug.

  • Amir Khan 1287 posts 2744 karma points
    Oct 07, 2009 @ 15:56
    Amir Khan
    0

    Doug,


    I appreciate your time with this.


    There is another form on my page, which is used to call the template (see below), at this point, I'm just trying to get an html form to work on the page, once i have that i figure Flash will be easy. 


    So, to summarize i have this form and the form above, whose action is my search.aspx page. What happens when i click submit or press enter is that it just posts a ? to the end of the url.


    Thanks again,

    Amir

     

    <form method="post" action="/home/vision.aspx?" id="aspnetForm">
    <div>
    <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUENTM4MWRkFDLnkjwB0kmyo3XC40U9NEzd730=" />
    </div>
  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Oct 07, 2009 @ 16:14
    Douglas Robar
    0

    Ahh... that's what I thought might be happening. You've got a <form runat="server" .... > tag in your masterpage template, and that's "eating" the form submission for the search.

    It may be that you've put the search's form inside the aspnetForm? That's not going to work. You can't have one form tag inside another. This can happen unwittingly when your master template has the aspnet form and the child template includes the <form> tag directly. The result can be seen when you view the html source of the rendered page in the browser.

    Assuming you have Runway installed, you would want your master template to look like this:

    <body>        
        <div id="main">
            <div id="top">
                <h1 id="siteName"><a href="/"><umbraco:Item runat="server" field="siteName" recursive="true" /></a></h1>
                <h2 id="siteDescription"><umbraco:Item runat="server" field="siteDescription" recursive="true" /></h2>
                <form action="/search.aspx">
                    <input name="search" type="text" value="Search" id="search" />
                    <input type="submit" value="Search" class="submit" />
                </form>
            </div>           
            <div id="body">
                <form id="RunwayMasterForm" runat="server">
                    <asp:ContentPlaceHolder ID="RunwayMasterContentPlaceHolder" runat="server"></asp:ContentPlaceHolder>
                </form>
            </div>
            <div id="footer">
            </div>
        </div>
    </body>

     

    cheers,
    doug.

     

     

  • Amir Khan 1287 posts 2744 karma points
    Oct 07, 2009 @ 19:08
    Amir Khan
    0

    I see now! So there is no way to have form fields inside of one of my subtemplates?

  • Amir Khan 1287 posts 2744 karma points
    Oct 07, 2009 @ 19:22
    Amir Khan
    0

    Doug, I just deleted the form tags surrounding the content placeholder and it works fine? Is that normal behavior?

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Oct 07, 2009 @ 21:21
    Douglas Robar
    0

    Sure. I often do that myself and add the <form runat="server" ... > tags around those individual items that need it. Others like to encapsulate the entire page in a form at the top template. Each approach has pros and cons but the key thing is to make your templates so they work.

    Glad you got it going.

    cheers,
    doug.

  • Amir Khan 1287 posts 2744 karma points
    Oct 08, 2009 @ 08:38
    Amir Khan
    0

    This ended up working for me, thank you all for your help.

     

    -AK

     


    search_btn.addEventListener(MouseEvent.CLICK, mySearch);

    function mySearch(e:MouseEvent):void {
    navigateToURL(new URLRequest("/search.aspx" + "?search=" + search_txt.text), '_self');
    trace(search_txt.text);
    }

Please Sign in or register to post replies

Write your reply to:

Draft