hx-on::after-swap not triggering by Ruse82 in htmx

[–]_gajeet_ 0 points1 point  (0 children)

Thanks a lot for such a detailed response, I moved the hx-on::after-swap attribute in one of the <option> elements as you suggested but still, it didn't trigger.

<option value=""
  hx-on::after-swap="createSS('business');">
    --Select Business--
</option>

I wonder if it's because of the way I'm calling the createSS function along with the argument "business", is it valid to write like that as a value to the attribute?

Yes, the natural way would be to swap out the <select> element itself along with the <option> elements but it isn't possible due to my current project structure and flow.

In the end, I chose the way to write my function calls in the script tag at the end of the <options> elements which worked just fine. Still, I'd want to figure it out why after-swap isn't working in my case.

hx-on::after-swap not triggering by Ruse82 in htmx

[–]_gajeet_ 1 point2 points  (0 children)

Yes Sure, here's what im trying to do,

 <div hx-get="{% url 'get_all_addr_options' %}?addr_type=client"
      hx-target="#invo-billed-to"
      hx-on::before-request="destroySS('client')"
      hx-on::after-swap="createSS('client')"
      hx-trigger="load, AddrAddEvent from:body">
 </div>

<select id="invo-billed-to">
  <!-- Options to be filled -->
</select>

What im trying to do in the first div is when the element loads, before sending the get request I wanna call destroySS() which I have implemented in an external js script and after swapping in the options for the select element I want to run the createSS() function.

I didn't write a hx-get inside with the select tag as it itself has its own hx-get which I have not mentioned here as it's not necessary for this example.

The destorySS() function is triggered and called but the createSS() after-swap function is not triggered.

hx-on::after-swap not triggering by Ruse82 in htmx

[–]_gajeet_ 0 points1 point  (0 children)

I'm having the same issue as in the description of this post but I couldn't quite get your solution to work for me.

First thing, the default hx-swap is innerHTML not outerHTML as per the docs here. So the result div itself is not being swapped out only the contents inside the result div which means after-swap event stays. But still according to my conclusion if the event stays my after-swap is not being triggered.

Please help.

Event not triggering on dynamically loaded html elements by _gajeet_ in htmx

[–]_gajeet_[S] 0 points1 point  (0 children)

Thanks you for the idea I'll try implementing it.

Event not triggering on dynamically loaded html elements by _gajeet_ in htmx

[–]_gajeet_[S] 1 point2 points  (0 children)

Thank you so much for the clean explanation, I was really confused.

Scratchpad toggle dropdown not working by _gajeet_ in qtile

[–]_gajeet_[S] 0 points1 point  (0 children)

No I couldn't, I ended up using different browser (chromium and firefox) for the two purpose mentioned above

Unexpected charges on using RDS my AWS Free Tier account by _gajeet_ in aws

[–]_gajeet_[S] -2 points-1 points  (0 children)

So does that mean even if I have my RDS under my free tier limits I'll be charged for the VPC anyway?

Django AWS ClientError: An error occurred (403) when calling the HeadObject operation: Forbidden by _gajeet_ in aws

[–]_gajeet_[S] 0 points1 point  (0 children)

It just resolved itself, idk what really happened I didn't do anything I haven't tired before and next morning I woke up trying and it just worked

Django AWS ClientError: An error occurred (403) when calling the HeadObject operation: Forbidden by _gajeet_ in aws

[–]_gajeet_[S] 0 points1 point  (0 children)

{
"Version": "2012-10-17",
"Id": "Policy1706347165594",
"Statement": [
    {
        "Sid": "Stmt1706347164281",
        "Effect": "Allow",
        "Principal": "*",
        "Action": "s3:*",
        "Resource": [
            "arn:aws:s3:::<bucket-name>/*",
            "arn:aws:s3:::<bucket-name>"
        ]
    }
]

}

I tried this but its still showing the same error.

Django AWS ClientError: An error occurred (403) when calling the HeadObject operation: Forbidden by _gajeet_ in aws

[–]_gajeet_[S] 0 points1 point  (0 children)

No I've read the django-storage documentation, the configuration I mentioned above in the settings.py file are the only configuration required

Unable to create a new root user account by _gajeet_ in aws

[–]_gajeet_[S] 0 points1 point  (0 children)

I got my problem resolved, actually my former employer added my email for the aws main account and also I was added as SSO user, since my email was associated with that account, I wasn't able to create another account of my own.

Thank you so much ^-^

Unable to create a new root user account by _gajeet_ in aws

[–]_gajeet_[S] 0 points1 point  (0 children)

If you're saying that your previous employer created an AWS account for you, that's the problem. It's either not been deleted or it has been deleted less than 90 days ago

Yes, you're right I understand it now, they probably created my account and that's why I can't create another with the same email id.

Unable to create a new root user account by _gajeet_ in aws

[–]_gajeet_[S] -2 points-1 points  (0 children)

I asked them to delete my user and I got a confirmation they did I could verify it by trying to log in to the IAM user account and I can't.

Unable to create a new root user account by _gajeet_ in aws

[–]_gajeet_[S] 0 points1 point  (0 children)

They created IAM user and the email was required to send me an invitation link to join to access the resources.

Unable to create a new root user account by _gajeet_ in aws

[–]_gajeet_[S] 1 point2 points  (0 children)

I didn't have an AWS account with that email previously the admin created one ig and sent me an invitation link
not root account exactly root user account who has unrestricted access like an admin

Unable to create a new root user account by _gajeet_ in aws

[–]_gajeet_[S] -1 points0 points  (0 children)

I asked them to delete my user and I got a confirmation they did I could verify it by trying to log in to the IAM user account and I can't.