*** dimas has quit IRC *** derek has joined #gnuenterprise *** btami has joined #gnuenterprise *** ayers has joined #gnuenterprise *** reinhard has joined #gnuenterprise good morning good morning! *** kilo has joined #gnuenterprise off to customer wish you the best.... *** kilo has quit IRC back Cool ... I've got a question. I've created my custom forms (yeah!) I've also got my input trigger (PRE-FOCUSOUT) working (yeah! yeah!) but now I would like the form to "remember" the input values for some fields and preset them when a new object is created. This seems "trivial" for plaing values. But I actually want to set "objects" from the datasources s/plaing/plain/ So I starting with a block PRE-COMMIT trigger I'm assuming self is the current block objects live in server land there are no objects on the client (form) side OK.. so I guess I need to cache the foreign keys then... yes there is some magic setting in forms that tells the form to initialize a new record with the values of the last saved record IIRC is that what you want? Yes! But only for some fields! * ayers searches the forms documentation again.... Sounds perfect! Let me try... Yes! Cool! Thanks... Now I need to look up on positioning the cursor when a new record is created.... that's something like setFocus or set_focus from the technotes: - setFocus(object) move the focus/cursor to object I suppose the object is the field it can be the field or the entry OK... I'm doing something wrong,,, maybe ON-NEWRECORD is called a bit too early... or I'm trying to call the method on the wrong object. I've got: self.setFocus(blkMaster.fldAdmScanentry) Ant that raises an Exception: File "<.ON-NEWRECORD>", line 9, in ON_NEWRECORD TypeError: 'NoneType' object is not callable If I drop self then I get: File "<.ON-NEWRECORD>", line 9, in ON_NEWRECORD File "/usr/local/src/svn/gnue/gnue/.svndevelbase/gnue/forms/GFForm.py", line 1969, in __trigger_set_focus self.__find_and_change_focus([object._object], False) ... ... File "/usr/local/src/svn/gnue/gnue/.svndevelbase/gnue/common/datasources/drivers/Base/ResultSet.py", line 177, in __getitem__ raise IndexError IndexError BTW: http://blog.wired.com/27bstroke6/hans_reiser_trial/#49144716 setFocus is a function of the form so the "self" is not correct can you try to set the focus to the entry rather than the field? I currently have the trigger in the block... should I try to retrieve the form from the block first? I see that there is an _form ivar but I'm not finding a real accessor method... I guess I could do the same a GFObj does... i.e.: self.findParentOfType('GFForm') ok self seems to be the block: form.GFLogic88c646c.blkMaster My problem isn't so much the paramter of the setFocus method (i.e. entry vs. field) but obtaining a valid recieiver... well now I do have the block (still need to get the form) Actaully the problem seems to be with the initialization of the ON-NEWRECORD trigger. self._form is None and self.findParentOfType('GFForm') raises Actuall no.. it doesn't raise. It also returns None ayers: the form is always there in the global "form" variable in trigger namespace so you can do form.setFocus(...) I think the issue you have is related to form startup me too File "/usr/local/src/svn/gnue/gnue/.svndevelbase/gnue/forms/GFObjects/GFBlock.py", line 867, in get_record_status rec = self.__resultset[record_number] File "/usr/local/src/svn/gnue/gnue/.svndevelbase/gnue/common/datasources/drivers/Base/ResultSet.py", line 177, in __getitem__ raise IndexError IndexError at the point when ON-NEWRECORD runs first, the form is not yet built Let me try to add a test for 'form' hmmm actually this should work, the block should only be populated after the form is created print form in the trigger prints: "form" print self.form is None * ayers looks up python introspection utilities type(form) says: that's correct uh did you use self.form? that's not available AFAICT there is a global variable form I also tried self.from but only as an adhoc "let's see if this works" hack Right now I've been testing with plain "form" s/self.from/self.form/ well let me try if I can reproduce the problem I can send you an updated tarball if you like? But I think the problem should be generic. blk_customer.name = "Freak" this seems to work for me oh you try a setFocus discussing so long about this problem that I forgot what the problem was ;-) hehe :-) yes the trigger get's executed And I'm looking for the "Form" I can reproduce the problem but those annoying customers keep calling me on the phone ;-) ok, got the problem ON-NEWRECORD runs when the record is built *before* it is put into the display so while you can set values in ON-NEWRECORD perfectly the record is not displayed yet so on starting the form, ON-NEWRECORD runs while there still is *no* record in the form So you are saying it is essintially invalid manipulate the form during ON-NEWRECORD It is not possible to set the focus, yes. To achieve that, this seems to work: if self.get_record_status() == 'empty': form.setFocus(blk_customer.city) we still have quite some way to go before all these issues are completely thought through, well documented, and raise useful exceptions Funny that we want to do this in "POST-FOCUSIN" rather than "PRE-FOCUSIN" But it work nicely! Thanks! *** dimas has joined #gnuenterprise FWIW I fixed a bug in get_record_status you can now also do this in ON-NEWRECORD *but* it doesn't help for the first time when opening the form, because on activiation of the form the focus is set to the first field so you would also have to set the focus in ON-ACTIVATE off to lunch, hacking on later ayers: thank you for forcing me to work on gnue again :) hehe... sure... and I'm not quite done yet Guten Appetit OK what is the prefered way to make fields "read-only" after they have been inserted? you mean a field should only be editable for new records, but not for existing records? *** jamest has joined #gnuenterprise *** johannesV has joined #gnuenterprise bbl *** reinhard has quit IRC *** btami has quit IRC *** reinhard has joined #gnuenterprise reinhard: yes I meant that the field should only be editable for new records, but not existing records. Ah!!! Cool.. is there something equivalent for gld files? no ACK.. Thanks! hmm actually that's too bad :-) I guess I'll make forms for those then also... But hey I think the should remain stable enough now. yes I agree that it might be an useful feature for gld *** jcater has joined #gnuenterprise *** derek has quit IRC *** derek has joined #gnuenterprise Can anyone help me setup a Windows Client? I've downloaded and installed the Current packages for Windows. I suppose I cannot install the appserver. I installed the runtime, -common, -form, -reports, -navigator-debug *** Morphous_ has joined #gnuenterprise *** Morphous has quit IRC *** Morphous has joined #gnuenterprise *** Amorphous has joined #gnuenterprise *** Morphous_ has quit IRC *** reinhard has quit IRC *** Morphous has quit IRC *** Amorphous has quit IRC *** jamest_ has joined #gnuenterprise *** sjc has joined #gnuenterprise *** jamest has quit IRC *** jamest_ has quit IRC *** jamest has joined #gnuenterprise *** johannesV has quit IRC *** ayers has left #gnuenterprise *** jamest has quit IRC *** jamest has joined #gnuenterprise *** jamest has joined #gnuenterprise *** jamest has quit IRC *** sjc has quit IRC *** derek has quit IRC *** jcater has quit IRC *** derek has joined #gnuenterprise