https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
kvision
  • r

    Robert Jaros

    10/07/2019, 8:51 AM
    First milestone of KVision 2 is ready. https://github.com/rjaros/kvision/releases/tag/2.0.0-M1
    🎉 2
    b
    • 2
    • 4
  • r

    Robert Jaros

    10/09/2019, 8:32 AM
    just using
    aChart.configuration = ....
    with new
    Configuration
    object containing new data should work so I would try to: 1. create a helper function to get current configuration:
    fun getChartConfig() = Configuration(
            ChartType.PIE,
            listOf(
                DataSets(
                    data = pieSizes
                )
            )
        )
    2. create a chart with the help of this function:
    val aChart = Chart(getChartConfig())
    3. subscribe to the observable list:
    pieSizes.onUpdate += {
       aChart.configuration = getChartConfig()
    }
    l
    • 2
    • 3
  • d

    Diogo Ribeiro

    10/11/2019, 11:18 AM
    Somebody have a problem with the dialogs/Alert? Its not being showing for me. It goes the transparent effect with no dialog....I guess it is something relate to the z-index
    r
    • 2
    • 5
  • r

    Robert Jaros

    10/11/2019, 11:36 AM
    @Big Chungus @Diogo Ribeiro Do you use any non-blocking database access libraries (kotlin or java) with Ktor (with KVision or even without it)
    b
    d
    • 3
    • 14
  • m

    Mikael

    10/29/2019, 10:31 AM
    I've got some questions of general nature about KVision. I'm sorry if these have already been answered and please point me to the source is this is the case. I plan to use KVision for a SPA. 1. Is KVision used in enterprise environment somewhere? 2. What is planned in the future for KVision like features, support, development etc? 3. Is anyone offering consultant services like development for KVision? 4. I would like to make a "Gitlab style layout" with a menu on the left side that can be collapsed on small screens. Is this possible in KVision? 5. Are "applications" created in KVision responsive in terms of UI? 6. Is it possible to do deep linking in KVision (example: having a link in an e-mail open a specific page in the app)? 7. What is browsers is KVision compatible with? 8. What is KVision performance compared to a SPA written directly in JS? I guess this can be hard to say but is there any overhead from writing the code in 9. Kotlin and then have it converted to JS? 10. Are there any collapsible/accordion menus available in KVision?
    r
    • 2
    • 8
  • r

    Robert Jaros

    01/08/2020, 5:57 PM
    it's present in the current template project: https://github.com/rjaros/kvision-examples/blob/bbda248ae09e7ed11dcdcc1c1c891d3d6ad2dee7/template/build.gradle.kts#L25
    👏 1
    d
    • 2
    • 1
  • l

    Lars Erik Rojeras

    01/17/2020, 10:38 AM
    I have converted my application to use redux (the JS version). It is very neat. 🙂 I am doing a few api calls, and need to display a loading indication/spinner to the user. Have you got an example how that can be done?
    r
    • 2
    • 6
  • b

    Big Chungus

    01/17/2020, 1:09 PM
    @Robert Jaros when will kvision gradle plugin go live? Also couldn't find any docs on what it does
    r
    • 2
    • 20
  • b

    Big Chungus

    01/17/2020, 9:13 PM
    Is there a way to use custom bootstrap components in KVision such as https://www.npmjs.com/package/bootstrap4-toggle#initialize-with-code?
    r
    • 2
    • 6
  • b

    Big Chungus

    01/19/2020, 7:52 PM
    Is there a way to connect navbar's dropDown to navigo router?
    r
    • 2
    • 18
  • r

    Robert Jaros

    01/31/2020, 8:25 AM
    We need this to be able to create a Kotlin object when using
    getData()
    . Without serialization requirement you would have to pass some kind of factory function. I don't know any other way to construct a generic type object.
    👍 1
    r
    • 2
    • 16
  • r

    Robert Jaros

    02/14/2020, 9:15 AM
    we are not reusing external dependencies code (at least I don't 😉
    👍 1
    r
    • 2
    • 1
  • r

    Robert Jaros

    05/01/2020, 10:38 PM
    KVision 3.7.3 is out. https://github.com/rjaros/kvision/releases/tag/3.7.3
    👍 3
    m
    • 2
    • 4
  • r

    Robert Jaros

    05/13/2020, 5:47 PM
    Good news: KVision will probably still work with Kotlin 1.4 😉 I've managed to compile the almost all of the framework and the helloworld app with new IR compiler backend. Another good news: The final bundle size was reduced by 30% - although I was hoping for more after reading [Kotlin blog post](https://blog.jetbrains.com/kotlin/2020/03/kotlin-1-4-m1-released/). Bad news: It's still buggy. I've got stack overflow error from the compiler when I've tried to compile the showcase example. Some external libraries do not work (kotlinx-html-js, react, redux, kotlin-redux). There will be problems with npm dependencies, because there are no more jar artifacts I can put generated package.json files. But I hope it will all get better ;-)
    👍 3
    n
    • 2
    • 4
  • r

    Robert Jaros

    06/26/2020, 1:51 PM
    three long weeks ... 😉 (someone should pay me for this 😉)
    👍 2
    t
    • 2
    • 2
  • r

    Robert Jaros

    06/30/2020, 6:42 PM
    I hope you don't mind being assigned to the github issue 😉 I was playing with github and now I don't know how to remove the assigment ;-)
    j
    • 2
    • 2
  • r

    Robert Jaros

    07/04/2020, 9:44 AM
    You would probably need to find out, how to use async tests in Kotlin/JS in the first place, because any means to read file content in JS would be asynchronous.
    j
    • 2
    • 2
  • r

    Robert Jaros

    07/28/2020, 6:34 PM
    I could play with this but there is no documentation and I don't even know where to start
    b
    • 2
    • 3
  • r

    Robert Jaros

    07/28/2020, 6:36 PM
    What would it be in kvdom?
    b
    • 2
    • 6
  • r

    Robert Jaros

    08/09/2020, 9:19 AM
    Someone submitted KVision to Kotlin Weekly newsletter 🙂 I never found the time for this. Thx whoever that was 😉
    b
    • 2
    • 2
  • l

    Lars Erik Rojeras

    08/21/2020, 1:14 PM
    I have encountered a strange behavior in Tabulator. I have been able to recreate it in a stripped down version of
    TabulatorTab.kt
    from the showcase:
    g
    • 2
    • 1
  • l

    Lars Erik Rojeras

    08/21/2020, 1:16 PM
    package com.example
    
    import pl.treksoft.kvision.panel.SimplePanel
    import pl.treksoft.kvision.state.observableListOf
    import pl.treksoft.kvision.tabulator.ColumnDefinition
    import pl.treksoft.kvision.tabulator.Editor
    import pl.treksoft.kvision.tabulator.Layout
    import pl.treksoft.kvision.tabulator.TabulatorOptions
    import pl.treksoft.kvision.tabulator.tabulator
    import pl.treksoft.kvision.utils.px
    
    data class Employee(
        val name: String?
    
    ) {
        companion object {
            internal var counter = 0
        }
    }
    
    class TabulatorTab : SimplePanel() {
    
        val data = observableListOf(
            Employee(
                "Tiger Nixon"
            ),
            Employee(
                "Garrett Winters"
            ),
            Employee(
                "Ashton Cox"
            )
        )
    
        init {
            this.marginTop = 10.px
    
            tabulator(data,
                options = TabulatorOptions(
                    layout = Layout.FITCOLUMNS,
                    columns = listOf(
                        ColumnDefinition(
                            "Name 1",
                            "name",
                            headerFilter = Editor.INPUT,
                            headerFilterPlaceholder = "Text 1"
                        )
                    )
                )
            )
            tabulator(data,
                options = TabulatorOptions(
                    layout = Layout.FITCOLUMNS,
                    columns = listOf(
                        ColumnDefinition(
                            "Name 2",
                            "name",
                            headerFilter = Editor.INPUT,
                            headerFilterPlaceholder = "Text 2"
                        )
                    )
                )
            )
        }
    }
    When I run this example I expect the second table to have a filter field with a placeholder "Text 2". But, instead "Text 1" is displayed. Why is that?
    r
    • 2
    • 2
  • g

    Gunslingor

    08/21/2020, 1:31 PM
    What's with all the red? I don't think intelliJ can find PingServiceManager cause it's a generated class at compile time?
    • 1
    • 4
  • r

    Robert Jaros

    08/24/2020, 5:17 PM
    Anyone could clone https://github.com/rjaros/kt41227 and check if there are any problems with
    ./gradlew browserProductionWebpack
    task?
    t
    m
    • 3
    • 4
  • r

    Robert Jaros

    08/26/2020, 2:59 PM
    use like this:
    button("save file").onClick {
                    val fileSaver = require("file-saver")
                    val csv = Blob(arrayOf("Hello, world\nkvision,is,great,:)!"), BlobPropertyBag("text/plain;charset=utf-8"))
                    fileSaver.saveAs(csv, "test.csv")
                }
    l
    • 2
    • 1
  • a

    ashmelev

    08/26/2020, 3:10 PM
    I'd add, because CSV's can be tricky (embedded ""'s for example). I'd use the fasterxml.jackson or openCSV libraries to create the CSV and then download that to the client browser. One can also set the Content-Type header to a value (application/excel as I recall) to have the browser open it in MS Excel (or similar)
    l
    • 2
    • 1
  • r

    Robert Jaros

    09/15/2020, 10:06 AM
    It should connect to your backend running in IDEA
    l
    a
    • 3
    • 5
  • t

    Tomas Kormanak

    09/18/2020, 8:06 AM
    Good morning, we are using component
    TabPanel
    and we often need to work with tabs programmaticaly but TabPanel does not expose much information/methods. We are missing couple of useful methods, like
    getSize()
    - hom many tabs exists
    getComponentIndex(component:Component)
    - to get index of a component
    activate(component:Component)
    - to activate component Or am I missing something and there is a way how to achieve it?
    • 1
    • 1
  • r

    Robert Jaros

    09/18/2020, 8:38 AM
    Please fill an issue on github and I will add better solutions to
    TabPanel
    directly for the next release
    t
    • 2
    • 2
  • t

    Tomas Kormanak

    09/18/2020, 9:06 AM
    Thank you, actually I have another question. We use navbar but we have an issue with closing menus. When I click on a menu I would expect other opened menu to close, but the stay open.
    r
    • 2
    • 27
Powered by Linen
Title
t

Tomas Kormanak

09/18/2020, 9:06 AM
Thank you, actually I have another question. We use navbar but we have an issue with closing menus. When I click on a menu I would expect other opened menu to close, but the stay open.
r

Robert Jaros

09/18/2020, 9:28 AM
Use
collapseOnClick = true
t

Tomas Kormanak

09/18/2020, 11:54 AM
I think there is a bug in collapseOnClick option, it seems it uses different css selectors than dropdowns use.
if (collapseOnClick) {
            setInternalEventListener<Navbar> {
                click = {
                    val target = jQuery(it.target)
                    if (target.`is`("a.nav-item.nav-link")) {
                        val navbar = target.parents("nav.navbar").first()
                        val toggler = navbar.children("button.navbar-toggler")
                        val collapse = navbar.children("div.navbar-collapse")
                        if (collapse.`is`(".show")) toggler.click()
                    }
                }
            }
        }
but dropdown has class
dropdown-toggle
r

Robert Jaros

09/18/2020, 1:12 PM
do you set
forNavbar = true
property when using
DropDown
inside
NavBar
?
t

Tomas Kormanak

09/18/2020, 1:12 PM
I do
r

Robert Jaros

09/18/2020, 1:21 PM
I'll check this out later today
A question - are we talking about collapsed navbar menu? or about a dropdown component put inside a navbar?
t

Tomas Kormanak

09/18/2020, 2:49 PM
a dropdown inside navbar
r

Robert Jaros

09/18/2020, 2:50 PM
I see. That's why it doesn't work. The
collapseOnClick
property is for navbar menu.
The dropdown component is a different case.
It's not really KVision issue, it's a Bootstrap dropdown issue. https://stackoverflow.com/questions/39812115/how-to-close-bootstrap-dropdown-menu-on-button-click
But we can definitely fix this with a similar approach
Adding
collapseOnClick
property for a
DropDown
component
Please fill an issue for this as well.
t

Tomas Kormanak

09/18/2020, 3:00 PM
Just to make sure. The issue is that I have multiple dropdowns in navbar and when I open one I would like to close others
r

Robert Jaros

09/18/2020, 3:07 PM
So you just want a dropdown menu. I will think what can be done about this.
t

Tomas Kormanak

09/18/2020, 3:15 PM
We already use it
r

Robert Jaros

09/18/2020, 3:16 PM
I think it should be possible but it will take some hacking ;-)
t

Tomas Kormanak

09/18/2020, 3:16 PM
🙂
r

Robert Jaros

09/18/2020, 3:17 PM
Right now I can't even propose a workaround because I have
stopPropagation
on the click event in the DropDownButton.
t

Tomas Kormanak

09/18/2020, 3:18 PM
I know.
r

Robert Jaros

09/18/2020, 3:18 PM
But I'll try to fix this during the weekend.
t

Tomas Kormanak

09/18/2020, 3:20 PM
Anyway, could you give me quick brief how to setup KVision for contributing?
r

Robert Jaros

09/18/2020, 3:22 PM
Have you seen https://github.com/rjaros/kvision/blob/master/CONTRIBUTING.md ?
t

Tomas Kormanak

09/18/2020, 3:23 PM
ahh, sorry I missed it.
r

Robert Jaros

09/18/2020, 3:25 PM
It should work the way described, at least until you try to edit npm resources
If you will need to modify css files let me know - I'll try to describe how to do it (at least how I do it ;-)
t

Tomas Kormanak

09/18/2020, 3:28 PM
Thank you I'll try it
View count: 11