Announcement

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

    VisualBuilder generates code it can't read back

    I am using a ValuesManager with great success. It helps me translate a JSON string and populate checkboxes and other controls spread over a number of forms.

    My xml code has the VM constructed as part of a window. That works just fine. Unfortunately, when I make changes in VB and SAVE, the xml that is generated includes code that doesn't make sense.

    To me, or VB, as it turns out, when it is read back.
    Code:
        <valuesManager constructor="ValuesManager">
            <ID>meetingTypeVM</ID>
            <function Object() {
        [native code]
    }>ValuesManager</function Object() {
        [native code]
    }>
            <constructor></constructor>
        </valuesManager>
    I can repair it and VB is happy again.
    Code:
        <valuesManager constructor="ValuesManager">
            <ID>meetingTypeVM</ID>
        </valuesManager>
    I am still using VB to build my app. I have more windows and forms to create, and plenty of string function code to tuck into events. So, this is of great annoyance.

    Thanks,

    Rick

    P.S. I am running SmartClient Version: v8.2p_2012-07-19/EVAL Development Only on Mozilla Firefox 12.0 with Firebug using Windows XP Pro 32 bit.

    #2
    We can't see a way that you could end up with this result.

    Can you provide steps to reproduce this problem starting from a blank project?

    Comment


      #3
      I build and SAVE a project with a window, form and controls.

      Then I edit the XML file to add a definition for the VM at the beginning.

      Code:
      <ValuesManager>
              <ID>meetingTypeVM</ID>
      </ValuesManager>
      And, reference it once in the window. (I forget how I did this. Once it worked I didn't need it.)

      VB accepts everything. However, upon SAVE the generated code is such that VB blows up when the XML is read.
      Code:
      <Window ID="MeetingWindow" overflow="visible" autoDraw="false">
          <isModal>true</isModal>
          <visibility>hidden</visibility>
          <title>Meeting Window</title>
          <showMinimizeButton>false</showMinimizeButton>
          <showMaximizeButton>true</showMaximizeButton>
          <showStatusBar>false</showStatusBar>
          <showResizer>false</showResizer>
          <items><Canvas ref="MeetingForm"/><Canvas ref="MeetingBottomHalf"/>
          </items>
          <showModalMask>true</showModalMask>
          <modalMaskOpacity>10</modalMaskOpacity>
          <width>100%</width>
          <height>550</height>
          <top>61</top>
          <canDragReposition>false</canDragReposition>
          <canDragResize>false</canDragResize>
          <valuesManager constructor="ValuesManager">
              <ID>meetingTypeVM</ID>
              <function Object() {
          [native code]
      }>ValuesManager</function Object() {
          [native code]
      }>
              <constructor></constructor>
          </valuesManager>
          <showShadow>false</showShadow>
      </Window>
      
      <Window ID="MeetingTopicWindow" autoDraw="false">
          <isModal>true</isModal>
          <visibility>hidden</visibility>
          <title>Meeting Topic Window</title>
          <showMinimizeButton>false</showMinimizeButton>
          <showStatusBar>false</showStatusBar>
          <showResizer>false</showResizer>
          <showModalMask>true</showModalMask>
          <modalMaskOpacity>10</modalMaskOpacity>
          <width>400</width>
          <height>400</height>
          <canDragReposition>false</canDragReposition>
          <canDragResize>false</canDragResize>
          <showShadow>false</showShadow>
      </Window>
      So, I fix it in the generated JSP and test. And, in the XML so it will load. You can see the component in VB in the attached picture.

      Rick
      Attached Files

      Comment


        #4
        This should be fixed for the next nightly build.

        Just to reiterate: Visual Builder isn't intended as a tool to be used as a primary environment by developers and shouldn't be expected to reliably load screens that cannot be implemented within Visual Builder itself.

        But this was a bug anyway, so we fixed it.

        Comment


          #5
          Thanks very much. I know my usage of VB is a bit 'off-label'. But, it has been handy making new windows and form and assembling things together. I don't use the application window any more, just the components hierarchy.

          When I am close to having all the elements in there, I will copy out the JSP and run with it. That, and all the Java code I have running on the remote server.

          After the fix I will be able to copy the JSP out of VB. It would not render in the VB code window. I had to wait for the patched JSP to load into a browser and test out before I could save the page into a file.

          You are saving me a lot of work. You must be good.

          I remember a story about a tailor. He fitted a suit for a man but did not do a great job. One sleeve was longer than the other. So, he told him to drop one shoulder to compensate. It worked. He did the same with pant legs and other fitting details.

          At last, the customer walked out the door with the suit looking fine. Unfortunately, he was forced to walk terribly. After hobbling awkwardly half a block he was courteously stopped by another man. A stranger.

          "Where did you get that suit? He was asked.
          "From the tailor just down the block", he replied proudly. "Do you like the suit?
          "The suit is OK," answered the stranger. "But, he must be a very good tailor to fit a cripple like you."

          Keep up the good work. I mean great work!

          Rick

          Comment


            #6
            I just wanted to add that I had upgraded and picked up a new nightly. VB generated code that ran and could be read back in fine.

            Thanks for your attention to this pesky matter.

            Rick

            Comment

            Working...
            X