[CLOSED] getAutoLoad() method and params array missing

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] getAutoLoad() method and params array missing

    We are upgrading from 1.7 to 4.2.1. After changing the AutoLoad property for Loader within a Panel this piece of code stop working.

    #{stateSettingsPanel}.getLayout().activeItem.getAutoLoad().params['stid'] = node.attributes.value;

    Searched in the change logs and this function is not referenced anywhere.

    Intuitively changed this method name for getLoader() as in the line below, however params property seems not to be available now.

    #{stateSettingsPanel}.getLayout().activeItem.getLo ader().paramsFn().stid = node.attributes.value;

    By getting the JSON returned by paramsFn() we're able to navigate to the desired property and made it work. Is this the correct way to do it now or should params be vailable if done differently?
    Last edited by fabricio.murta; Aug 18, 2017 at 10:16 PM.
  2. #2
    Hello @AdvanceLoanTechnologies!

    You ended up with the right approach. Well, it works. But I believe you could have left all the trouble to Ext.NET instead of trying to figure out that one by using the loader's <params /> block.

    For an use case of this, check out the last tab panel on this example: Loaders - Component Loader - Direct Method.

    I hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3

    getAutoLoad() method and params array missing

    We actually used that block in the markup but still the params array/collection isn't available from JavaScript as before.

    JAVASCRIPT
    #{stateSettingsPanel}.getLayout().activeItem.getAu toLoad().params['stid'] = node.attributes.value;

    MARKUP
    				<ext:Panel runat="server" Title="1" ID="stateSettingsCardPanel" Padding="5" ButtonAlign="Center" AutoScroll="true">
                        <Loader runat="server" Mode="Frame" AutoLoad="false" DisableCaching="true">
    						<Params>
    							<ext:Parameter Mode="Value" Name="stid" Encode="false" />
    						</Params>
                            <LoadMask ShowMask="true" />
                        </Loader>
  4. #4
    Hello @AdvanceLoadnTechnologies!

    Well, alright, to get the parameters set in the Loader client-side, that would be, yes, by calling its paramsFn() method. This is a setting specific to Ext.NET when it comes to passing parameters to the server, related to direct methods/events, and it was not really a supported feature to query those parameters from client-side (as they are actually queries of other page values), so you won't be finding about this change in any change log.

    In other words, it may work now but may break (again) in the future without notice, I believe you should rely on getting the parameters other way (directly from the variable/component you are querying the parameter from).

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  5. #5

    Set/update loader's parameter

    Hello:

    After getting the params collection from the client side I'm trying to update parameter dynamically as this:

    #{stateSettingsPanel}.getLayout().activeItem.getLoader().paramsFn().stid = record.data.value;
    The stid paramater is not getting updated after assignment.

    Current loader setup:

    Click image for larger version. 

Name:	loader-params-1.png 
Views:	58 
Size:	15.7 KB 
ID:	25020

    Before it used to work like this:

    #{stateSettingsPanel}.getLayout().activeItem.getAutoLoad().params['stid'] = node.attributes.value;
  6. #6

    Set/update loader's parameter

    Notice after setting the desired panel as active I can get access to its loader this way:

    #{stateSettingsPanel}.getLayout().activeItem.loader.params.stid = record.data.value;
    However, I'm getting the params collection as null although they are on its markup.

    Click image for larger version. 

Name:	loader-params-2.png 
Views:	58 
Size:	81.3 KB 
ID:	25022
  7. #7
    Hello @AdvanceLoanTechnologies!

    As your post title and content suggests, it seems the subject has slightly changed from the initial subject of this post. Would you be as kind as to open a new thread for that so we can keep threads tied to a specific matter?

    Besides, would you also provide for that a runnable, simplified test case enabling us to run the code on our side and be able to better understand the problem and give you a better response?

    I hope you understand.
    Fabrício Murta
    Developer & Support Expert
  8. #8
    Fabricio, Rafaelcjr here
    we will be posting a new sample on a new thread
    But before we do that , I just have couple of questions to make sure that our assumptions match what you guys know.


    Assumptions and Questions
    1. The <Loader> component/element is part of most Containers components.
    This LOADER allows setting up a panel to render as an IFRAME which loads (an outside/remote) target Url set on the Loader's property.
    Are these assumptions/beliefs correct?


    2. The PARAMETERS section of the Loader behaves as a sort of Hidden fields.
    These Parameters are accessible thru the REQUEST object while inside the Target URL that is loaded in the "frame"
    Are these assumptions/beliefs correct?


    3. Can a Parent Page change the Parameter values of a contained ChildPanel Loader (by either Client or Server script)
    and then Reload that ChildPanel to have the new (changed) REQUEST Parameters available inside the frame's target URL page ??
    (this third question might now be worded correctly - I hope you catch my drift)


    Your response to these (ignorant questions) would be greatly appreciated, as always.
    Last edited by AdvanceLoanTechnologies; Jul 06, 2017 at 9:43 PM.
  9. #9
    Hello @Rafaelcjr!

    For your question 1:
    Yes, plus the loader is available to any component, so there may be some which loading from an iFrame makes sense, others do not. As the component simply does not supporting the loader/ignoring it, or supporting only specific loader approaches.

    Specificly to the panels/containers, the limitation would be browser or server side (thru page headers) in which cross-site referencing wouldn't be allowed. So Ext.NET (or ExtJS) wise, we can't just say we enable any component to load any sub-page inside it. HTML5 IFRAME and web browser limitations will always apply.

    For your question 2:
    If I understand correctly your assumption, yes, the parameters are passed to the child frame as page arguments, so you can think about them as "hidden fields", except that they are not actually an HTML hidden field.

    For your question 3:
    I believe the question 3 is proved in the test case you provided on your new thread here: Loader's params null after panel has been activated.

    This example also touches the subject, except it does not really change the destination page nor its custom parameters, but that would be a matter of actually writing the custom parameters and making the child page read them: Panel > Basic > Loader.

    In other words, yes, you can not only set up anew the parameters but the whole loader. It is important that you bind a loader to the container beforehand, though (if you just call the loader's LoadContent() to a component without a previously set up loader, it will fail).

    I hope the answers are satisfactory. If not, please let us know. Notwithstanding, if the rose question is not around the subject of the getting the list of parameters from a loader, we'd ask you for a new forum thread so we keep threads with just one subject.

    p.s.: Just to let you know, we've promoted your account to premium so you may be posting in premium forums using it if you feel like.
    Fabrício Murta
    Developer & Support Expert
  10. #10
    Fabricio, thanks for your detailed answers.
    I think I'm getting the gist of it now.

    One thing we did discover is that now the JS framework has both a <Paramaters> and a <Baseparameters> for loaders and the <BaseParameters> seem to behave(same functionality) like the old v1.2 <Parameters>

    Not sure if you've come across this change (seems to be Sencha change) - we could not find it searching thru all your change logs/breaking changes.

    Thanks again for elucidating the issues that we come across.
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 2
    Last Post: Aug 05, 2016, 7:49 AM
  2. [CLOSED] Missing getFilterData method
    By AlbertoCe in forum 3.x Legacy Premium Help
    Replies: 2
    Last Post: May 08, 2015, 9:18 AM
  3. Replies: 23
    Last Post: Jan 17, 2015, 10:43 AM
  4. [CLOSED] AbstractComponent is missing the MarkInvalid method
    By SFritsche in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Nov 07, 2012, 11:18 AM
  5. [CLOSED] [1.0] Ext.net.Store.remove method not accepting array
    By tdracz in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 23, 2010, 5:08 PM

Posting Permissions