Skip to content

Commit 42fb642

Browse files
authored
Merge pull request #10913 from LEGIO-SEXTA-FERRATA/wtf/wtf-2419-extend-pwt-docs
[WTF-2419] Extend PWT docs with session and parser APIs
2 parents 0fc459c + c1632fc commit 42fb642

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/pluggable-widgets/pluggable-widgets-client-apis/_index.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,39 @@ if (selection.type === "Single") {
485485

486486
## Exposed Modules
487487

488+
### Session {#session}
489+
490+
The Mendix Platform exposes a `mendix/session` module for inspecting the current user session. It is available in both web and native.
491+
492+
For instance, `getUserId` returns the current user's GUID as a `string`.
493+
494+
```ts
495+
function getUserId(): GUID;
496+
```
497+
498+
---
499+
500+
### Parser {#parser}
501+
502+
The Mendix Platform exposes a `mendix/parser` module that provides locale-aware formatting and parsing of attribute values. These functions use the same locale and formatting settings of the built-in Mendix widgets. It is available in both web and native.
503+
504+
```ts
505+
import { formatValue, parseValue } from "mendix/parser";
506+
```
507+
508+
Both functions accept an optional configuration object:
509+
510+
```ts
511+
interface FormatValueConfig {
512+
selector?: "date" | "time" | "datetime";
513+
datePattern?: string;
514+
places?: number;
515+
groups?: boolean;
516+
}
517+
```
518+
519+
For the reference of the API, you can refer to the [API documentation](/apidocs-mxsdk/apidocs/pluggable-widgets-client-apis-parser/).
520+
488521
### Icon {#icon}
489522

490523
Mendix Platform exposes two versions of an `Icon` react component: `mendix/components/web/Icon` and `mendix/components/native/Icon`. Both components are useful helpers to render `WebIcon` and `NativeIcon` values respectively. They should be passed through an `icon` prop. The native `Icon` component additionally accepts `color` (`string`) and `size` (`number`) props.

content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/pluggable-widgets/pluggable-widgets-client-apis/pluggable-widgets-client-apis-list-values.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,12 @@ It is possible to set filtering conditions for items of a datasource. `setFilter
197197

198198
Some examples of builder functions are `equals`, `greaterThan`, `lessThanOrEqual` for filtering on `DateTime` or `Decimal` attributes. Functions like `startsWith`, `contains` are useful for filtering on `String` attributes. Filtering based on associations is also possible. For example, you can use `equals` with references and `contains` with reference sets.
199199

200+
To use the filter builders in a pluggable widget, import the individual builder functions you need directly from the "mendix/filters/builders" module path:
201+
202+
```ts
203+
import { attribute, literal, equals, startsWith, and, or } from "mendix/filters/builders";
204+
```
205+
200206
The following code samples show how to use filter builders and apply filtering to a data source property with three linked attributes and two linked associations:
201207

202208
```ts

0 commit comments

Comments
 (0)