Found an issue in SpiderBasic ? Please report it here !
User avatar
Peter
 
Posts: 445
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1

DialogGadget() fails if...

by Peter Wed Feb 07, 2018 1:59 pm

Hello,

DialogGadget() fails with a JavaScript-Error (Cannot read property 'a' of undefined) if there is a gridbox with a columns-value greater than the elements in the gridbox.

For Example, this fails (columns=3 and 2 Buttons):
Code: Select all
#Dialog = 0

Define sXML.s
Define oXML

sXML = "<window id='#PB_Any' name='test' text='Dialog example' minwidth='400' minheight='400' flags='#PB_Window_ScreenCentered'>" +
       "  <panel>" +
       "    <tab text='Tab1'>" +
       "      <gridbox columns='3'>" +
       "        <button text='Bla1' />" +
       "        <button text='Bla2' />" +
       "      </gridbox>" +
       "    </tab>" +
       "    <tab text='Tab2'>" +
       "      <listview name='myListView' />" +
       "    </tab>" +
       "  </panel>" +
       "</window>"

oXML = ParseXML(#PB_Any, sXML)

If oXML And XMLStatus(oXML) = #PB_XML_Success
  If CreateDialog(#Dialog) And OpenXMLDialog(#Dialog, oXML, "test")
   
    Debug DialogGadget(#Dialog, "myListView")
   
  Else
    Debug "Dialog error: " + DialogError(#Dialog)
  EndIf
Else
  Debug "XML error: " + XMLError(oXML) + " (Line: " + XMLErrorLine(oXML) + ")"
EndIf


this works (columns=3 and 3 Buttons)
Code: Select all
sXML = "<window id='#PB_Any' name='test' text='Dialog example' minwidth='400' minheight='400' flags='#PB_Window_ScreenCentered'>" +
       "  <panel>" +
       "    <tab text='Tab1'>" +
       "      <gridbox columns='3'>" +
       "        <button text='Bla1' />" +
       "        <button text='Bla2' />" +
       "        <button text='Bla3' />" +
       "      </gridbox>" +
       "    </tab>" +
       "    <tab text='Tab2'>" +
       "      <listview name='myListView' />" +
       "    </tab>" +
       "  </panel>" +
       "</window>"



Greetings ... Peter
Return to Bugs Reports

Who is online

Users browsing this forum: No registered users and 2 guests