widget:editvalues problem

A place for users and developers of the Xataface to discuss and receive support.

Postby meikel » Mon Oct 15, 2007 7:04 am

Hi Steve,
I'm getting following error message (in java console of FireFox) when trying to enter a new "PlateStockSize" or "PSName":
"Error: unterminated regular expression literal
Source File: http://10.3.0.202/dataface/plone_javascripts.js
Line: 816, Column: 15
Source Code:
Fatal error: Attempt to get relationship nonexistent 'PlateStockSizes' from table 'PlateStockSizes'"

Please find below a snip from my fields.ini
-------------------
[PlateName]
widget:type = select
vocabulary = PSNames
widget:editvalues = 1

[PlateSize]
widget:type = select
vocabulary = PlateStockSizes
widget:editvalues = 1
-------------------

...and my valuelists.ini
-------------------
[PSNames]
__sql__ = "select PlateNameID, PlateName from PlateStockNames ORDER by PlateName"

[PlateStockSizes]
__sql__ = "select PlateSizeID, PlateSize from PlateStockSizes ORDER by PlateSize"
-------------------

All tables are in the same database, but there's no relationships.ini. Maybe the missing relationships.ini is already the reason for above error?



TIA for your help
kind regards
meikel
meikel
 
Posts: 17
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Mon Oct 15, 2007 11:20 am

So the valuelists.ini file. Is it located in the same directory as the fields.ini file? And to which table do they belong?
relationships.ini file shouldn't be necessary.

If you could post the relevant directory structure, that might help.

-Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby meikel » Mon Oct 15, 2007 2:07 pm

valuelists.ini is in the same directory as fields.ini. They both belong to a third table in which I'd like to put information from the other (above mentioned) two tables...

meikel
meikel
 
Posts: 17
Joined: Wed Dec 31, 1969 5:00 pm

Postby meikel » Mon Oct 15, 2007 2:07 pm

valuelists.ini is in the same directory as fields.ini. They both belong to a third table in which I'd like to put information from the other (above mentioned) two tables...

meikel
meikel
 
Posts: 17
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Tue Oct 16, 2007 3:23 pm

Hi Meikel,

This is a tricky one to debug from my vantage point. I can't seem to reproduce the problem on my end. Any chance you can:
a. send me the app to try to look at (including the db).
or
b. Give me temporary access to the app (ftp access so I can edit the source) so I can do some debugging and find the problem.

(b is preferred because it saves me the set-up time).

Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby meikel » Wed Oct 17, 2007 11:31 am

Hey Steve,
this site has no direct internet access (intranet :(()
Is there any chance you provide me with a simplified or existing setup, so that I can just compare and find out what is wrong on my side?


TIA and kindest regards
meikel
meikel
 
Posts: 17
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Wed Oct 17, 2007 10:44 pm

Unfortunately the setup that you described should work properly. An an example set up though, if you installed the LibraryDB application and set the widget:editvalues directive on the borrower_id field in the books table, it works on my test systems.

-Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby meikel » Thu Oct 18, 2007 6:15 am

Hi Steve,
thanks for your prompt reply. I put now a small version of my setup in my folder on the Plone server. I gave you permissions (at least I hope I did ;))


Thanks again for looking into this
kind regards
meikel
meikel
 
Posts: 17
Joined: Wed Dec 31, 1969 5:00 pm

Re: widget:editvalues problem

Postby fantomasdm » Thu Feb 24, 2011 4:56 am

Hi, with widget:editvalues=1 after add a new value, the new item is not visible in select box, I have to refresh page to see it!
Is possible an auto-refresh after add a new value?
fantomasdm
 
Posts: 114
Joined: Thu Mar 13, 2008 2:35 pm

Re: widget:editvalues problem

Postby shannah » Sat Feb 26, 2011 1:04 pm

What version of Xataface are you using? It should automatically add it to the select list (it may be at the end of the list - or the beginning... can't remember).

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: widget:editvalues problem

Postby fantomasdm » Sun Feb 27, 2011 10:47 am

I'm using 1.2.6
fantomasdm
 
Posts: 114
Joined: Thu Mar 13, 2008 2:35 pm

Re: widget:editvalues problem

Postby fantomasdm » Tue Apr 05, 2011 6:32 am

Hi, I find problem:
file Dataface\JSON.php
and actions\ajax_valuelist_append.php
I change Dataface\JSON.php in:
Code: Select all
<?php
class JSON {

   public static function notice($msg){
      return self::init(array('notice'=>$msg, 'success'=>0, 'msg'=>$msg));
   }
   
   public static function warning($msg){
      return self::init(array('warning'=>$msg, 'success'=>0, 'msg'=>$msg));
   }
   
   public static function error($msg){
      return self::init(array('error'=>$msg, 'success'=>0, 'msg'=>$msg));
   }
   
        public static function init($arr){
      import('Services/JSON.php');
      $json = new Services_JSON();
      return $json->encode($arr);}
       
   public  function json($arr){
      import('Services/JSON.php');
      $json = new Services_JSON();
      return $json->encode($arr);
      /*
      if ( is_array($arr) ){
         $out = array();
         foreach ( $arr as $key=>$val){
            $out[] = "'".addslashes($key)."': ".JSON::json($val);
         }
         return "{".implode(', ', $out)."}";
      } else if ( is_int($arr) || is_float($arr) ){
         return $arr;
      } else if ( is_bool($arr) ){
         return ( $arr?'1':'0');
      } else {
         return "'".addslashes($arr)."'";
      }
      */
   }
}


and actions\ajax_valuelist_append.php at line 39 in
Code: Select all
echo JSON::init(array(
         'success'=>1,
         'value'=>array('key'=>$res['key'], 'value'=>$res['value'])
         )
      );


But with this code we need to change all JSON::json -> JSON::init
I don't know where is other call to JSON::json
fantomasdm
 
Posts: 114
Joined: Thu Mar 13, 2008 2:35 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 14 guests

Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved