How to add parameter URL while keep old param? - spring-boot

I'm using this for my page with pagination. But when I change page all of the old params I set removed.
<li class="page-item" th:unless="${page.number == i}"><a class="page-link" th:text="${i+1}"
th:href="${'?'+('&page='+i)
+(#request.getParameter('size')==null?'':('&size='+#request.getParameter('size')))
+(#request.getParameter('sortByPrice')==null?'':('&sortByPrice='+#request.getParameter('sortByPrice')))
}"></a>
</li>
Please help me!

The current page1 reads the parameters size and sortByPrice from request object which might have been coming on as URL query parameters or form elements. When you go to the next page these 2 parameters are not present on request object so the 2nd page2 is not getting them. On the current page1 as you read size and sortByPrice also write them on page1 as hidden form elements then page2 will see them. You can write them on the URL to be clicked to go to page2.

Related

Wix - open a page with argument?

I need to navigate to a new page, then call a specific function in that page.
In other words, open a page when a certain box is collasped/hidden etc.
Should I pass parameter from page1 to page 2 ? how ?
Can I call a function from page1 to page2 then navigate (using wix.location ) ?
So you can use wix-location to pass a queryParam to the page you're going to and then just run a code in the other page that reads from the URL.
Wix-location API
Hope this helps..

How to have a button in Magento, Which opens an Other Site URL?

am new to magento. how to have a button ,instead of add to cart button on product page. That button has to open a URL in a new window,which i mentioned in an attribute. Each product has different URL according to the product.kindly help in this issue
Thanks in advance.
To have the button in the product page you will have to copy the file:
for 1.9: app/design/rwd/default/template/catalog/product/view/addtocart.phtml
for previous: app/design/base/default/template/catalog/product/view/addtocart.phtml
You can then copy it to: app/design/[your_package]/[your_theme]/template/catalog/product/view/addtocart.phtml
In this template file, you create the button HTML and call in the attribute with
$this->getYourAttributeKey();
So for example, if you had the URL in the attribute, you could call the URL from the product and into the button by doing something like this:
<input type="button" value="Put Your Text Here" onclick="window.location.href='<?php echo $this->getYourAttributeKey(); ?>'" />
Note
If your attribute's key is something like "my_attribute_code_here", when you are calling it from the template, remove the underscores and make each letter upper case. Magento will use it's "magic getters" to pull the information it needs from the object. So:
my_attribute_code_here == $this->getMyAttributeCodeHere();

Django - How to cache AJAX result HTML block

I have a search page that, by default lists products in a random order. Clicking a product lets you view it, and then there's a 'back' link which takes you back to the product list - this is saved in the random order using {% cache %} <ul of results...</ul> {% endcache %} with memcached. All works fine and well (have even a html comment cached # h:i:s to check)!
The search has an ajax enhanced interface which does all the ajax-type-stuff you'd expect; it also updates the url to reflect exactly the same url that the non js search would do (behind the scenes communicating with this exact url, only with an /ajax/true/ flag in the url iteself).
When you use the ajax search even once to alter the results, for example set a country name, then click view product, when you click 'back' link the product ordering is back to random (as it has not been cached); the product set is saved though (generated from the url).
Is it possible to cache the result block using the django cache as ajax generates it, keeping the order and set exactly the same for when you hit that url again? or should I investigate other avenues?
Cache the results:
Example ajax search (with cache):
https://github.com/tomchuk/django-ajax-tasks/blob/master/example/templates/home.html
https://github.com/tomchuk/django-ajax-tasks/blob/master/ajax_tasks/templatetags/ajax_task.py
From django-ajax-tasks: https://github.com/tomchuk/django-ajax-tasks

Loading a page from url does not work, but page work when I click Refresh

I have a URL that displays a customer list like this:
http://domain.com/pls/apex/f?p=724:2:820875406836801:::::
The list of customers are displayed with the title being linked to Page3 & request has CustomerId
When I click the URL http://domain.com/pls/apex/f?p=724:3:21712451478201::NO:RP,3:P3_CUSTOMER_ID:82, Page 3 is loaded correctly with details of selected customer. But the "Update" and "Delete" action buttons never work.
But, if I click the browser refresh button and then try to perform an update or delete, it works.
I don't know where I could be going wrong. Can someone give me hints?
I am not using BRANCH_TO_PAGE_ACCEPT in my URL link definition.
It looks like you have the session ID hardcoded in the URL on page 2:
http://domain.com/pls/apex/f?p=724:2:820875406836801:::::
The session ID is 820875406836801, whereas:
http://domain.com/pls/apex/f?p=724:3:21712451478201::NO:RP,3:P3_CUSTOMER_ID:82
The session ID has mysteriously been changed to 21712451478201. I'm not sure, but I suspect that you've hardcoded the session ID in your report on page 2. This has the effect of causing a new login session to be created when page 3 is opened (and maybe this is why the update/delete buttons don't work - but you haven't told us what the error message is so I'm not sure); refreshing the page may be restoring the session.
If I'm right, what you need to solve this issue is to use the session variable (&SESSION.) in your report on page 2 instead of hardcoding it, e.g.:
http://domain.com/pls/apex/f?p=724:3:&SESSION.::NO:RP,3:P3_CUSTOMER_ID:82
The issue was with the way the url was created. First of all, I should not set only 1 thing (Title) to be a url. It should be the entire div. Like below.
<li><div style="">
<a href="f?p=&APP_ID.:2:&SESSION.::NO::P2_PK_PROJECT_ID:#LINK#" rel="external">
<h3>#TITLE#</h3>
<p><strong>#BOLD_TEXT#</strong></p>
<p>#PLAIN_TEXT#</p>
</a></div>
</li>
A report row template with the above code was created. This template is used in my Customers List page. Now each customer is a link (Title, Name, etc). The link href is also hard-coded. Note that I am passing ProjectID:#LINK# #LINK# refers to a value like 1, 2 etc
Now clicking this, loads page 2 correctly and Apply Changes & Delete button are now clickable.

Making database results as html links

I am new to cakephp and I want my database results to be shown as a link so that if a user clicks on the result, he/she should be redirected to a different page which is in different controller and have a different view. Any Help??
For example: I have this line of code that displays the result from the database.
<?php echo $Menu['Menu'] ['menuname']; ?> </td>
I want the users to see this menuname as a link which will redirect to the menu items page.
This is a plane php code (programming language). So, you can add any link to any page you want at the menu. For example replace this code with:
<?php echo ''.$Menu['Menu']['menuname']. ''' </td>
Or post what exactly link you want to show for users.

Resources