Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

FX.PHP not showing valuelist array

Featured Replies

Hello, I am having a problem with FX.php and getting the 'valuelists' array, it is not showing up I am pretty sure it's a bug in the fx class.. as everything is working perfect.. the code I am using is the standard routine like this:

$InstanceName = new FX('127.0.0.1');

$InstanceName->SetDBData('CDList', 'web_view');

$ReturnedData = $InstanceName->FMView(); // stores layout information in $ReturnedData

foreach ($ReturnedData['valueLists'] as $key => $value) {

foreach ($value as $key1 => $value1) {

$valuelistData[$key] .= "t$value1n";

}

echo "n";

echo $valuelistData[$key];

echo "n";

echo "

n";

}

But it does not return anything, I all ready made sure there was a field using a value list, and also making it a list-menu etc.. but the class will not pass the info on to the array object.. I get a 0, has anybody jumped into this problem? I had no problem when it was FM6 and FX (2002..) but now I have FX 4.2 and FMSA 7v3 and it's not working.. does somebody know a work around?

Thank you and will appreciate any help on this..

Best wishes DT

Is it a "related" ValueList.

Garry

  • Author

no, it's a local static list. I even tried the same thing using the sample book DB found at the FX.php folder and adding a valuelist and then adding it to the list view issued a print and got this:

Array ( [data] => Array ( [1.13] => Array ( [author] => Array ( [0] => Gethrundt, Ivan ) [title] => Array ( [0] => The Collection of Empty Pages ) [number_of_pages] => Array ( [0] => 72 ) [testmenu] => Array ( [0] => Hello ) ) [2.10] => Array ( [author] => Array ( [0] => Hansen, Chris with Adams, Chris ) [title] => Array ( [0] => FX.php ) [number_of_pages] => Array ( [0] => 1 ) [testmenu] => Array ( [0] => ) ) [3.1] => Array ( [author] => Array ( [0] => ) [title] => Array ( [0] => The Artistic License ) [number_of_pages] => Array ( [0] => 1 ) [testmenu] => Array ( [0] => ) ) [4.0] => Array ( [author] => Array ( [0] => Adams, Chris ) [title] => Array ( [0] => PHP Caching Class ) [number_of_pages] => Array ( [0] => 1 ) [testmenu] => Array ( [0] => ) ) [5.1] => Array ( [author] => Array ( [0] => Converse, Tim and Park, Joyce ) [title] => Array ( [0] => PHP 4 Bible ) [number_of_pages] => Array ( [0] => ) [testmenu] => Array ( [0] => ) ) [6.0] => Array ( [author] => Array ( [0] => Bowers, Bob and Lane, Steve ) [title] => Array ( [0] => Advanced FileMaker Pro 6 Web Development ) [number_of_pages] => Array ( [0] => 438 ) [testmenu] => Array ( [0] => ) ) [7.2] => Array ( [author] => Array ( [0] => Hansen, Chris ) [title] => Array ( [0] => www.iViking.org ) [number_of_pages] => Array ( [0] => 10 ) [testmenu] => Array ( [0] => ) ) ) [linkNext] => [linkPrevious] => [foundCount] => 7 [fields] => Array ( [0] => Array ( [emptyok] => YES [maxrepeat] => 1 [name] => author [type] => TEXT [extra] => ) [1] => Array ( [emptyok] => YES [maxrepeat] => 1 [name] => title [type] => TEXT [extra] => ) [2] => Array ( [emptyok] => YES [maxrepeat] => 1 [name] => number_of_pages [type] => NUMBER [extra] => ) [3] => Array ( [emptyok] => YES [maxrepeat] => 1 [name] => testmenu [type] => TEXT [extra] => ) ) => http://Admin:@192.168.1.30:80/fmi/xml/FMPXMLRESULT.xml?-db=Book_List.fp7&-lay=Book_List&-max=50&-findall [query] => [errorCode] => 0 [valueLists] => Array ( ) )

See that the last element " [valueLists] => Array ( ) )" does not have anything? .. it's very strange.. and if I delete all fields from the layout and just leave that one field with a menu, I will get an error like:

fx_error Object ( [error_message_prefix] => [mode] => 1 [level] => 1024 [code] => 100 [message] => FX: ExecuteQuery XML error: mismatched tag at line 6 [userinfo] => [backtrace] => Array ( [0] => Array ( [file] =>  fmview [class] => fx [type] => -> [args] => Array ( ) ) ) [callback] => )

I am now having to create a work arround using global fields and scripts to set the field values on them and then use javscript to popuate menus on the web pages... (I think it will work but would REALLY like FX.php to work..

Edited by Guest

Does an FMFindany() make a difference?

Garry

Gary beat me to the answer.

You need to use FMFindany() rather than FMView()

To make valuelists show up. I had a similar problem.

  • Author

Thanks everybody.. I changed it to -FMview() and it worked.. I was using -find, I know it's contrary to what you recommend but actually according to the documentation it says that it will work for -FMView(), but it did not said that it did exclusively.. that was the mistake. So, it seems you are getting it to work with findall()? that's interesting.. I somewhat assumed that the listvalues array got populated in any mode..

Thanks again..

DT

interesting. Glad to hear you got it working.

I needed to use Findany() to make it work. Findall() may work but would be quite a bit slower.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.