FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FiveWeb Questions
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: FiveWeb Questions
Posted: Sun Mar 27, 2016 11:33 PM
Just for those who are following this......

For using enter to activate a button (I added this after the "activate" clause for the dialog):
Code (fw): Select all Collapse
? '<script>$("#oDlg").keydown(function (event) { if (event.keyCode == 13) { $(this).parent() .find("button:eq(0)").trigger("click"); return false; } });</script>'


To update a text field (I used a button in this example):
Code (fw): Select all Collapse
...ACTION ('document.getElementById( "oGetTest" ).value=oGetTest.value+" "+"Some new text" ')
Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: FiveWeb Questions
Posted: Mon Mar 28, 2016 06:37 AM

very good,

thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: FiveWeb Questions
Posted: Wed Mar 30, 2016 12:41 AM
Hi Antonio,

Need some help with syntax...

I am trying to create a bunch of buttons with the text in aData.
The text on the button part work fine.

The code below will send text from one browser window to its parent.
The last part (where is has aData[I] at the end of the ACTION line) is where I am having issues. I cant seem to get it to give me the text in aData[I].
If I leave off the + aData[I] and just place text in the quotes (.value+" some text") it will send the " some test" to the parent window.

Can you see where I am going wrong???

I hope I have explained this clearly.

Code (fw): Select all Collapse
Function Test()
   LOCAL I, aData:={}

   FOR I = 1 to 30
    aadd( aData,"Some text #"+STR(I) )
   NEXT

   DEFINE DIALOG oDlg1 TITLE "Test" SIZE 1100, 400
         FOR I = 1 to LEN(aData)
       @ nRow, 19 BUTTON aData[I]  SIZE 600, 40 OF oDlg1 ;
                ACTION ('window.opener.document.getElementById("oGetInterp").value=window.opener.document.getElementById("oGetInterp").value+" " + aData[I] ' ) 
           nRow = nRow + 50 
    NEXT
   ACTIVATE DIALOG oDgl1
Return Nil
Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: FiveWeb Questions
Posted: Wed Mar 30, 2016 06:16 AM
Jeff,

Try it this way:

Code (fw): Select all Collapse
       FOR I = 1 to LEN(aData)
          @ nRow, 19 BUTTON aData[I]  SIZE 600, 40 OF oDlg1 ACTION ""
          nRow = nRow + 50 
          aData[ I ]:cAction = 'window.opener.document.getElementById("oGetInterp").value=window.opener.document.getElementById("oGetInterp").value' + " " + aData[ I ]
      NEXT
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: FiveWeb Questions
Posted: Wed Mar 30, 2016 10:55 AM
That didn't work, but I did get it working (just needed to walk away from it for a while)

Here is the ACTION part of the button that solved the problem:

Code (fw): Select all Collapse
ACTION ('window.opener.document.getElementById("oGetInterp").value=window.opener.document.getElementById("oGetInterp").value+" "+"'+aData[I]+'"'   )
Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: FiveWeb Questions
Posted: Wed Mar 30, 2016 10:57 AM

very good :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: FiveWeb Questions
Posted: Sun Apr 10, 2016 11:30 PM

For a multiline get...

If I enter some text in the multiline get with items on a separate line like:
Test line 1.
Test line 2.
Test line 3.
Test line 4.

When I save the data and then display it again it comes out as:
Test line 1.Test line 2.Test line 3.Test line 4.

I'm guessing this is because the data is being passed in the url and the url isn't able to handle the CRLF.

Is there any way to keep the formatting when passing it via a url ?

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: FiveWeb Questions
Posted: Mon Apr 11, 2016 07:32 AM

Jeff,

Before sending the text to the server, try to replace the CRLF with a different value:

StrTran( cText, CRLF, "//" )

use "//" or similar

from the server you do the opposite:

StrTran( cText, "//", CRLF )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: FiveWeb Questions
Posted: Mon Apr 11, 2016 02:10 PM
Hi Antonio,

I tried your suggestion by adding the StrTran() to the action clause of my save button:
Code (fw): Select all Collapse
StrTran('document.getElementById( "oGetTest" ).value.trim() + "::" + ', CRLF, "==")+ ;


When I look in my dbf file I do not see the "==" in the memo field.
All I see is:
Test line 1.Test line 2.Test line 3.Test line 4.
Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: FiveWeb Questions
Posted: Mon Apr 11, 2016 07:34 PM

We have to use a javascript StrTran():

document.getElementById( "oGetTest" ).value.trim().replace( "\r\n", "::" );

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: FiveWeb Questions
Posted: Tue Apr 12, 2016 03:47 PM
Hi Antonio,

It didn't work however, once you put me on track with the Replace() function I was able to get it working using:

Code (fw): Select all Collapse
'document.getElementById( "oGetInterp" ).value.trim().replace(/\n/g,"XxX") + "::" + '+ ;



Then in my save routine I used StrTran() to replace "XxX" with the standard CRLF.

Works like a charm :-)
Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: FiveWeb Questions
Posted: Tue Apr 12, 2016 03:58 PM

Very good

You are becoming a FiveWeb master ;-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: FiveWeb Questions
Posted: Tue Apr 12, 2016 05:06 PM

It's a team effort :)

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: FiveWeb Questions
Posted: Mon May 02, 2016 11:57 PM

Hi Antonio,

Going back to the question about the script and css files that FiveWeb currently grabs from the internet....

Is there anyway to embed these info FiveWeb itself?

Here is where I can see future issues...
Let's say I create an app. Then I install this app at different customers. If there internet is down or they just want to run the app internally it causes problems.

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: FiveWeb Questions
Posted: Tue May 03, 2016 07:44 AM
Jeff,

You can download these files and change their locations in this FiveWeb function: (source/function/fiveweb.prg)

Code (fw): Select all Collapse
function IncludeScripts()

   ? '<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>'
   ? '<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.0/jquery-ui.min.js"></script>'
   ? '<script src="https://fiveweb.googlecode.com/svn/trunk/source/js/fiveweb.js"></script>'
   ? '<script src="https://bitbucket.org/fivetech/fiveweb/downloads/jquery.maskedinput.js"></script>'   
   
return nil


I can move all them to bitbucket if you want to
regards, saludos

Antonio Linares
www.fivetechsoft.com