FiveWeb Questions

Re: FiveWeb Questions

Postby Jeff Barnes » 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: Select all  Expand view
? '<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 view
...ACTION ('document.getElementById( "oGetTest" ).value=oGetTest.value+" "+"Some new text" ')
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: FiveWeb Questions

Postby Antonio Linares » Mon Mar 28, 2016 6:37 am

very good,

thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41462
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveWeb Questions

Postby Jeff Barnes » 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: Select all  Expand view

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

Re: FiveWeb Questions

Postby Antonio Linares » Wed Mar 30, 2016 6:16 am

Jeff,

Try it this way:

Code: Select all  Expand view

       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
Antonio Linares
Site Admin
 
Posts: 41462
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveWeb Questions

Postby Jeff Barnes » 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: Select all  Expand view

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

Re: FiveWeb Questions

Postby Antonio Linares » Wed Mar 30, 2016 10:57 am

very good :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41462
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveWeb Questions

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

Re: FiveWeb Questions

Postby Antonio Linares » Mon Apr 11, 2016 7: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41462
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveWeb Questions

Postby Jeff Barnes » Mon Apr 11, 2016 2:10 pm

Hi Antonio,

I tried your suggestion by adding the StrTran() to the action clause of my save button:
Code: Select all  Expand view
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)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: FiveWeb Questions

Postby Antonio Linares » Mon Apr 11, 2016 7:34 pm

We have to use a javascript StrTran():

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41462
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveWeb Questions

Postby Jeff Barnes » Tue Apr 12, 2016 3: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: Select all  Expand view
'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)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: FiveWeb Questions

Postby Antonio Linares » Tue Apr 12, 2016 3:58 pm

Very good

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41462
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveWeb Questions

Postby Jeff Barnes » Tue Apr 12, 2016 5:06 pm

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

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: FiveWeb Questions

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

Re: FiveWeb Questions

Postby Antonio Linares » Tue May 03, 2016 7:44 am

Jeff,

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

Code: Select all  Expand view

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
User avatar
Antonio Linares
Site Admin
 
Posts: 41462
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 132 guests