-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Would like to see the PromptDialog allow for multiple field entries #1
Comments
Would you need to know the type of value expected? i.e. string, or numeric so a spinner can be thrown in. Or a drop-down list of choices? Just thinking out loud here. Another thought.. what about a dialog that asks the user to select from a series of images? Yeah, I'm getting ahead of myself here, just thinking of the possibilities. |
Another thing that could be added is generic inputs, not just text fields:
Maybe something like this ? |
You can implement custom dialogs both globally and programatically. If it's just application spesific, a custom Window is probably good enough. |
Yeah, I think so.
understood |
In your example above, the "true" is related to the option field? Just making sure I'm following, if the user selects an option, the result would be "true" that an option was selected? Or would the result be the choice title/index/value selected?
Tried to bold the word true. |
Here's an exaple of how to create a custom dialog on runtime (programatically) w/standard dialog interface/base class: const callback = (btn, value, dialog) => {
console.log(btn, value)
};
core.make('osjs/dialogs')
.create({
buttons: ['ok'],
window: {
title: 'My Dialog',
dimension: {width: 400, height: 400}
}
}, (dialog) => {
// The callback for getting dialog value
return dialog.app.getValue();
}, callback)
.render(($content, dialogWindow, dialog) => {
dialog.app = app({
// Your local dialog state
value: 0
}, {
// Your local dialog actions
setValue: value => ({value}),
getValue: () => state => state.value
}, (state, actions) => dialog.createView([
// Your local dialog view
h(RangeField, {
min: 0,
max: 100,
onchange: (ev, value) => actions.setValue(value)
})
]), $content);
}); I haven't used JSX -- but you probably get the idea |
The array of |
I understand the order. I guess I got confused. So, value is the text that would show up as the label for the input field, correct?
Or how would I set the label, in your example? |
An entry in Labels could probably added like this:
|
Your custom example is good as well, and thought about using that for more complex stuff. But, for simple and quick prompts, I like the code you posted with |
Don't forget t update documentation accordingly, to show single input prompt and multiple inputs prompt. Assuming single input would remain the same as it is now. |
Just thought of it, I know you have authentication prompt, but for this. What if a user is required to enter a code that they don't want to be visible, i.e. using the password prompt for some private user code. Please include type: "PasswordField" if you haven't done so already. I'm guessing you're going to have TextField, TextArea, PasswordField, OptionField, etc... ? |
|
ooh. understood. |
Currently the PromptDialog only accepts one value. There should be an array that can be submitted in the "value" field, and then the done() callback function can do a loop through the results.
ex:
The text was updated successfully, but these errors were encountered: