SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Sep 2004
    Location
    Pune
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    unable to find Dynamically generated HTMLTextfield

    I am trying to add HtmlTextField controls dynamically in the web page.
    The HtmlTextFileld is a set ofarraus for eg
    ^attribute_value_input[1]
    ^attribute_value_input[1]
    ^attribute_value_input[1]
    ^attribute_value_input[1]
    ^attribute_value_input[1]


    HtmlTextField added is assigned an index
    at run time.I tried to add
    Add --///
    and used to in function by passing a control as
    but i run the scripts i get null exception.
    I am not getting where i am going wrong.
    please let me know how to go about this.

    Can you guide me how to handle the controls which are generated at runtime in the wen page.
    Awaiting for you positive reply.

    Regards
    say

  2. #2
    Senior Member
    Join Date
    Sep 2000
    Posts
    200
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: unable to find Dynamically generated HTMLTextfield

    I'm not sure I get you. Why do u want to add a textfield using Silk? Thats the dev's job, to add whatever gui is needed based on the actions performed on the UI, (which probably Silk performs for you)

    Or do u want to FIND OUT a newly added dhtml textfield?
    // =====================
    // The Persistent Bugger
    // =====================

  3. #3
    Junior Member
    Join Date
    Sep 2004
    Location
    Pune
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: unable to find Dynamically generated HTMLTextfield

    Yes ur right,
    our Add field event adds htmltextfield
    in ui at runtime and we add fields and is set of arrays.

    So i need to set text in those fields.

    Thanks
    Shailendra

  4. #4
    Senior Member
    Join Date
    Sep 2000
    Posts
    200
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: unable to find Dynamically generated HTMLTextfield

    Typically, as you go on adding text fields, the number of TextField would go on increasing. You will have to tag these tfs' with the correct index at the runtime to be able to work with it.

    Now, depending the placement of this tf array on the page, the indexing of the tf would vary.
    i.e. if there are other TextFields on this page (eg: 3 nos) which are placed before this array, then the indexes of the tf's in the tf array would start at 4 and go on incrementing

    So you would have to dynamically determine this index based on the indexing logic, then have a window variable like this:

    window wNewTextField = TheBrowserChildWindow.window ("[HTMLTextField]#7")
    and then do a
    wNewTextField.SetText(sText)

    on it.

    HTH,
    Niru
    // =====================
    // The Persistent Bugger
    // =====================

  5. #5
    Senior Member
    Join Date
    Jan 2001
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: unable to find Dynamically generated HTMLTextfield

    I would do it like this very similar to niru's example:

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">//handle when there is only one control (is the index is always used), etc.

    //set the default one
    int index=0

    //declare the reference until the dynamic part
    window myRef = window.staticrefhere

    string refStr = &quot;tagString{index}&quot; //change as required
    myRef.HtmlTextField(refStr).DoSomething()
    ...</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">Need to add WaitForRead() after you add the control (can also FlushCache for Silk to re-examine page in fail-safe case). Always do an check for control existance. Observe how the control indexing works (including boundary conditions). Find the pattern.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 05:30 AM.

Copyright BetaSoft Inc.