Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Mar 2011
    Posts
    144
    Vote Rating
    3
    incutonez is on a distinguished road

      0  

    Default Siesta chaining question.

    Siesta chaining question.


    I'm trying to do some chaining in Siesta 2.0.3, and I'm not quite happy with the solution I've come up with. What I want to happen is this:

    I'm in a test chain function that grabs my input box DOM element, then the next action moves the cursor to that DOM element, then I click in the DOM element, and finally type in the DOM element. My DOM element is a global var, and when I pass it into the chain objects, it's undefined, but it's definitely defined in the first function. To further clarify this, here is my code:

    Code:
    var loginUserInput;
    t.chain(function(next) {
      loginUserInput = this.getLoginUserInput();
      alert(loginUserInput);  // object
      next();
    }, {
      moveCursorTo: loginUserInput,  // undefined
      desc: 'Moved to login input box'
    }, {
      click: loginUserInput,  // undefined
      desc: 'Clicked login input box'
    }, {
      ... // next action
    });
    Now, what I believe is happening is, when Siesta runs this chain, it will parse the objects and translate them into the respective function, and then it'll execute the chain, so when these objects are parsed, loginUserInput is undefined. What I want to happen is for the objects to respect what happens to the variable. I can accomplish this through some ugly code:

    Code:
    t.chain(function(next) {
      loginUserInput = this.getLoginUserInput();
      t.moveCursorTo(loginUserInput, function() {
        t.ok('MovedCursor', 'Moved to login input box');          
        t.click(loginUserInput, function() {
          t.ok('Clicked', 'Clicked login input box');
          t.type(loginUserInput, 'number1', function() {
            t.ok('Typed', 'Typed "number1" into login box');
          });
        });
      });
      next();
    }, {
      waitFor: 1000
    }, {
      ... // next action
    });
    So I have to first nest my actions, then I have to wait for 1s after all is said and done. It just doesn't seem right. I should be able to set my chain objects to a variable that will be set/changed. How do I accomplish this?

  2. #2
    Sencha - Support Team
    Join Date
    Feb 2013
    Location
    California
    Posts
    3,092
    Vote Rating
    59
    Gary Schlosberg has a spectacular aura about Gary Schlosberg has a spectacular aura about Gary Schlosberg has a spectacular aura about

      0  

    Default


    This seems like more of a Siesta question. Have you tried contacting Bryntum? You could try their forum:
    http://bryntum.com/forum/viewforum.php?f=20

    UPDATE: Looks like I posted the wrong link, so I've update the one here to reduce problems.
    Last edited by Gary Schlosberg; 18 Oct 2013 at 9:50 AM. Reason: Update link
    Are you a Sencha products veteran who has wondered what it might be like to work at Sencha? If so, please reach out to our recruiting manager: sheryl@sencha.com

  3. #3
    Sencha User
    Join Date
    Mar 2011
    Posts
    144
    Vote Rating
    3
    incutonez is on a distinguished road

      0  

    Default


    Unfortunately, you need to own their product in order to use their forums. I'm just using Siesta Lite.

  4. #4
    Sencha - Community Support Team mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    2,711
    Vote Rating
    104
    mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all

      1  

    Default


    @incutonez: There is a Siesta forum which is open for all, please use that. http://bryntum.com/forum/viewforum.php?f=20. We have a Premium forum too which is just for paying license holders.

    To answer your questions, if you really must use a real native reference to the target you want to type into (a string - Component Query or DOM query is easier to work with) then you can always use a function, to get the target at target execution time.

    Code:
    var loginUserInput;
    t.chain(
    {
      moveCursorTo: function () { return this.getLoginUserInput(); },
      desc: 'Moved to login input box'
    }, {
      action: 'click',  // No target needed, cursor already in the right place
      desc: 'Clicked login input box'
    }, {
      ... // next action
    });

  5. #5
    Sencha User
    Join Date
    Mar 2011
    Posts
    144
    Vote Rating
    3
    incutonez is on a distinguished road

      1  

    Default


    Quote Originally Posted by mankz View Post
    @incutonez: There is a Siesta forum which is open for all, please use that. http://bryntum.com/forum/viewforum.php?f=20. We have a Premium forum too which is just for paying license holders.
    Ah! Ok. I was clicking "Log in" at the top, and "Request access" kept telling me that I had to have paid for my copy... didn't realize I accessed a different page when I clicked "New Topic." Now I look like a prat. Thanks! haha.

    Quote Originally Posted by mankz View Post
    To answer your questions, if you really must use a real native reference to the target you want to type into (a string - Component Query or DOM query is easier to work with) then you can always use a function, to get the target at target execution time.

    Code:
    var loginUserInput;
    t.chain(
    {
      moveCursorTo: function () { return this.getLoginUserInput(); },
      desc: 'Moved to login input box'
    }, {
      action: 'click',  // No target needed, cursor already in the right place
      desc: 'Clicked login input box'
    }, {
      ... // next action
    });
    Ok, interesting. I guess it makes sense why using the object approach doesn't work like I thought it would... I just was in the mindset that chaining went in order, but that's after the fact of it being parsed. Anyway, thanks!

Thread Participants: 2

Tags for this Thread