Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • thijs
    replied
    This worked for me too

    Originally posted by kevboy View Post
    Although you already found a solution, I just wanted to add my experience...

    I got your same message but when I called ValuesManager.addMember(DynamicForm). After trying to find where I was setting the values in question, in a desperate attempt, I tried calling DynamicForm.setValuesManager(ValuesManager) instead. The warning disappeared after that!
    This solutions worked for me too.
    Code:
    //vm.addMember(this);
    this.setValuesManager(vm);
    Before the fix I got a lot of warnings, which I feel were incorrect. At the least the warning message seems to have no relation to the fix.

    Unfortunately I do not have a clear test case that can show this reproducable (cannot share the code of the project that I am working on), and I also don't have time to create one at the moment; sorry.
    Last edited by thijs; 4 Mar 2013, 07:50.

    Leave a comment:


  • Isomorphic
    replied
    Setting value after init should not be causing this warning. Again, when you think there's a bug, you need to show test code.

    Leave a comment:


  • ssieb
    replied
    The error message is definitely incorrect, because I'm not touching those fields anywhere, but whatever.

    I tried using a CanvasItem before, maybe not in this configuration, but there are two issues there. First, it needs to be invisible, which I do know how to solve. But secondly, and more importantly, it still needs to setValue on the other FormItems in different places on the form, which won't solve this error message.

    Leave a comment:


  • Isomorphic
    replied
    If you think the error message is incorrect, once again please show a test case.

    Your other problem should have been solved using CanvasItem, which provides notifications for when values are applied to the item. See samples.

    Leave a comment:


  • ssieb
    replied
    That's a real pain. This is caused by my solution to:
    http://forums.smartclient.com/showthread.php?t=9803

    The FormItem that tracks the radio buttons is not going to know about the ValuesManager, it just knows about the items it is keeping track of. So it will have to have knowledge about whether the form is part of a manager or not.

    Also, that error message is strangely imprecise! Why is it picking apparently random (but always the same two) fields to complain about instead of the ones I'm actually setting?

    Leave a comment:


  • Isomorphic
    replied
    Right, set all values through the ValuesManager. So not a bug, a usage issue as we guessed.

    Leave a comment:


  • ssieb
    replied
    I don't have the time to completely isolate what causes it, but I can give you more specifics. I have four forms linked to a ValuesManager. One of the forms gets those warnings from the manager. The fields that it is complaining about are in a different form and are not referenced in any way from the other forms, particularly not in the one with the error. The one form that is getting the error has some FormItems that are not in the datasource and I call setValue on them. Could that be the problem even though it's a different field name? Should I be setting the value of non-datasource fields through the manager as well?

    Leave a comment:


  • Isomorphic
    replied
    If anyone can provide sample code that causes a spurious warning here, let us know.

    Right now it appears that the warning is correct, and if there's a bug, it's that the bad usage is not caught if you change the order of joining forms and valuesManager.

    Leave a comment:


  • ssieb
    replied
    I will second that. Setting the ValuesManager on the DynamicForm, instead of the other way around, stopped the errors from happening.

    Leave a comment:


  • kevboy
    replied
    Although you already found a solution, I just wanted to add my experience...

    I got your same message but when I called ValuesManager.addMember(DynamicForm). After trying to find where I was setting the values in question, in a desperate attempt, I tried calling DynamicForm.setValuesManager(ValuesManager) instead. The warning disappeared after that!

    Leave a comment:


  • jay.l.fisher
    replied
    Thanks. I did finally spot the code that was using setValue() on FormItems when it should have been calling setValue() on the ValuesManager. I think I was led astray by the fact that the message didn't appear until calling ValuesManager.saveData() instead of on the call to FormItem.setValue().

    Leave a comment:


  • Isomorphic
    replied
    Basically, providing values at init, via defaultValue, or via setValue() to a member form. But you denied doing any of those things :)

    Maybe you are setting defaultValue in the .ds.xml file? Not technically valid, and would be seen/evaluated by member forms, causing this warning.

    Leave a comment:


  • jay.l.fisher
    replied
    I've tried to create a simple example but of course it doesn't happen in my simple example. Can you give me any tips on where to look based on the conditions that would cause that message to be sent?

    Leave a comment:


  • Isomorphic
    replied
    A quick check of samples is not reproducing this warning. Can you show sample code to reproduce it?

    Leave a comment:


  • WARN: form has explicitly specified value for field.

    SmartGWT EE 8/31 nightly (although this was happening before). I have a ValuesManager with various forms as members. I use ValuesManager.editRecord(myRecord) to populate all of the forms from an existing record. When I use ValuesManager.saveData() the development mode console shows a long list of warnings that ...
    Code:
    ValuesManager myValuesManager: Member Form: [myForm1] has explicitly specified value for field[s] 'aField', but has no item associated with this fieldName. Ignoring this value. Values may be set for fields with no associated form item directly on the valuesManager via valuesManager.setValues(), but not on member forms. See ValuesManager documentation for more info.
    The warnings appear, for each form, for all of the fields in the datasource that are not part of that form. I'm not setting values explicitly on any of the forms. Only via the ValuesManager. Everything otherwise seems to work except that the console fills up with a load of messages. And the errors only appear when ValuesManager.saveData() is called.
Working...
X