How to format the text in a textArea component in Matlab so that it always displays the latest value? - matlab

I am building a MATLAB app using app designer and I have a textArea component which I use to display output message to the user using the app. The component name is OutputStatusTextArea_1 and i set the value of nb_Text to 0 in the startup function.
Whenever I need to display a message I use the following command:
app.nb_Text = app.nb_Text + 1;
app.OutputStatusTextArea_1.Value(app.nb_Text) = strcat({'# '},'New Message')
What happened is at some point the number of message fill completely the text area and then everytime i add a message, the user needs to scroll down to see it.
What I would like is to be able to always display the last message at the bottom of the TextArea and that the user needs to scroll up if he wants to see old message. Is there a way to do so?

have you tried the setCaretPosition function? see this post
https://www.mathworks.com/matlabcentral/answers/255486-set-edit-uicontrol-to-last-line

Related

How do I display data/information with Matlab App Designer?

I would like to display some information to the user via Matlab App Designer's GUI. I am new to this program and can't seem to find a widget that provides what I feel should be a simple function. Am I missing something? Examples would include showing the user:
The path of the file that he/she selected
Errors such as "No files detected" that are printed in a Matlab script called on by the GUI code.
Other print statements in code such as "Done!", etc that will inform the user when a process is complete.
Is there a way to capture the output in the Matlab command line and report these in a window of some sort in the GUI? Thanks in advance!
You can use a TextArea to display information for the user. Here's how I made a simple example:
Drag a button to the app in design view.
Drag in a text area also. I changed the label to Feedback.
Select the button and use the Callbacks tab in the bottom right of app designer to add a callback with the default name it gives you.
Edit the callback to contain
answer = 'what your want to display';
app.FeedbackTextArea.Value = answer;
When you push the button the text area gets filled. In your code, instead of just setting 'answer' to some string, set a variable using whatever code is dealing with your user's information. The key is to store what you want the user to see in a variable and then assign that to the "Value" parameter of the text area or other widget where you want them to see the results.

Mahapps Metro IDialogCoordinator.ShowMetroDialogAsync Execution Order

My goal is to make two successive calls to ShowMetroDialogAsync to display a custom input dialog box followed by a custom message box.
First this call
_dialogCoordinator.ShowMetroDialogAsync(this, _inputDialogView);
followed by
_dialogCoordinator.ShowMetroDialogAsync(this, _messageDialogView);
However instead of the input dialog getting shown first, the message dialog gets shown and the order seems random when I execute the Command consecutively, i.e. sometimes the input dialog gets displayed followed by the message dialog and vice versa.
Am I doing anything wrong?
Many thanks in advance.

How to skip input control screen in Jasperserver (Using Hyperlink from Drill report)

Ok so I created a Drill down Report (lets call it DrillONE) which uses a hyperlink to drill down to a other report (lets call it DrillTWO)
the drill down report (DrillTWO) doesn't have Input controls because it gets all its info from the report that is calling it (DrillONE)
So the hyperlink to DrillTWO looks something like this
"./flow.html?_flowId=viewReportFlow&reportUnit=
%2FNWU%2FStudentInformation%2FAcademicProgramDevelopment%2FAPQIBI005drill
&startDate=" + new SimpleDateFormat("yyyy/MM/dd").format($P{startDate})"
Now my problem comes when Going back from DrillTWO to DrillONE (Without having to enter the input controles again and clicking RUN)
What happens is When I click the hyperlink back to DrillONE it sends the parameters and everything along fine, but it loads the input control screen and then the user has to run the report
I want it to go directly to DrillONE and run it, (Skip the input controle screen)
Is DrillONE set to always prompt for input controls? Turn this off.

"Send" button popup not appearing correctly

I'm using the Facebook Like/Send buttons along with dynamically generated HTML (loaded via AJAX requests). I've found that even though the Send button works fine when the element exists on page load, dynamically created Send buttons aren't working correctly. Clicking the button activates it and the button greys out, but the popup doesn't appear.
Here is a demonstration of what is happening: http://jsfiddle.net/Daniel15/VxpSj/
Any suggestions?
Thanks!
Yes, I can confirm the problem from your fiddle.
function addLikeButton()
{
// […]
FB.XFBML.parse(newEl);
document.getElementById('container').appendChild(newEl);
}
For some reason, this seems to be “the wrong way around”. Reverse the order of these two lines – put the new element into the DOM first and let FB.XFBML.parse parse it afterwards, then (from my test with your fiddle) it seems to work in the desired way.

WWW::Selenium to capture component refresh

I am writing a perl script using WWW::Selenium module to automate a website.
I am not at all a web development guy and have no idea about web technologies.
Let me try to explain the issue in layman terms.
I am dealing with a webpage, which has an order form with a button.
When I click the button, there is no page submit, but the button label changes.
Say for eg, the button goes through these changes when clicked multiple times.
Get Quote --> Order --> Confirm Order
Each time I click the button, there is no page refresh, but the button label keeps changing as above.
The id of the button is the same throughout, only the class changes.
How can I do this in WWW::Selenium?
Presently I am using wait_for_page_to_load(5000) after each click.
But the click is not having any effect on the label and I get error that timed out after 5000s.
Should I be using some other function to wait?
You could do something like this
$sel->wait_for_text_present_ok("Your text","time to wait","The message to display if this fails");
and an example below-
$sel->wait_for_text_present_ok("Order Confirmed","9000","The order was successfully placed");
Seems like you could use
$class = $sel->get_attribute($attribute_locator)
where the $attribute_locator is the button#class with button being the element locator that you clicked. Check if $class is the class you expect.