Page 1 of 2

FiveWeb question

PostPosted: Thu May 02, 2013 8:54 am
by Otto
Hello Antonio,
is FiveWeb Syntax casesensitiv.


MsgInfo is working
@ 120, 160 BUTTON "One" SIZE 80, 50 OF oDlg ACTION MsgInfo( "test" )

msginfo compiles but then when you click on the button the button does not show a box.
@ 120, 160 BUTTON "One" SIZE 80, 50 OF oDlg ACTION msginfo( "test" )

Best regards,
Otto

Re: FiveWeb question

PostPosted: Thu May 02, 2013 9:06 am
by Antonio Linares
Otto,

Local actions (on the client side) are performed using javascript and javascript is case sensitive

Re: FiveWeb question

PostPosted: Thu May 02, 2013 9:14 am
by Otto
Hello Antonio,
where do you suggest to look up the right spelling.
As you get no error this is for a beginner a pitfall.

Thank you for your work on FIVEWEB.
I decided yesterday to re-write our online booking with FiveWeb.

Best regards,
Otto

Re: FiveWeb question

PostPosted: Thu May 02, 2013 1:03 pm
by Antonio Linares
Otto,

The best tool that I use to check javascript errors, etc. is Chrome itself, as it has a wonderful sort of debugger/inspector that is fantastic! :-)

Just right click on a web page from Chrome and select "inspect element" and there you have a great "Console" option where you see javascript errors, etc.

Besides that, the web is plenty of javascript docs, just google for javascript "something" and you will get tons of info :-)

I will help you with FiveWeb as much as I can. Its not a perfect tool yet but with the help of FiveWeb users it will grow and become a great tool like FiveWin is :-)

Re: FiveWeb question

PostPosted: Thu May 02, 2013 7:39 pm
by Otto
Hello Antonio,

Otto.prg add data

If there is a space on the left or between the names the program errors out.
I made the tests with Chrome.
Best regards,
Otto

http://localhost/Cgi-bin/otto.exe?add:one%20space:one%20space:one%20space

Re: FiveWeb question

PostPosted: Thu May 02, 2013 8:17 pm
by Antonio Linares
Otto,

I think I know whats going on: When you call your EXE with spaces for params, then the app is receiving several params:

function Main( cParam1, cParam2, ... )

If they are all together, then we only get:

function Main( cParams )

thats where the error comes from. We could modify FiveWeb to detect and use both ways :-)

Re: FiveWeb question

PostPosted: Sat May 18, 2013 2:48 am
by kokookao2007
hi Antonio :

I have a question for Fiveweb.

After edit value of tget , can't display new value.

Anything I miss ?

#include "FiveWeb.ch"

function Main()

local oDlg, cTEST:="TEST1234 ",oGET

DEFINE DIALOG oDlg TITLE "Hello FiveWeb" SIZE 600, 400

@ 20, 20 GET oGET VAR cTEST OF oDlg SIZE 300, 40

@ 120, 370 BUTTON "ok" SIZE 120, 50 OF oDlg ACTION ( msginfo( cTEST ) ,oDlg:END() )

ACTIVATE DIALOG oDlg

return nil


Change Value 'TEST1234' to 'TEST5678, msginfo() still display 'TEST1234' .

Re: FiveWeb question

PostPosted: Sat May 18, 2013 6:43 am
by Antonio Linares
Kokoo,

There is something important to learn about FiveWeb:

When you execute your code, xbase is translated into whatever and works :-) but you are no longer in your PRG execution. It happened, then you got your result and you are working locally, using javascript. So think about this: where is the variable defined ? In the PRG. And that code was already processed. Similar like when we create a dialog and run it as non modal. The variables are gone, out of scope :-)

Instead of your code, try:

MsgInfo( oGET.Value )

Re: FiveWeb question

PostPosted: Mon May 20, 2013 12:38 am
by kokookao2007
Hi Antonio:

Thank you for Explanation about Fiveweb.

Tried: msginfo(oGet.Value) ==> compiler error

Tried: msginfo(oGet:nValue) ==> Return Null

Re: FiveWeb question

PostPosted: Mon May 20, 2013 6:20 am
by Antonio Linares
Javascript is case sensitive, so you have to write it exactly like this:

MsgInfo( oGet.value )

Re: FiveWeb question

PostPosted: Wed May 22, 2013 12:30 am
by codemaker
Antonio Linares wrote:Kokoo,

There is something important to learn about FiveWeb:

When you execute your code, xbase is translated into whatever and works :-) but you are no longer in your PRG execution. It happened, then you got your result and you are working locally, using javascript. So think about this: where is the variable defined ? In the PRG. And that code was already processed. Similar like when we create a dialog and run it as non modal. The variables are gone, out of scope :-)

Instead of your code, try:

MsgInfo( oGET.Value )

Yes, this is a very good explanation of what kind of problems we are dealing with, when trying to use the special libraries to design web application.
Practically, each dialog we create and show on the screen, we can imagine/consider as having one HTML with a FORM in it. So once the dialog is shown on the screen, it's like we show the HTML with a form and we cannot go back to this dialog, unless we call the same function again. In this case it is not recursive call like in ordinary desktop application.

From the same reason we cannot see PRIVATE defined variable in a lower function - if we have function:
FUNCTION One()
PRIVATE abc
DEFINE DIALOG oDlg
@ 1,1 GET oGet VAR abc OF oDlg
@ 2,1 BUTTON oBut ACTION checkit()
ACTIVATE DIALOG oDlg
// We are actually here and returned to the calling function!!!!!!!
RETURN(NIL)

FUNCTION Checkit()
? abc // undefined!
RETURN(NIL)

Re: FiveWeb question

PostPosted: Wed May 22, 2013 7:20 am
by Antonio Linares
Boris,

Anyhow we can send info from the client to the server too, so we could update the variable and send it back to the server, but we need to manage "sessions" for that. Something that we have not implemented yet.

Re: FiveWeb question

PostPosted: Wed May 22, 2013 7:27 am
by kokookao2007
HI Antonio:

MsgInfo( oGET.Value )

Compiler error :
Compiling...
testget.prg(15) Error E0030 Syntax error "syntax error at '.'"
Harbour 3.2.0dev (Rev. 18805)
Copyright (c) 1999-2013, http://harbour-project.org/
Compiling 'testget.prg'...
1 error

No code generated.
* Compile errors *

Re: FiveWeb question

PostPosted: Wed May 22, 2013 8:41 am
by Antonio Linares
Kokko,

You have to call it from the ACTION of a control

Re: FiveWeb question

PostPosted: Wed May 22, 2013 10:54 am
by codemaker
Antonio Linares wrote:Boris,

Anyhow we can send info from the client to the server too, so we could update the variable and send it back to the server, but we need to manage "sessions" for that. Something that we have not implemented yet.

You're right Antonio.
But this would require to change the programming logic. In such case we must relay on pure client/server logic to not refresh the entire user's screen every time we need the info about some variable or we change and save variables. On the server there must be an EXE which will receive the requests and deliver back the updated info to the user's screen (something like Data browse in Flex is doing)
Years ago I designed some app (licensing system) which communicates with some EXE running on server and sending back the new info after the request has been managed. Socket class.

Anyway, we all are eager to see the results for FiveWeb you are working on.
Speed it up Antonio, we need it :)