Hi All,
Below is a script that has been generated by converting a browse to xdialog with an embedded browse.
Can anybody tell me how I can get the value of a selected row object ie the SMB_REF
Andy
Below is a script that has been generated by converting a browse to xdialog with an embedded browse.
Can anybody tell me how I can get the value of a selected row object ie the SMB_REF
Andy
Code:
dim dlg_title as c dim dlg_body as c dim dlg_event as c dim browseObj1_browse_definition as c dim browseObj1_tablename as c browseObj1_tablename = "stock.dbf" dim flagIsActiveLinkTable as l flagIsActiveLinkTable = a5_is_activelinktable("stock.dbf") 'If the browse is based on an ActiveLink table then it is necessary to include 'the {statusarea} directive in the Xdialog definition. This is where progress is reported 'when the active-link table is fetching records from the server. dim StatusAreaCommand as c = "" if flagIsActiveLinkTable then StatusAreaCommand = "{sp=.5}{statusarea=100,1};" end if dlg_title = "Browse in Xdialog" dlg_body = <<%dlg% 'If you include the {removecomments} command, any line that starts with an single quote will be treated as a comment. {removecomments} {can_exit=close} {startup=init} {xmargin=0}{ymargin=0} {stretch=height,width} {watch=browseObj1.mode_get()!modechange} {card=175,20BrowseCard_browseObj1}; {stretch=} {stickto=bottom,left} __StatusArea__; <%T=Go to first record;B=T;I=$$navigate.first%!browseObj1_NavigateFirst> <%T=Go to previous record;B=T;I=$$navigate.prev%!browseObj1_NavigatePrevious> <%T=Go to next record;B=T;I=$$navigate.next%!browseObj1_NavigateNext> <%T=Go to last record;B=T;I=$$navigate.last%!browseObj1_NavigateLast> {sp=3} <%T=Find by key;B=T;I=$a5_find_by_key%!browseObj1_FindByKey> {sp=3} <%T=Sort in ascending order;B=T;I=$$sort%!browseObj1_SortAscending> <%T=Sort in descending order;B=T;I=$$sort.descending%!browseObj1_SortDescending> {sp=3} <%T=Save record;B=T;I=$a5_save%!browseObj1_SaveRecord?.not.(browseObj1.mode_get()="view")> {sp=3} <%T=Refresh;B=T;I=$$generic.refresh.color%!browseObj1_RefreshRecord?(browseObj1.mode_get()="view")> {sp=3} ; {stickto=bottom,right} {justify=right} ;;; <10&Amend!amend><10&Close!close>; %dlg% dlg_body = stritran(dlg_body,"__StatusArea__",StatusAreaCommand) dlg_event = <<%code% if a_dlg_button = "close" then ui_modeless_dlg_close(dlg_title) end if if a_dlg_button = "amend" then a_dlg_button = "" ui_msg_box("Notice","User clicked the OK button."+browseObj1_SMB_REF) end if if a_dlg_button = "init" a_dlg_button = "" browseObj1 = a5_XdialogDefaultBrowse(dlg_title,"Browsecard_browseObj1",browseObj1_tablename,"browseObj1_browse_definition") 'The status bar is only shown if the browse is based on an active-link table. 'When the browse is fetching data from the server, the status bar displays progress. 'However, when the browse is not fetching from the server, if the 'status_format' is not set to null, then 'the status bar will display 'Record x'. Since we don't want any display, we set the status_format to null. 'Note that the status_format can be set to any expression that evaluates in the context of the current record. 'e.g. "Record for" + lastname browseObj1.Status_format = "\"\"" end if if a_dlg_button = "browseObj1_NavigateFirst" then a_dlg_button = "" browseObj1.Fetch_First() else if a_dlg_button = "browseObj1_NavigateNext" then a_dlg_button = "" browseObj1.Fetch_Next() else if a_dlg_button = "browseObj1_NavigatePrevious" then a_dlg_button = "" browseObj1.Fetch_Prev() else if a_dlg_button = "browseObj1_NavigateLast" then a_dlg_button = "" browseObj1.Fetch_Last() else if a_dlg_button = "browseObj1_FindByKey" then a_dlg_button = "" browseObj1.Find() else if a_dlg_button = "browseObj1_SortAscending" then a_dlg_button = "" browseObj1.command("SORT_ASCENDING") else if a_dlg_button = "browseObj1_SortDescending" then a_dlg_button = "" browseObj1.command("SORT_DESCENDING") else if a_dlg_button = "browseObj1_SaveRecord" then a_dlg_button = "" browseObj1.commit() else if a_dlg_button = "browseObj1_RefreshRecord" then a_dlg_button = "" browseObj1.command("REFRESH") end if %code% browseObj1_browse_definition = <<%xml% <browse restrict_change="yes" restrict_delete="yes" gridline_horizontal="yes" gridline_vertical="yes" data_entry_style="default" row_height="16" order="Smb_ref+Stock_code"> <title showtitles="yes" color="System-ButtonFace" accent_color="System-ButtonHighlight" fill_style="Gradient Horizontal" line_style="solid" line_color="System-ThreeDShadow" top="2" onclick_behaviour="Select"> <font color="System-ButtonText" name="Arial" size="8"/> <flyover color="#224,244,244" accent_color="#195,195,195" fill_style="Gradient Horizontal"/> <selected color="#241,193,95" accent_color="#249,217,159" fill_style="Gradient Horizontal" font_color="System-ButtonText"/> <focused color="#242,149,54" accent_color="#255,213,141" fill_style="Gradient Horizontal" font_color="System-ButtonText"/> </title> <background color="White" accent_color="Black" fill_style="Transparent"/> <row_selector color="Win3D" accent_color="Black" fill_style="Transparent" line_style="solid" line_color="System-ThreeDShadow"> <selected color="#255,213,141" accent_color="Black" fill_style="Solid"/> <focused color="#241,192,92" accent_color="Black" fill_style="Solid"/> </row_selector> <splitter color="Win3D"/> <horizontal line_color="System-ButtonFace" line_style="solid"/> <vertical line_color="System-ButtonFace" line_style="solid"/> <separator_top line_style="default"/> <separator_bottom line_style="default"/> <separator_left line_style="default"/> <separator_right line_style="default"/> <cells> <cell color="#255,255,255" accent_color="#255,255,255" fill_style="solid" font_color="#0,0,0" count="1"/> <cell color="#244,244,255" accent_color="#244,244,255" fill_style="solid" font_color="#0,0,0" count="1"/> </cells> <selected color="System-Highlight" accent_color="Black" fill_style="Solid" font_color="System-HighlightText"/> <focused color="System-Highlight" accent_color="Black" fill_style="Solid" font_color="System-HighlightText"/> <currentrow color="System-Highlight" accent_color="Black" fill_style="Solid" font_color="System-HighlightText"/> <currentcolumn color="System-Highlight" accent_color="Black" fill_style="Solid" font_color="System-HighlightText"/> <new_record_appearance color="Win3D" accent_color="Off White" fill_style="Transparent"/> <font size="2"/> <font size="2"/> <columns> <column name="SMB_REF" align="Left" text_format="None"> <font color="<default>" name="Tahoma" size="8"/> <border color="Black" style="No border" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/> <fill color="<default>" accent_color="White" style="Transparent"/> <shadow style="None"/> <entry name="stock->SMB_REF" width="25"/> <object name="SMB_REF" column_title="SMB_REF" width="1.5"/> </column> <column name="GRADE" align="Left" text_format="None"> <font color="<default>" name="Tahoma" size="8"/> <border color="Black" style="No border" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/> <fill color="<default>" accent_color="White" style="Transparent"/> <shadow style="None"/> <entry name="stock->GRADE" width="3"/> <object name="GRADE" column_title="GRADE" width="0.791666666666667"/> </column> <column name="SUPPLR_REF" align="Left" text_format="None"> <font color="<default>" name="Tahoma" size="8"/> <border color="Black" style="No border" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/> <fill color="<default>" accent_color="White" style="Transparent"/> <shadow style="None"/> <entry name="stock->SUPPLR_REF" width="25"/> <object name="SUPPLR_REF" column_title="SUPPLR_REF" width="1.5"/> </column> <column name="STOCK_CODE" align="Left" text_format="None"> <font color="<default>" name="Tahoma" size="8"/> <border color="Black" style="No border" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/> <fill color="<default>" accent_color="White" style="Transparent"/> <shadow style="None"/> <entry name="stock->STOCK_CODE" width="4"/> <object name="STOCK_CODE" column_title="STOCK_CODE" width="0.791666666666667"/> </column> <column name="DESCRIPT" align="Left" text_format="None"> <font color="<default>" name="Tahoma" size="8"/> <border color="Black" style="No border" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/> <fill color="<default>" accent_color="White" style="Transparent"/> <shadow style="None"/> <entry name="stock->DESCRIPT" width="32"/> <object name="DESCRIPT" column_title="DESCRIPT" width="2.5"/> </column> <column name="QTY" align="Left" text_format="None"> <font color="<default>" name="Tahoma" size="8"/> <border color="Black" style="No border" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/> <fill color="<default>" accent_color="White" style="Transparent"/> <shadow style="None"/> <entry name="stock->QTY" width="6"/> <object name="QTY" column_title="QTY" width="0.666666666666667"/> </column> <column name="REORDLEVEL" align="Left" text_format="None"> <font color="<default>" name="Tahoma" size="8"/> <border color="Black" style="No border" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/> <fill color="<default>" accent_color="White" style="Transparent"/> <shadow style="None"/> <entry name="stock->REORDLEVEL" width="5"/> <object name="REORDLEVEL" column_title="REORDLEVEL" width="0.791666666666667"/> </column> </columns> </browse> %xml% dim pg as p pg.BodyText = "Use This Browse To Find Stock Levels" + crlf(2)+\ "Please Use The Buttons At The Bottom Of The Form To Search For Products" pg.HeadingText = " Stock Levels" pg.Image = "smblogo" dlg_body = "{XdialogTitleSection=150,7pg};{lf};" + crlf() + dlg_body 'Now, display the Xdialog. ui_dlg_box(dlg_title,dlg_body,dlg_event)
Comment