Post Top Ad

February 13, 2019

Learning Kentico: Component Events

by , in
It's a good day today! Yey! Because I was also able to make the Component Events exercise working. 

At first, I encountered an error that says SelectDoctorEventArgs missing  a directive or assembly reference (screenshot below) 

missing a directive or assembly reference
missing a directive or assembly reference issue

And I tried to search a solution online for that until I saw this Dec 2015 Components article from Kentico Devnet site which is very helpful. He discussed about a common scenario where component events are being used (like in a communication of two webparts in a page), the explanation of the parameters, how it works and some example. 

So I tried to apply it. I have now the two webparts working separately (the doctor's appointment form and the appointment list) but the next challenge is how the two will communicate. I should be able to display the appointment list based on my selection from the doctor dropdown list. 

From that article, I was able to correct or do the ff: 

a. in registering and raising the component events, the component name is the web part id 
b. was able to use the tip that he has provided when using ArgsType method which was my problem (as you see on the first screenshot above)


So I added that in one of code behind of my two web parts, but I couldn't completely remove them because they were 3 errors. I know it's a noob thing to do, but I actually put the custom EventArgs in both of my two web parts. Tsskkkk. yeah right, it doesn't make any sense! And it didn't work. Heheh..so funny! 


And I was thinking, how could I make this like Global? So it brought me back to what I learned/blogged about Global events. Oh yeah, I re-read it - and wait? Sounds like a lot of things to do. I will do the register type of module thingie? No way! Heheheh. 

But good thing, Visual Studio has this bright bulb thingie where it suggested me to why not create a new file for it. So I followed it and everything is now working. Whohoooo! See below: :)

Tried selecting Dr. Queenie Roberts and it displayed the appointment lists for her. 

component events
Displaying appointments for the selected doctor


Checked it also in database and everything is working as expected. :) 

component events
Doctors and Appointment

I know it's just a little accomplishment, but I'm just so happy. I know I still have  A LOT OF LEARN but it feels good. :) I'm going home with a smile on my face. Charot! 

Till my next blog post! 
February 12, 2019

I've finally Get it! (Of Kentico Web Parts & Widgets)

by , in
Oh my gosh! I've finally get it! 

Yesterday, I blogged about not being able to resolve the 2nd exercise for the Web Parts for quite a long time. (The reason why it was still on my draft and why I have opted to study on C# Programming course by Mosh instead - because I was stucked on that exercise ). 

And today, I have finally able to make it work (while I was studying about Macros). Yes, I'm right! As I have predicted it. As you have known, the course will give you reference links or other sources when they discuss a particular topic and it really paid off if you check all of them and study also. 

web parts


It brought me back to review about widgets. I was thinking perhaps I should make the AppointmentList web part to become a widget. And so I did but it is still not showing. Why on earth????

And then I realized as I re-read the instruction: it should be Filter Doctor property only. I added an Appointment list property in the web part before and my query again is incorrect. (Argh! Need to pay attention with this)

web parts

So happy now! Will try the component exercise next and then continue studying Macros. :) 

February 11, 2019

Learning Kentico: Web Parts & Widgets

by , in
Wow!This topic has been on my draft since November 2018 but was never published. So I revisited what I have learned from Web Parts and below are some my notes:

Web Parts
- user controls (.ascx) that needs to inherit from Kentico base classes to ensure that the web part will be properly displayed and that you can manage its properties.

kentico base class,  CMSAbstractWebPart
CMSAbstractWebPart - Kentico base class inherited (for standard listing)

- used on the Design tab of the Pages application
- components that allow you to easily introduce built-in and custom functionality on your website

How to implementing a custom web part?

1. Register web part in web parts application
2. Make sure the web part created inherits to the right/suitable class

Widgets 
- each widget is based on a web part
- needs to be placed inside the widget zones
- called as web parts with hidden properties because this is used by non-technical users (they can only access the important properties but not the advanced properties)


Working with Component Events

- a feature that allows certain parts of the system to communicate.
- One of the most common usages is when you need two or more different web parts to share information.

Types: 
1. request events - fired and survive only within the current request (executed upon each request or page load)
2. global events - fired and survive across during the whole application lifetime (used for complex events that do not depend on single request)

Two Parts:
1. registering an event
2. raising an event

I also learned about these namespaces:
using System.Collections.Generic - used for List
using CMS.Data.Engine = used for Query Operator
using System.Linq = used for ToList

As for the exercises, I couldn't make the 2nd exercise work. I was able to display the list of appointments assigned to a doctor specified in the FilterDoctor web part property.  But I'm confused why it isn't showing in the page. I can't obviously proceed to the third one as it requires a communication between two separate web parts. (Need the contact doctor exercise and appointment list to be on the same page). :(

I'll see in the next lesson (Macros) if I could make it work. I know they are connected. Good luck to me! 
February 08, 2019

How to Fix Restore & Overwrite Database Issue

by , in
I'm making this blog as sort of my repository also for all my learnings in becoming a Web Developer (someday - change career?) so I'll try my best to document those things.

This one is what I encountered just today when trying to restore a database. The error says that the back-up database file cannot be restored over an existing file. (see screenshot below)

database restore failed
(Unable to restore database - click image to enlarge)

So to fix this, all you need to do is just go to the Options menu and then select the Overwrite to an Existing Database. (screenshot below)

database restored successfully
(Database file restored successfully - click image to enlarge) 

February 06, 2019

Hello February, please be good to me!

by , in
My blog post title, it's familiar right? We often see that in a lot of Facebook statuses but that's what I am really hoping this February will turn out to be or even better because there were just quite a few of unexpected surprises and some of life's detours last month. 

First, I have already set my schedule to use the 2nd week of my  holiday off for our medical check-ups and work on some papers for my family (it's my chance, no need to file a leave or be absent from work and have salary deductions hehe) since government offices etc are now back but I had to reschedule all of them. 

We received a news from my cousin (the one helping me at home) that the brother of my mother had died (only brother left at 86 years old, he attended the Esencia Clan Reunion last December). And she requested to stay longer at the province to help. She was supposed to be back after the New Year. So I had to cancel everything and stay at home to look after the needs of my family.

death of a loved one
My mother togethere with her two sisters and the wife of my uncle
And of course, my mother really wanted to see him even for the last time. So the little money that I have saved (supposed to buy a new computer) was used for our travel expense (Thank God, I still have that money). I booked a private vehicle because I can't leave my father and brother at home. We need to travel as a family and it's hard if you will travel using a public transpo especially with our situation. 

But before that, I also encountered ATM problems. I withdrew money the night before our scheduled travel.  Unfortunately, the ATM didn't dispense the money. I was really worried. Though I still have a little cash to pay for the van, I was worried about the money that I am going to use for our food etc on the next few days. Good thing, it didn't take that long before the money was returned. It only took 2 days. It was faster because I withdrew the money on the same bank where my account was opened. 

Next, I was already back working in the office but got a news that my boyfriend was rushed to the hospital. He couldn't bear the extreme stomach pain anymore. He told me that the hyperacidity that he has been complaining for yearsssssss is actually gallstones and his skin has turned jaundice (yellow).

That news really shocked me and I can't help but cry. While I was going to the hospital, I was crying while in the jeepney, while walking and when I saw him. Just too emotional (sorryyyy).

He was immediately scheduled for an operation. The doctor told us that he will be in the operating room for like 3-4hrs. While waiting, I hurriedly went home so I can change clothes and check the situation of my family. I was already back after 3hrs but he was still not out.

hospital room
my boyfie before the surgery (sorry, very camera shy)
Though according to statistics or what I found in Google, that this operation procedure has a 95% success rate it still worries me. I kept going back and forth to the hallway (from our room to the entrance room of the operating room). 

And after 6hrs, he is finally out. I was so relieved. 

Learned the lesson the hard way.  It's a big NO NO to self-diagnose or do self-medication. You really need to consult the doctor for any pain or symptoms that you have. Who knows what it could be? Might be serious or something like what had happened to him. He has been treating it as a pure acid problem. 

But I'm just glad that it's all over now. No more pain. Same as my uncle. I know he has lived a full life.

I don't know how to end my post but I realized that I should stop or avoid complaining. Even though I encountered these life's detours or  got these unexpected news or suprises, God is always there. He continue to provide for us. He makes a way. In the same way during the lowest point of my life where my mother had a stroke (where I don't have any money) he sent people to help me. Thank you very much to my bosses, my bff and to everyone who helped. Owe you a lot.

This is a reminder for me. To be always grateful and believe that there is a reason for everything. As my nephew has quoted in Ecclesiastes 3,
For everything there is a season, and a time for every matter under heaven:
a time to be born, and a time to die;
a time to plant, and a time to pluck up what is planted;
a time to kill, and a time to heal;
a time to break down, and a time to build up;
a time to weep, and a time to laugh;
a time to mourn, and a time to dance;
a time to cast away stones, and a time to gather stones together;
a time to embrace, and a time to refrain from embracing;
a time to seek, and a time to lose;
a time to keep, and a time to cast away;
a time to tear, and a time to sew;
a time to keep silence, and a time to speak;
a time to love, and a time to hate;
a time for war, and a time for peace.
Bible Quote Source



Post Top Ad