FiveWeb Questions

User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Re: FiveWeb Questions

Post 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

? '<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

...ACTION ('document.getElementById( "oGetTest" ).value=oGetTest.value+" "+"Some new text" ')
Thanks,
Jeff Barnes

(FWH 12.01, xHarbour 1.2.1, Bcc582)
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: FiveWeb Questions

Post by Antonio Linares »

very good,

thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Re: FiveWeb Questions

Post 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 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.
If I leave off the + aData 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

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 12.01, xHarbour 1.2.1, Bcc582)
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: FiveWeb Questions

Post by Antonio Linares »

Jeff,

Try it this way:

Code: Select all

       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
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Re: FiveWeb Questions

Post 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

ACTION ('window.opener.document.getElementById("oGetInterp").value=window.opener.document.getElementById("oGetInterp").value+" "+"'+aData[I]+'"'   ) 
 
Thanks,
Jeff Barnes

(FWH 12.01, xHarbour 1.2.1, Bcc582)
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: FiveWeb Questions

Post by Antonio Linares »

very good :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Re: FiveWeb Questions

Post 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 ?
Thanks,
Jeff Barnes

(FWH 12.01, xHarbour 1.2.1, Bcc582)
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: FiveWeb Questions

Post 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 )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Re: FiveWeb Questions

Post by Jeff Barnes »

Hi Antonio,

I tried your suggestion by adding the StrTran() to the action clause of my save button:

Code: Select all

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 12.01, xHarbour 1.2.1, Bcc582)
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: FiveWeb Questions

Post by Antonio Linares »

We have to use a javascript StrTran():

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

Antonio Linares
www.fivetechsoft.com
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Re: FiveWeb Questions

Post 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

'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 12.01, xHarbour 1.2.1, Bcc582)
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: FiveWeb Questions

Post by Antonio Linares »

Very good

You are becoming a FiveWeb master ;-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Re: FiveWeb Questions

Post by Jeff Barnes »

It's a team effort :)
Thanks,
Jeff Barnes

(FWH 12.01, xHarbour 1.2.1, Bcc582)
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Re: FiveWeb Questions

Post 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.
Thanks,
Jeff Barnes

(FWH 12.01, xHarbour 1.2.1, Bcc582)
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: FiveWeb Questions

Post by Antonio Linares »

Jeff,

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

Code: Select all

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
Post Reply