Hi, I am using the below script in button. But alignment of the text is not good. Any way to adjust my script?
i = 0
tag_check_neagtive = ["[default]Montreal/Weather/Description","[default]Montreal/Weather/Description","[default]Montreal/Weather/Description"]
negative_message = 'Minimum and Maximun retrieval modes for data extraction are unavailable for string type data. \nIf you want to proceed with other retrieval methods click OK. To remove these tags from the order click REMOVE.'
for y in tag_check_neagtive:
negative_message = negative_message +'\n'+ str(tag_check_neagtive[i])
system.gui.confirm(negative_message,"Confirm")
i = 0
tag_check_neagtive = ["[default]Montreal/Weather/Description","[default]Montreal/Weather/Description","[default]Montreal/Weather/Description"]
negative_message = '<html>Minimum and Maximun retrieval modes for data extraction are unavailable for string type data. \nIf you want to proceed with other retrieval methods click OK. To remove these tags from the order click REMOVE.'
for y in tag_check_neagtive:
negative_message = negative_message +'\n'+ str(tag_check_neagtive[i])
system.gui.confirm(negative_message,"Confirm")
Replace your current button code with something like this: system.nav.openWindow('YourPopupPath/removeTagConfirm')
Then, create a custom popup window with the buttons you want. You will have to use a label in the popup for your message, The code will look something like this:
i = 0
tag_check_neagtive = ["[default]Montreal/Weather/Description","[default]Montreal/Weather/Description","[default]Montreal/Weather/Description"]
negative_message = 'Minimum and Maximun retrieval modes for data extraction are unavailable for string type data. \nIf you want to proceed with other retrieval methods click OK. To remove these tags from the order click REMOVE.'
for y in tag_check_neagtive:
negative_message = negative_message +'\n'+ str(tag_check_neagtive[i])
event.source.parent.getComponent('tagDeleteConfirmationLabel').text = negative_message
Then you can program the confirm and remove buttons to do whatever you need them to do, and you can change the text properties of the buttons to whatever you want
Paul Griffith’s suggestion was actually pretty simple to implement. Now that I’ve used it, I remembered this post, and I’ve reformatted the code to fit the context of this question. Here it is:
from javax.swing import JOptionPane
i = 0
tag_check_neagtive = ["[default]Montreal/Weather/Description","[default]Montreal/Weather/Description","[default]Montreal/Weather/Description"]
negative_message = '<html>Minimum and Maximun retrieval modes for data extraction are unavailable for string type data. \nIf you want to proceed with other retrieval methods click OK. To remove these tags from the order click REMOVE.'
for y in tag_check_neagtive:
negative_message = negative_message +'\n'+ str(tag_check_neagtive[i])
JOptionPane.showOptionDialog(None, negative_message, "Confirm", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, None, ["Confirm", "Remove"], "Confirm")
Here is a more complex example, that shouldn't be too difficult for you to further develop into exactly what you are looking for. There really are no limitations when you are building these things from scratch: