Page 8 of 10
Re: FiveWeb Questions
Posted: Sun Mar 27, 2016 11:33 pm
by Jeff Barnes
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: Select all | Expand
? '<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: Select all | Expand
...ACTION ('document.getElementById( "oGetTest" ).value=oGetTest.value+" "+"Some new text" ')
Re: FiveWeb Questions
Posted: Mon Mar 28, 2016 6:37 am
by Antonio Linares
very good,
thanks
Re: FiveWeb Questions
Posted: Wed Mar 30, 2016 12:41 am
by Jeff Barnes
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: Select all | Expand
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
Re: FiveWeb Questions
Posted: Wed Mar 30, 2016 6:16 am
by Antonio Linares
Jeff,
Try it this way:
Code: Select all | Expand
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
Re: FiveWeb Questions
Posted: Wed Mar 30, 2016 10:55 am
by Jeff Barnes
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: Select all | Expand
ACTION ('window.opener.document.getElementById("oGetInterp").value=window.opener.document.getElementById("oGetInterp").value+" "+"'+aData[I]+'"' )
Re: FiveWeb Questions
Posted: Wed Mar 30, 2016 10:57 am
by Antonio Linares
very good

Re: FiveWeb Questions
Posted: Sun Apr 10, 2016 11:30 pm
by Jeff Barnes
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 ?
Re: FiveWeb Questions
Posted: Mon Apr 11, 2016 7:32 am
by Antonio Linares
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 )
Re: FiveWeb Questions
Posted: Mon Apr 11, 2016 2:10 pm
by Jeff Barnes
Hi Antonio,
I tried your suggestion by adding the StrTran() to the action clause of my save button:
Code: Select all | Expand
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.
Re: FiveWeb Questions
Posted: Mon Apr 11, 2016 7:34 pm
by Antonio Linares
We have to use a javascript StrTran():
document.getElementById( "oGetTest" ).value.trim().replace( "\r\n", "::" );
Re: FiveWeb Questions
Posted: Tue Apr 12, 2016 3:47 pm
by Jeff Barnes
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: Select all | Expand
'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

Re: FiveWeb Questions
Posted: Tue Apr 12, 2016 3:58 pm
by Antonio Linares
Very good
You are becoming a FiveWeb master

Re: FiveWeb Questions
Posted: Tue Apr 12, 2016 5:06 pm
by Jeff Barnes
It's a team effort

Re: FiveWeb Questions
Posted: Mon May 02, 2016 11:57 pm
by Jeff Barnes
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.
Re: FiveWeb Questions
Posted: Tue May 03, 2016 7:44 am
by Antonio Linares
Jeff,
You can download these files and change their locations in this FiveWeb function: (source/function/fiveweb.prg)
Code: Select all | Expand
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