Page 2 of 10
Re: FiveWeb Questions
Posted: Fri Jan 29, 2016 1:04 pm
by Jeff Barnes
Hi Antonio,
Folders now working

A couple of things I noticed:
1. When using folders the "Picture" clause on gets no longer seem to work.
2. "Mulitline" does not work on gets
Re: FiveWeb Questions
Posted: Fri Jan 29, 2016 7:03 pm
by Antonio Linares
Jeff,
1. Fixed
2. I just implemented it
Please download the new version from here:
https://bitbucket.org/fivetech/fiveweb/downloadsThere is a new samples\testmemo.prg
Code: Select all | Expand
#include "FiveWeb.ch"
function Main()
local oDlg, cText := PadR( "This is a text", 50 )
DEFINE DIALOG oDlg
@ 10, 10 GET cText MULTILINE OF oDlg SIZE 300, 200
ACTIVATE DIALOG oDlg CENTERED
return nil
Re: FiveWeb Questions
Posted: Fri Jan 29, 2016 7:13 pm
by Antonio Linares
You can test samples\testmemo.prg from here:
http://www.fivetechsoft.net/cgi-bin/testmemo
Re: FiveWeb Questions
Posted: Wed Feb 03, 2016 7:13 pm
by Jeff Barnes
Hi Antonio,
Got the new version installed.
Looks like ComboBox and Checkbox might be ok in a typical dialog but not with folders.
It will not place them at the specified row/col when in a folder.
Also, would it be possible to add the "WHEN" clause to Buttons?
Please try this sample:
Code: Select all | Expand
#include "FiveWeb.ch"
function Main()
local oDlg, oCbx, cValue := "two"
local oFld
DEFINE DIALOG oDlg TITLE "Using a combobox"
@ 0, 0 FOLDER oFld PROMPTS "One","Two" SIZE 500, 560 OF oDlg
@ 130, 60 COMBOBOX oCbx VAR cValue ITEMS "one", "two", "three" OF oFld:aDialogs[1]
@ 200, 120 BUTTON "Ok" OF oFld:aDialogs[1] ACTION alert( oCbx.value )
ACTIVATE DIALOG oDlg NOWAIT
return nil
Re: FiveWeb Questions
Posted: Wed Feb 03, 2016 7:56 pm
by Antonio Linares
Jeff,
Here it looks ok:

What WHEN expression do you plan to use ? I mean, is it an expression to evaluate in the server
or in the browser ?
Re: FiveWeb Questions
Posted: Wed Feb 03, 2016 8:55 pm
by Jeff Barnes
Hi Antonio,
Try it again and look at where it "should" be placing the control:
@ 130, 60 COMBOBOX oCbx VAR cValue ITEMS "one", "two", "three" OF oFld:aDialogs[1]
As for the button, I would like to be able to disable the button (but still show it on the screen).
Basically I want to be able to do something like:
lSave := .f.
Then in the button line:
@ x,y Button "Save" of oDlg Action SomeAction() WHEN lSave
Re: FiveWeb Questions
Posted: Thu Feb 04, 2016 8:34 am
by Antonio Linares
Jeff,
* Fixed COMBOBOX location
* Added support for ... BUTTON ... WHEN ...
Please download FiveWeb again from:
https://bitbucket.org/fivetech/fiveweb/downloads
Re: FiveWeb Questions
Posted: Fri Feb 05, 2016 7:59 pm
by Jeff Barnes
Hi Antonio,
When I try to send the data from the combobox it doesn't seem to work.
Gets work with:
'document.getElementById( "oGet26" ).value.trim() + ":" + '+ ;
But combobox does not:
'document.getElementById( "oCbx" ).value.trim() + ":" + '+ ;
Re: FiveWeb Questions
Posted: Fri Feb 05, 2016 9:02 pm
by Jeff Barnes
Also,
How would I properly set up a "Browse" so when I click an item will send the "Record Number" for the item clicked ?
Re: FiveWeb Questions
Posted: Fri Feb 05, 2016 11:34 pm
by Antonio Linares
Jeff,
Jeff Barnes wrote:Hi Antonio,
When I try to send the data from the combobox it doesn't seem to work.
Gets work with:
'document.getElementById( "oGet26" ).value.trim() + ":" + '+ ;
But combobox does not:
'document.getElementById( "oCbx" ).value.trim() + ":" + '+ ;
Please try this:
'document.getElementById( "combobox" ).value.trim() + ":" + '+ ;
if it works, then we may need to make a little change in Class TComboBox, so each combobox control
uses a different Id
Re: FiveWeb Questions
Posted: Fri Feb 05, 2016 11:42 pm
by Antonio Linares
Jeff,
Jeff Barnes wrote:Also,
How would I properly set up a "Browse" so when I click an item will send the "Record Number" for the item clicked ?
Please review this lines from samples\otto.prg:
Code: Select all | Expand
@ 10, 10 BROWSE oBrw SIZE 500, 400 OF oDlg ARRAY aDatos
oBrw:cAction:= "Edita"
oBrw:cClassTable:= "" //"browse"
oBrw:cClassLine:="linea"
obrw:cClassHead:= "boxtitulo"
oBrw:lZebra:= .t.
oBrw:CreateFromCode()
In class TBrowse we have this:
Code: Select all | Expand
if(Empty(::cAction),'', ' onDblClick="'+"document.location = '"+(appname())+"?"+::cAction+":"+alltrim(str(x))+":"+alltrim(str(n )) +"'" +'"' )+;
so onDblClick the record number will be automatically provided as a parameter
Re: FiveWeb Questions
Posted: Sat Feb 06, 2016 11:49 am
by Jeff Barnes
Hi Antonio,
For the combobox, this seems to work:
'document.getElementById( "combobox" ).value.trim() + ":" + '+ ;
For the Browse, I have tried Otto's example however it returns the item number in the order of the list (array).
If I build the array using a filtered list from my DBF the number returned does not line up with the record number in the DBF.
A very basic example:
If my DBF has 3 items
Item1
Item2
Item3
And I do something like:
Code: Select all | Expand
IF LEN( aData ) = 0
USE \mydata\TestDB SHARED NEW
aadd( aData, {"A"} )
go top
do while ! eof()
aadd(aData,{TestDB->A } )
skip 2
enddo
CLOSE TestDB
ENDIF
My list in the browse will have:
Item1 (Record #1)
Item3 (Record #3)
If I double click on ITEM3 it will send ".....edittest:
3:1".
I understand that the first number returned will be the line in the list and the second number is the cell location.
So, subtracting 1 from the first number (done to compensate for the header added to the array) will give me "2" which will display the info from the wrong record.
Re: FiveWeb Questions
Posted: Sat Feb 06, 2016 12:06 pm
by Antonio Linares
Jeff,
you could modify browse.prg source code so it provides you the info that you need
Re: FiveWeb Questions
Posted: Sat Feb 06, 2016 1:27 pm
by Jeff Barnes
Perfect. Modified the Browse.prg and can get what I need now. Thanks.
Re: FiveWeb Questions
Posted: Sat Feb 06, 2016 8:48 pm
by Antonio Linares
very good!
