Web2 - algunas dudas con javascript

Estimados, quizás me puedan dar una mano con dos consultas:

Tengo un WebTextField, hay posibilidad de darle color al borde, lo usaría para marcar si es correcto o incorrecto el valor que introduzco, se que en el IDE no hay nada pero quizás pueda hacerlo por javascript?

Tengo un WebButton con una ejecución de JavaScript que me lanza a otro sitio (es un sitio de pasarela de pagos) que una vez finalizado, le puedo indicar a que dirección retornar (si es aprobado o rechazado ej: www.tusitio.com/aprobado), como podría manejarlo en Xojo? quizás por el HandleURL ? necesitaría marcar una Sesión para saber que es un retorno determinado? Alguna idea?

Tal vez se pueda hacer con javascript, agregando o quitando una Class con el CSS correspondiente puede ser una opción.

Otra opción es solicitarle a @Ricardo_Cruz (felicidades por ser padre) que como está trabajando con el nuevo Bootstrap para una futura versión de Xojo, que pueda agregar la validación que ofrece Bootstrap

En el pasado vi información en este foro de cómo manejaban las respuestas de pago de PayPal y con una aplicación web (web1) se activaba el resultado del sitio de pago validando que la transacción fuera válida y no alguien tratando de engañar a tu sitio en autorizar alguna compra sin haberla hecho.

No he visto algo parecido en web2. Alguien mas puede ayudarte en esto.

Si mal no recuerdo @Michel_Bujardet es la persona que puso el código que usa para procesar pagos con la conexión a PayPal. Me imagino que todo depende lo que el “otro sitio de pasarela de pagos” ofrece como validación.

2 Likes

@AlbertoD muchas gracias por tu pronta respuesta!

Muchas felicidades a @Ricardo_Cruz esperemos pueda descansar algo jaja!

Veré en el foro si encuentro algo de @Michel_Bujardet ya que el proceso sería el mismo, en éste caso lo estoy integrando con MercadoPago (una pasarela en America Latina).

1 Like

Veo que el GraffitiTextField hace eso mismo, sin ir tan lejos con el tilde o cruz lo de marcar de rojo simplemente cuando no sea correcto seria suficiente.

Supongo es un gran trabajo de @Anthony_G_Cyphers en su paquete que podría colocar, pero por el momento sería más simple aplicarle solo al campo WebTextField.

Captura de pantalla 2023-02-24 a la(s) 11.31.53

Aprovecho la oportunidad para consultarle a @Anthony_G_Cyphers si nos tendrá alguna actualización del paquete WEB en breve? o que planes a futuro tiene con los ajustes de Xojo, por ejemplo para correr el proyecto demo2 tuve que cambiar en la sintaxis los itemIndex por segmentIndex (esos cambios de sintaxis que introduce xojo en los cual nos hace trabajar innecesariamente jaja).

Release 49 should be out next week, if not sooner, and addresses the syntax changes Xojo made that broke the demo project’s use of the WebSegment. If you want a preview of what GraffitiSuite Web Edition will look like in the meantime, here’s the current changelog:

Summary
New: GraffitiMap.Icon (17568)
Added: GraffitiControlWrapper has a new ExtendedLayoutDrawing string constant for controlling drawing in the IDE's layout editor. "True" for icon and title, "False" for title only. Defaults to “True”. Pages may be slower to load the first time when editing within the IDE.
Added: GraffitiAccordionMenuItem has a new CanExpand as Boolean = True property to control user's ability to expand or collapse items with children.
Added: GraffitiAvatar has a new BorderColor as Color = &caaaaaa property. (17475)
Added: GraffitiAvatar has a new BorderSize as Integer = 2 property. (17475)
Added: GraffitiAvatar has a new TextColor as Color = &cffffff property. (17475)
Added: GraffitiCalendar will now update GraffitiCalendarEvents in the display when their visual properties change. (17699)
Added: GraffitiCalendar now implements GraffitiUpdateInterface. (17699)
Added: GraffitiCalendar now performs a sanity check to validate the events are actually repeating before adding them as repeating.
Added: GraffitiCalendar has a new EventToRowSet( theEvent as GraffitiCalendarEvent ) event for modifying event properties before writing to the database.
Added: GraffitiCalendar.AddRowSet will now exit if the RowSet contains no rows.
Added: GraffitiCalendar.AddRowSet will now yield every 250 records.
Added: GraffitiCalendarRestriction has a new Constructor( RestrictionID as String, ParamArray VisibleDays as Integer ) method for hiding days of the week from the calendar's view.
Added: GraffitiCalendarEvent has a new LockUpdate property which prevents updating the client display when an events properties change.
Added: GraffitiCurrencyField has a new DecimalCharAlternate as String property for supporting multiple decimal character input such as "," and "." simultaneously. (17716)
Added: GraffitiEditor.Fonts has a new DefaultLineHeight as Double property for setting the default line height of contents in the editor. Should be set in the Open event (17460)
Added: GraffitiKanban now supports iterating columns with For Each column as GraffitiKanbanColumn in Instance (17516)
Added: GraffitiKanban has a new GutterHeight as Integer property for controlling horizontal space around the edges of columns. Valid values are 0-5 matched Bootstrap theme padding values. (17637)
Added: GraffitiKanban has a new GutterWidth as Integer property for controlling horizontal space around the edges of columns. Valid values are 0-5 matched Bootstrap theme padding values. (17637)
Added: GraffitiKanbanItem has a new ImageMaxHeight as Integer = -1 property. (17515)
Added: GraffitiKanbanItem has a new HasLink as Boolean = False property. (17541)
Added: GraffitiKanbanItem has a new LinkCaption as String property. (17541)
Added: GraffitiKanbanItem has a new LinkURL as String property. (17541)
Added: GraffitiKanbanColumn now supports iterating items with For Each item as GraffitiKanbanItem in Column (17516)
Added: GraffitiMapViewer now exposes the Hidden event.
Added: GraffitiMap.Marker has a new Icon as GraffitiMap.Icon property for specifying icons with scale and positioning properties. (17568)
Added: GraffitiOrgChart has a new ZoomRelative( percentValue as Double ) method. 200 for 2x, 50 for 0.5x (17759)
Added: GraffitiPopupMenu has a new AdaptiveHeight as Boolean = False property. When True, the control will resize vertically based on the height of the selected items and raise the HeightChanged event. (17552)
Added: GraffitiPopupMenu has a new HeightChanged( oldHeight as Integer ) property that is raised the selected items withing a MultipleSelect instance changes the in-browser height of the control. (17552)
Added: GraffitiPopupMenu has a new SortDirections enumeration. (17667)
Added: GraffitiPopupMenu has a new SortItems as Boolean = False property. (17667)
Added: GraffitiPopupMenu has a new SortDirection as SortDirections property. (17667)
Added: GraffitiPopupMenu has a new DropdownStyle as GraffitiStyle property.
Added: GraffitiTextField has a new Multiline as Boolean = False property that uses an HTML TEXTAREA in the browser rather than an INPUT element. (17384)
Added: GraffitiToolbarButton has a new BadgeIndicator as WebUIControl.Indicators property. (17805)
Added: GraffitiToolbarButton has a new BadgeIsPill as Boolean property. (17805)
Added: GraffitiToolbarButton has a new BadgeText as String property. (17805)
Added: GraffitiUploader has a new CancelConfirmText as String property. (17421)
Added: GraffitiUploader has a new CancelUploadText as String property. (17421)
Added: GraffitiUploader has a new CompleteText as String property. (17421)
Added: GraffitiUploader has a new FallbackText as String property. (17421)
Added: GraffitiUploader has a new FileTooBigText as String property. (17421)
Added: GraffitiUploader has a new InvalidFileTypeText as String property. (17421)
Added: GraffitiUploader has a new RemoveFileText as String property. (17421)
Added: GraffitiUploader has a new SendingText as StringProperty. (17421)
Fixed: GraffitiAccordionMenu now properly escapes strings for item text and badges at load time. (17356)
Fixed: GraffitiAlert should now better handle containers added programmatically in recent versions of Xojo.
Fixed: GraffitiAlert now better positions alerts with a container when center positioned horizontally. (17746)
Fixed: GraffitiAvatarGroup.RemoveAll once again works as expected. (17660)
Fixed: GraffitiButtonSegment will no longer show scrollbars when a button's caption is too large for the display. It will instead ellipsize the caption without wrapping as it did previously. (17440)
Fixed: GraffitiButtonSegment now better handles automatic theming with Indicator overrides.
Fixed: GraffitiButtonSegment now swaps Indicator property CSS classes based on button values to account for CSS class priority. (17605)
Fixed: GraffitiCalendarEvent.UpdateDatabaseRecord will now return when the matching row has been found and updated.
Fixed: GraffitiCalendarEvent.DatabaseAutoUpdate now defaults to False.
Fixed: GraffitiCurrencyField once again implements the BaseStyle property. (17758)
Fixed: GraffitiDateTimePickerSingle now more intelligently handles custom locales for direct data input. (17404)
Fixed: GraffitiDateTimePickerMultiple now more intelligently handles custom locales for direct data input. (17404)
Fixed: GraffitiDateTimePickerRange no longer experiences both JavaScript and Xojo exceptions when Nil values are provided. These values are now appropriate replaced at runtime.
Fixed: GraffitiEditor once again honors setting ReadOnly to False in the inspector or in the Open event. (17460)
Fixed: GraffitiGrid should no longer encounter a JavaScript exception in recent versions of Xojo when resizing columns. (17500)
Fixed: GraffitiGrid once again implements the BaseStyle property. (17374)
Fixed: GraffitiGrid.ScrollToCell should now function when calling in the same set of processes as the control is initialized and data is loaded. (17430)
Fixed: GraffitiGrid.ScrollToRow should now function when calling in the same set of processes as the control is initialized and data is loaded. (17430)
Fixed: GraffitiGrid should no longer throw JavaScript exceptions when sorting. (17456)
Fixed: GraffitiGrid sorting can no longer be effected by timing issues during sorting.
Fixed: GraffitiHTMLExporter.FromEntity now properly handles hex encoded entities. (17656)
Fixed: GraffitiKanban now applies the BaseStyle property. (17532)
Fixed: GraffitiMapViewer.FitBounds once again functions. (17473)
Fixed: GraffitiMapViewer now fires the Shown event only after the map has been initialized. (17593)
Fixed: GraffitiMapViewer now reports the Latitude and Longitude of the mouse position in the Pressed and DoublePressed events rather than the center point of the view. (17648)
Fixed: GraffitiMenu.HideMenu once again functions for menus bound to WebButtons. (17801)
Fixed: GraffitiMenu.ShowMenu once again functions for menus bound to WebButtons. (17801)
Fixed: GraffitiOrgChart.ScrollTo can now be called from Open and Shown events. (16636)
Fixed: GraffitiOrgChart.ScrollTo now scrolls item more closesly to the center of the center of the display rather than just making them visible. (16636)
Fixed: GraffitiPDFViewer download functionality once again works as expected.
Fixed: GraffitiPDFViewer print functionality once again works as expected.
Fixed: GraffitiPopupMenu should now apply item styles to items when AllowAdd = False. (17684)
Fixed: GraffitiSpeak should no longer encounter a JavaScript exception in recent versions of Xojo when resizing columns.
Fixed: GraffitiTextField should no longer bind multiple events to KeyPress when changing the MaxLength property.
Fixed: GraffitiTooltip will now wait for GraffitiToolbarButtons to be rendered before attempting to attach. (17735)
Fixed: GraffitiTree will now only show scrollbars when content expands outside the viewable area. (17769)
Fixed: GraffitiTree.InsertItem once again functions as expected. (17769)
Fixed: GraffitiWall now disposes of child containers when they are removed to ensure clean initialization. If you wish to reuse the same container, users will need to make a new copy instead of re-adding an existing container. (17411)
Fixed: GraffitiWebFile.SaveTo will no longer bail under certain circumstances when the file doesn't already exist. (17432)
Changed: GraffitiGrid will now add both Row.Style and Grid.StyleRowEven/Odd to rows when both are supplied. (17430)
Note: Added a workaround to GraffitiControlWrapper where Xojo may raise events for WebUIControls as they are being destroyed resulting in NilObjectExceptions when attempting to raise event handlers on control instances. (17561)

Stats for the next Web Edition release
New: 1
Added: 44
Fixed: 39
Changed: 1

2 Likes