Jump to content

david600320@hotmail.com

uniGUI Subscriber
  • Posts

    65
  • Joined

  • Last visited

  • Days Won

    5

Posts posted by david600320@hotmail.com

  1. Hi, 

     

    do like ;

     

              UniURLFrame1.HTML.Clear;
              UniURLFrame1.HTML.Add(FieldByName('Contrato').AsString);
              UniURLFrame1.Refresh;
     
    In your code , you have cleared  UniURLFrame1.HTML .Text .
    so, you got same results on every clicked. 
     
    Sincerely .
  2. Thanks a lot , ganzqgy

    with your kind helps, I can understand how to get elements and function even vars from content of html .

    Tonight , I will try those what you support.  

    thanks again , good luck !! 

  3. Thanks ganzqgy ,

     

    BTW , please explain more .

     

    I changed

    from   ajaxRequest( MainForm.mainURLFrame , "goMenu", ['menu_id='+menu_id]);  

    to      ajaxRequest( top.MainForm, "goMenu", ['menu_id='+menu_id]);

     

    and  changed  

    from 
     procedure TMainForm.mainURLFrameAjaxEvent(Sender: TComponent;
      EventName: string; Params: TStrings);

     

    to 
    procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string;
      Params: TStrings);
    begin
          showMessage( EventName ) ;
    end;
     
    but it dosen't work .
  4. thanks ,

     

    * case 1 : Using uniHTMLFrame  ----- it works well 

    * case 2 : Using uniURLFrame    ----- it dosen't work . ( I need ur helps ) -- How can i solve this problem ? 

     

    1. index.html (it's loaded in uniURLFrame )

     

    <!doctype html>
    <html>
    <head>
        <title>My Page</title>
        <meta name="viewport" content="width=device-width, initial-scale=1">
    </head>
     
    <body>
     
           <div id="home" data-role="page">
            <div data-role="header" data-theme="c">
                <h1> Test  </h1>
                <a href=# data-icon="home" class="ui-btn-left" onclick="goMenu(0);">Login</a>
                
            </div><!-- /header -->
     
            <div data-role="content">
                <ul data-role="listview" data-inset="true" data-filter="false">
                    <li  data-role="list-divider">Menu</li>
                    <li><a href="#" onclick="goMenu(1000);">menu_1000</a></li>
                    <li><a href="#" onclick="goMenu(2000);">menu_2000</a></li>
                </ul> 
                
            </div><!-- /content -->
     
            <div data-role="footer"  data-position="fixed" data-theme="c">
                <h4>JQuery mobile Test </h4>
            </div><!-- /footer -->
     
    </body>
     
    </html>

     

    <script type="text/javascript">
          function goMenu(menu_id) {
             
             // not fire any event in MainForm 
             ajaxRequest( MainForm.mainURLFrame , "goMenu", ['menu_id='+menu_id]);        // Everybody 
          }
    </script>
     
     
    2.  To get AjaxEvent in MainForm   
     
     
    procedure TMainForm.mainURLFrameAjaxEvent(Sender: TComponent;
      EventName: string; Params: TStrings);
    var
        menu_id : integer  ;
        data_id : integer  ;
        search_key : String ;
     
    begin
        
         if EventName='goMenu' then begin
            menu_id := StrToInt(Params.Values['menu_id']) ;
            mainmenu( menu_id );      // go to any function 
         end ;
     

    end ;

     

     

     

     

     

     

     

  5. Hi  !!
     
    I am very happy to meet uniGUI what is realy nice web developing framework !!
     
    > I am newbie in Javascript and uniGui .  
    thanks for your sharing !!
    > Delphi XE2 , uniGui 0.93.1.1000
     
    > I have a scenario to make an mobile app using JQuery mobile in uniURLFrame of uniGui .
      ( JQ menu in index.html -> menu click -> check it on  javascript (ajaxrequest) -> contol in mainForm -> creating html for body -> show )
      * it works well in uniHTMLFrame as scenario .
     
       the reason  why i prefer to use uniURLFrame . 
     
       1.  uniURLFrame is faster than uniHTMLFrame without blinking when changing screen .
       2.  uniURLFrame can be used/put on the same form  but uniHTMLFrame only one even same project . 
     
    > As you know , we can't call any event from javascript in uniURLFrame .
    >  Farshad says that  There are techniques to communicate between an <iframe> and its owner. Search web for your answer.
       BTW , i don't know how to do that . 
     
    Q1. Is it possible to get event from javasript on using uniURLFrame ?  

     

    Q2. Can it (Hayri's code) be applied  uniURLFrame to get event ? 

     

      data.Clear;
      data.Add('$(document).ready(function(){  ');
      data.Add(' window.MyFunction =  function MyFunction(a) { ');
      data.Add(Format('ajaxRequest(%s, "Menuclicked", ["menuid="+a]);',   [TForm(MyForm).Name+'.'+TUniHTMLFrame(self).Name]) );
      data.Add('}');
      data.Add('});');
      UniSession.AddJS(data.Text);

     

    Q3. can i use many uniHTMLFrame in a Form ? ( uniURLFrame can )  

     

     

    thanks for helps !! 

×
×
  • Create New...