Problem to pass parameters to an URL by a store

Page 1 of 4 123 ... LastLast
  1. #1

    Problem to pass parameters to an URL by a store

    Hello

    Here's my problem:

    I have a calendar that I want to fill or not, depending on a checkbox checked or not. But I did not understand how to do. Here what I have done as I understand of what I read elsewhere on the forum :

                                                
                                               <EventStore 
                                                    ID="stoCalendar" 
                                                    runat="server" 
                                                    DateFormat="M$"
                                                    SaveMappings="false">
                                                    <Proxy>
                                                        <ext:HttpProxy Url="jsonDal/ReturnJsonCalendar.aspx" Json="true" />
                                                    </Proxy>
                                                    <BaseParams>
                                                        <ext:Parameter Name="ShowParis" Value="#{chkResMedParisVisible}.getRawValue();"></ext:Parameter>
                                                    </BaseParams>
                                                    <Reader>
                                                        <ext:JsonReader />
                                                    </Reader>
                                                </EventStore>
    I think it is good but I don't know how to get paramaters ShowParis in code behind :

            Dim bShowParis As Boolean = CBool(Request.QueryString("ShowParis"))
    This works well (and hopefully) if I pass the parameter in the URL calling like this :

        <ext:HttpProxy Url="jsonDal/ReturnJsonCalendar.aspx?ShowParis=true" Json="true" />
    but not whith the baseparam system...So what I have misunderstood or what is missing?

    Thanks to answer.
  2. #2
    Hi,

    Well, you can read it from InputStream:
    http://msdn.microsoft.com/en-us/libr...putstream.aspx
    since you set up Json="true".

    Or you can remove Json="true" and read a parameter this way:
    Request["parameterName"]
    Could you clarify why do you need a json request to a page?

    And I would recommend to use a WebService or an http handler instead of a page.
    https://examples1.ext.net/#/GridPane...ON_WebService/
    https://examples1.ext.net/#/GridPane...rting/Handler/
  3. #3
    Thanks for your answer.

    I think I use aspx page as you use webservice, I only use that to return my json string. I'm not very aware of webservice technique, so, as I have to deliver a concept project very fast, I didn't lost a lot of time on technology that i'm not very inform on and as I use VB and not C# as code behind, I try to adapt an example of web service but I couldn't manage to make it works, so, I return to well know method.

    But at the end, I will try to make all mt request by webservice of course.

    For now, I have resolve my problem by getting data needed in code behind: when I tick my checkbox, a data is stored in code bhind and uses after. This way it works.

    Could you explain furtherthe rmove jso=true and parameter things? Where I use this parameter? And what json=true or false does?
  4. #4
    Quote Originally Posted by feanor91 View Post
    Could you explain furtherthe rmove jso=true and parameter things? Where I use this parameter? And what json=true or false does?
    Well, you need to set up Json="true" when you need to send parameters as a JSON object - for example, to a JSON WebService.

    When you send a request to a page, I think you don't need to set up Json="true".
  5. #5
    OK, I will try that then.

    I thinked it was to say that we await a JSON return from the request.

    There is really a lack of documentation on ext.net stuff. Examples are very good, but it is not enough to understand all the subtilities of such a tool.
  6. #6
    Well, it is in the Ext.Net docs:
    http://docs.ext.net/

    Search HttpProxy, click "members" - there is the Json property.

    Though, really there are no many things in these docs. We hope to extend it.
  7. #7
    Oups...See it, Well, I didn't find this doc before, thanks a lot!
  8. #8
    OK, I have made a little progress.

    I manage to catch my ShoParis parameters but I get that inside (this is mly header to the page) :


    Request URL:http://localhost:4124/jsonDal/ReturnJsonCalendar.aspx
    Request Headers
    Content-Type:application/x-www-form-urlencoded; charset=UTF-8
    Origin:http://localhost:4124
    Referer:http://localhost:4124/Default.aspx
    User-Agent:Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.60 Safari/534.24
    X-Requested-With:XMLHttpRequest
    Form Data
    start:11-27-2011
    end:12-31-2011
    ShowParis:chkResMedParisVisible.getRawValue();
    In fact, it seems that the javascript function is not interpreted before passing parameters....

    Now, my call is like that :

                                                <EventStore 
                                                    ID="stoCalendarMonth1" 
                                                    runat="server" 
                                                    DateFormat="M$"
                                                    SaveMappings="false">
                                                    <Proxy>
                                                        <ext:HttpProxy Url="jsonDal/ReturnJsonCalendar.aspx" Json="false" />
                                                    </Proxy>
                                                    <BaseParams>
                                                        <ext:Parameter Name="ShowParis" Value="#{chkResMedParisVisible}.getRawValue();"></ext:Parameter>
                                                    </BaseParams>
                                                    <Reader>
                                                        <ext:JsonReader />
                                                    </Reader>
                                                </EventStore>
  9. #9
    Please set up Mode="Raw" for the Parameter.
  10. #10
    Try it but on my init calendar function :

    Ext.getCmp("calMonth1").setStartDate(dDateNow);            
    
    Main.js:111Uncaught TypeError: Cannot call method 'setStartDate' of undefined
      Ext.getCmp("calMonth2").setStartDate(dDateNextMonth1);            
    
      Ext.getCmp("calMonth3").setStartDate(dDateNextMonth2);
    The javascript code crash it failed to create the calendar (here, I try on the second one : I have 3 calendar linked (november-december-january, for example)
Page 1 of 4 123 ... LastLast

Similar Threads

  1. Pass and get parameters from Window
    By AlexMaslakov in forum 1.x Help
    Replies: 1
    Last Post: Aug 19, 2011, 8:16 PM
  2. Replies: 1
    Last Post: Nov 29, 2010, 4:15 PM
  3. Listener Fn - How can I pass extra parameters?
    By lionelhutz in forum 1.x Help
    Replies: 0
    Last Post: Dec 10, 2009, 5:25 PM
  4. Replies: 2
    Last Post: Aug 10, 2009, 5:28 PM
  5. [CLOSED] Pass Parameters Using HttpProxy
    By LeeTheGreek in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 02, 2009, 12:00 PM

Posting Permissions